CN116048772B - Method and device for adjusting frequency of central processing unit and terminal equipment - Google Patents

Method and device for adjusting frequency of central processing unit and terminal equipment Download PDF

Info

Publication number
CN116048772B
CN116048772B CN202211035643.0A CN202211035643A CN116048772B CN 116048772 B CN116048772 B CN 116048772B CN 202211035643 A CN202211035643 A CN 202211035643A CN 116048772 B CN116048772 B CN 116048772B
Authority
CN
China
Prior art keywords
load
cpu
cluster
load state
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211035643.0A
Other languages
Chinese (zh)
Other versions
CN116048772A (en
Inventor
姜仕双
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211035643.0A priority Critical patent/CN116048772B/en
Publication of CN116048772A publication Critical patent/CN116048772A/en
Application granted granted Critical
Publication of CN116048772B publication Critical patent/CN116048772B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a method, a device and a terminal device for adjusting CPU frequency, wherein in the method for adjusting CPU frequency, after the terminal device obtains the load of a CPU and the load of other load factors in a hardware system, the load state of a cluster to which the CPU belongs in a current sampling period is determined according to the load of one or a combination of the load of the CPU and the load of other load factors, and when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the terminal device improves the frequency limiting threshold value of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs, so that the service performance can be effectively improved.

Description

Method and device for adjusting frequency of central processing unit and terminal equipment
Technical Field
The embodiment of the application relates to the technical field of intelligent terminals, in particular to a method and a device for adjusting the frequency of a central processing unit (central processing unit, CPU) and terminal equipment.
Background
The terminal system has a large number of applications and a plurality of complex interaction scenes, and brings great challenges to resource scheduling and power consumption optimization. The prior related art generally adopts a frequency limiting strategy oriented to application or scene level to solve the problem of resource allocation, or uses a foreground application as a main source to allocate resources (neglect background service appeal), thereby causing insufficient resource supply to influence the performance. That is, in the related art, the power consumption can be effectively saved by full-field frequency limitation or dynamically adjusting the CPU frequency according to the frame drawing condition of the foreground application, but the scheme cannot sense the load condition of background services (such as encoding and decoding, network downloading, file decompressing, file copying or application installing, etc.), which easily causes the performance degradation caused by the limitation of CPU resources.
Disclosure of Invention
The embodiment of the application provides a method and a device for adjusting CPU frequency and terminal equipment, and also provides a computer readable storage medium for improving the frequency limiting threshold of a cluster to which a CPU belongs when the terminal equipment determines that the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, so that the service performance is effectively improved.
In a first aspect, the present application provides a method for adjusting a CPU frequency, including: and acquiring loads of a CPU and loads of other load factors in the hardware system, wherein the other load factors comprise: input/output IO, memory and a graphics processor GPU; according to the load of one or a combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period; when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the frequency limiting threshold of the cluster to which the CPU belongs is increased or the frequency limiting control of the cluster to which the CPU belongs is canceled.
In the method for adjusting the CPU frequency, after the terminal equipment acquires the load of the CPU and the load of other load factors in the hardware system, the load state of the cluster to which the CPU belongs in the current sampling period is determined according to the load of one or a combination of the load of the CPU and the load of other load factors, and when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the terminal equipment improves the frequency limiting threshold value of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs, so that the service performance can be effectively improved.
In one possible implementation manner, after the frequency limiting threshold of the cluster to which the CPU belongs is increased or the frequency limiting control of the cluster to which the CPU belongs is cancelled, the method further includes: according to the load of one or combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in a continuous preset number of sampling periods after the current sampling period; and if the load states of the clusters to which the CPU belongs in the continuous preset number of sampling time periods are all low-load states, recovering the frequency limiting threshold value of the clusters to which the CPU belongs.
In one possible implementation manner, after determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors, the method further includes: and when the load state of the cluster to which the CPU belongs in the current sampling period is a holding state, adopting the frequency limiting threshold value of the cluster to which the CPU belongs in the last sampling period.
In one possible implementation manner, the load of the CPU includes a load of a cluster to which the CPU belongs; the determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors comprises: determining the load state of the CPU according to the load of the CPU, and determining the load state of one or a combination of other load factors according to the load of the one or the combination of the other load factors; and determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load state of the CPU and the load state of the IO factor.
In one possible implementation manner, the determining, according to the load state of the CPU and the load state of the IO factor, the load state of the cluster to which the CPU belongs in the current sampling period includes: when the load state of the CPU is high load and the load state of one or a combination of the other load factors is high load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is high load state; when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load; and when the load state of the CPU is hysteresis, the load state of one or a combination of the other load factors is high load, or the load state of the CPU is high load, and the load state of one or a combination of the other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
In a second aspect, an embodiment of the present application provides a device for adjusting a CPU frequency, where the device is included in a terminal device, and the device has a function of implementing the behavior of the terminal device in the first aspect and possible implementations of the first aspect. The functions may be realized by hardware, or may be realized by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above. For example, an acquisition module, a determination module, an adjustment module, and the like.
In a third aspect, an embodiment of the present application provides a terminal device, including: one or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the terminal device, cause the terminal device to perform the steps of: and acquiring loads of a CPU and loads of other load factors in the hardware system, wherein the other load factors comprise: input/output IO, memory and a graphics processor GPU; according to the load of one or a combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period; when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the frequency limiting threshold of the cluster to which the CPU belongs is increased or the frequency limiting control of the cluster to which the CPU belongs is canceled.
In one possible implementation manner, when the instruction is executed by the terminal device, after the step of raising the frequency limiting threshold of the cluster to which the CPU belongs or canceling the frequency limiting control of the cluster to which the CPU belongs, the terminal device further executes the following steps: according to the load of one or combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in a continuous preset number of sampling periods after the current sampling period; and if the load states of the clusters to which the CPU belongs in the continuous preset number of sampling time periods are all low-load states, recovering the frequency limiting threshold value of the clusters to which the CPU belongs.
In one possible implementation manner, when the instruction is executed by the terminal device, the terminal device is caused to execute the step of determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of the CPU and one or a combination of other load factors, and then execute the following steps: and when the load state of the cluster to which the CPU belongs in the current sampling period is a holding state, adopting the frequency limiting threshold value of the cluster to which the CPU belongs in the last sampling period.
In one possible implementation manner, the load of the CPU includes a load of a cluster to which the CPU belongs; when the instructions are executed by the terminal device, the step of causing the terminal device to execute the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors comprises: determining the load state of the CPU according to the load of the CPU, and determining the load state of one or a combination of other load factors according to the load of the one or the combination of the other load factors; and determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load state of the CPU and the load state of the IO factor.
In one possible implementation manner, when the instruction is executed by the terminal device, the step of causing the terminal device to execute the determining, according to the load state of the CPU and the load state of the IO factor, the load state of the cluster to which the CPU belongs in the current sampling period includes: when the load state of the CPU is high load and the load state of one or a combination of the other load factors is high load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is high load state; when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load; and when the load state of the CPU is hysteresis, the load state of one or a combination of the other load factors is high load, or the load state of the CPU is high load, and the load state of one or a combination of the other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
It should be understood that the second and third aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the advantages obtained by each aspect and the corresponding possible implementation manner are similar, and are not repeated.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored therein, which when run on a computer, causes the computer to perform the method provided in the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program for performing the method provided in the first aspect, when the computer program is executed by a computer.
In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Drawings
FIG. 1 is a schematic frequency diagram of a CPU in file decompression provided in the prior art;
FIG. 2 is a schematic diagram of CPU frequency when a table provided in the prior art is inserted into a picture;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 4 is a block diagram of a software architecture of a terminal device 100 according to an embodiment of the present application;
FIG. 5 is a flowchart of a method for adjusting CPU frequency according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for adjusting CPU frequency according to another embodiment of the present application;
Fig. 7 is a schematic structural diagram of a terminal device according to another embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments of the application herein is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application.
The frequency limiting scheme provided by the prior art cannot sense the load condition of background services (such as encoding and decoding, network downloading, file decompressing, file copying or application installation, and the like), and the performance is reduced due to the limitation of CPU resources.
Fig. 1 is a frequency schematic diagram of a CPU in file decompression provided in the prior art, as shown in fig. 1, a decompression task of a file manager mainly runs on the CPU7, the CPU7 fluctuates between frequencies 1.3 GHz and 2.1GHz to limit frequency, the CPU7 does not run continuously at high frequency, and finally the whole decompression process consumes a long time and has poor user experience.
Fig. 2 is a schematic frequency diagram of a CPU when a table provided in the prior art is inserted into a picture, as shown in fig. 2, when a user performs an operation of opening a floating window and opening a gallery to drag a picture into the table, picture encoding and decoding operations related to the above operation process mainly operate on the CPU5 and the CPU7, the CPU frequency is limited to different degrees, the CPU5 and/or the CPU7 are not continuously operated at high frequency, which finally results in long time consumption and poor user experience in the whole process.
According to analysis, the problem of poor service performance experience is mainly caused by application-oriented or scene-level frequency limiting, and based on the problem, the embodiment of the application provides the CPU frequency adjusting method, which can improve the frequency limiting threshold of the cluster to which the CPU belongs when the terminal equipment determines that the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, so that the service performance is effectively improved.
The method for adjusting the CPU frequency provided by the embodiment of the present application may be applied to a terminal device, where the terminal device may be a smart phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), and other devices; the embodiment of the application does not limit the specific type of the terminal equipment.
For example, fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application, and as shown in fig. 3, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (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 speaker 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 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: 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 video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may 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 may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, DCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement a touch function of the terminal device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It is to transmit data inSerial communicationAnd (3) withParallel communicationAnd between transitions. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may communicate to the wireless via a UART interfaceThe module 160 delivers audio signals to implement the function of playing music through the bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing function of terminal device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display function of the terminal device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the terminal device 100, or may be used to transfer data between the terminal device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. The charging management module 140 may also supply power to the terminal device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the terminal device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the terminal device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of terminal device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that terminal device 100 may communicate with a network and other devices via wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The terminal device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the terminal device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record video in various encoding formats, for example: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the terminal device 100 may be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize expansion of the memory capability of the terminal device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (such as audio data, phonebook, etc.) created during use of the terminal device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the terminal device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or to handsfree talk through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the terminal device 100 receives a call or voice message, it is possible to receive voice by approaching the receiver 170B to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The terminal device 100 may be provided with at least one microphone 170C. In other embodiments, the terminal device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the terminal device 100 may be further provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, implement directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The terminal device 100 determines the intensity of the pressure according to the change of the capacitance. When a touch operation is applied to the display 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal device 100 may also calculate the position of the touch from the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. Illustratively, when the shutter is pressed, the gyro sensor 180B detects the angle of the shake of the terminal device 100, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to counteract the shake of the terminal device 100 by the reverse motion, thereby realizing anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates altitude from barometric pressure values measured by the barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The terminal device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the terminal device 100 is a folder, the terminal device 100 may detect opening and closing of the folder according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E can detect the magnitude of acceleration of the terminal device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the terminal device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The terminal device 100 may measure the distance by infrared or laser. In some embodiments, the terminal device 100 may range using the distance sensor 180F to achieve fast focusing.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 detects infrared reflected light from a nearby object using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object in the vicinity of the terminal device 100. When insufficient reflected light is detected, the terminal device 100 may determine that there is no object in the vicinity of the terminal device 100. The terminal device 100 can detect that the user holds the terminal device 100 close to the ear to talk by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The terminal device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The terminal device 100 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access an application lock, fingerprint photographing, fingerprint incoming call answering and the like.
The temperature sensor 180J is for detecting temperature. In some embodiments, the terminal device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 performs a reduction in the performance of a processor located near the temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the terminal device 100 heats the battery 142 to avoid the low temperature causing the terminal device 100 to shut down abnormally. In other embodiments, when the temperature is below a further threshold, the terminal device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the terminal device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The terminal device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the terminal device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be contacted and separated from the terminal apparatus 100 by being inserted into the SIM card interface 195 or by being withdrawn from the SIM card interface 195. The terminal device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as call and data communication. In some embodiments, the terminal device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
The software system of the terminal device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the terminal device 100 is illustrated.
Fig. 4 is a block diagram of a software architecture of a terminal device 100 according to an embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application Framework (FWK) layer, a Native (Native) layer, a Kernel (Kernel) layer, and a hardware layer.
The application layer may include a series of application packages.
As shown in fig. 4, the application package may include WPS, file manager, game, and other applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application layer applications. The application framework layer includes a number of predefined functions.
The kernel layer is a layer between hardware and software. As shown in fig. 4, the kernel layer includes a load management engine, where the load management engine is configured to implement the 3 functions of load statistics, load decision and frequency adjustment in the method for adjusting CPU frequency provided by the embodiment of the present application. Specifically, the functions of the load management engine described above may be implemented by the processor 110 in the terminal device 100 shown in fig. 3.
The hardware layers include a CPU, double Data Rate (DDR), flash friendly file system (flash friendly file system, F2 FS), and GPU.
For easy understanding, the following embodiments of the present application will take a terminal device having a structure shown in fig. 3 and fig. 4 as an example, and specifically describe a method for adjusting CPU frequency provided by the embodiments of the present application in conjunction with the accompanying drawings and application scenarios.
Fig. 5 is a flowchart of a method for adjusting a CPU frequency according to an embodiment of the present application, where, as shown in fig. 5, the method for adjusting a CPU frequency may include:
in step 501, the terminal device 100 obtains the load of the CPU and the load of other load factors in the hardware system.
Wherein the other load factors may include: IO, memory, and GPU.
Specifically, in this embodiment, the load of the CPU is controlled according to the load of the cluster (cluster) to which the CPU belongs, or according to the load of the whole machine; IO is controlled according to the read or write times. The manner of acquiring the load of the CPU and the load of the IO factor is given below, referring to table 1, and various indexes required for acquiring the load of the CPU are shown in table 1.
TABLE 1
CPU index Meaning of
user User state time
nice nice user state time
system Kernel mode time
idle Idle time
iowait I/O latency
irq Hard interrupt time
softirq Soft interrupt time
steal Time of theft
guest Guest time
guest_nice nice guest time
The calculation method of the single CPU load may be as shown in the formulas (1) to (2), taking the CPU i as an example:
total i =(user+nice+system+idle+iowait+irq+softirq+stealstolen+guest+guest_nice) (1)
busy i =total i –idle (2)
the calculation mode of the load of the cluster to which the CPU i belongs may be as shown in the formulas (3) to (5), taking the cluster to which the CPU i belongs as the cluster i as an example, and assuming that the cluster i has the CPUs m to n:
loading(c i )=(busy(c i ,t 2 )-busy(c i ,t 1 ))/(total(c i ,t 2 )-total(c i ,t 1 )) (5)
in the formula (5), loading (c) i ) I.e. the load of cluster i to which CPU i belongs, t 1 And t 2 Time points of two consecutive samples, respectively, from t 1 To t 2 This period is the current sampling period.
Referring now to Table 2, table 2 shows the various indices required to obtain the load of IO factors.
TABLE 2
IO index Meaning of
read_tps Number of successfully completed read requests
write_tps Number of successfully completed write requests
The calculation formula of the IO load can be shown as the formula (6) to the formula (7):
loading read =read_tps t2 –read_tps t1 (6)
loading write =write_tps t2 –write_tps t1 (7)
in the formula (6), loading read In the formula (7), loading is performed for loading during the read operation write For the load at the time of writing.
In step 502, the terminal device 100 determines the load status of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors.
That is, the load state of the cluster to which the CPU belongs in the current sampling period may be determined according to the load of the CPU and the load of one or more of the IO, the memory, and the GPU.
Specifically, in this embodiment, the load of the CPU may be the load of the cluster to which the CPU belongs; specifically, when the terminal device 100 determines, according to the load of one or a combination of the load of the CPU and the load factor of the other load factors, the load state of the cluster to which the CPU belongs in the current sampling period may be: determining the load state of the CPU according to the load of the CPU, and determining the load state of one or a combination of other load factors according to the load of the one or the combination of the other load factors; and then, according to the load state of the CPU and the load state of the IO factor, determining the load state of the cluster to which the CPU belongs in the current sampling period.
Further, according to the load state of the CPU and the load state of the IO factor, the determining the load state of the cluster to which the CPU belongs in the current sampling period may be:
when the load state of the CPU is high load and the load state of one or a combination of the other load factors is high load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is high load state; when the load state of the CPU is low load or the load state of one or a combination of the other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load; and when the load state of the CPU is hysteresis (keeper), and the load state of one or a combination of the other load factors is a high load state, or the load state of the CPU is a high load state, and the load state of one or a combination of the other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
Still taking the example of determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of the CPU and the load of the IO factor, referring to table 3, table 3 shows a manner of determining the load state of the CPU and the load state of the IO factor according to the load of the cluster to which the CPU belongs and the load of the IO factor, respectively.
TABLE 3 Table 3
/>
Further, according to the load state of the CPU and the load state of the IO factor, determining the load state of the cluster to which the CPU belongs in the current sampling period may be as shown in table 4.
TABLE 4 Table 4
CPU+IO combination Load status of cluster to which CPU belongs
CPU_high(i)+IO_high high_load(i)
CPU_high(i)+IO_low low_load(i)
CPU_keep(i)+IO_high keep(i)
CPU_keep(i)+IO_low low_load(i)
CPU_low(i)+IO_high low_load(i)
CPU_low(i)+IO_low low_load(i)
In step 503, when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the terminal device 100 increases the frequency limiting threshold of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs.
It may be appreciated that, after step 502, when the load state of the cluster to which the CPU belongs in the current sampling period is a low load state or a keep (keep) state, the terminal device 100 still adopts the frequency limiting threshold of the cluster to which the CPU belongs in the previous sampling period.
In the method for adjusting the CPU frequency, after the terminal device 100 obtains the load of the CPU and the load of other load factors in the hardware system, the load state of the cluster to which the CPU belongs in the current sampling period is determined according to the load of one or a combination of the load of the CPU and the load of other load factors, and when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the terminal device 100 increases the frequency limiting threshold of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs, thereby effectively improving the service performance.
Fig. 6 is a flowchart of a method for adjusting CPU frequency according to another embodiment of the present application, as shown in fig. 6, in the embodiment of fig. 5 of the present application, after step 503, the method may further include:
in step 601, according to the load of the CPU and the load of one or a combination of other load factors, the load state of the cluster to which the CPU belongs in a predetermined number of sampling periods after the current sampling period is determined.
The predetermined number may be set by the user when the method is actually performed, and the size of the predetermined number is not limited in this embodiment, for example, the predetermined number may be 3.
In step 602, if the load states of the clusters to which the CPU belongs in the consecutive predetermined number of sampling periods are all low-load states, the frequency limiting threshold of the clusters to which the CPU belongs is restored.
That is, after the terminal device 100 increases the frequency limit threshold of the cluster to which the CPU belongs or cancels the frequency limit control of the cluster to which the CPU belongs, if the load state of the cluster to which the CPU belongs is a low load state in the next sampling period after the current sampling period, the terminal device 100 does not immediately adjust the frequency limit threshold of the cluster to which the CPU belongs, but continuously judges 3 sampling periods after the current sampling period, if the load state of the cluster to which the CPU belongs is a low load state in the continuous 3 sampling periods, the terminal device 100 can restore the frequency limit threshold of the cluster to which the CPU belongs, that is, the frequency limit threshold of the cluster to which the CPU belongs can be restored to the frequency limit threshold before the increase.
When the load state of the cluster to which the CPU belongs in the current sampling period is determined to be a high load state, the CPU frequency adjusting method improves the frequency limiting threshold value of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs; and when the load state of the cluster to which the CPU belongs in the current sampling period is determined to be hysteresis, the last state is maintained, and ping-pong is avoided. The CPU frequency adjusting method provided by the embodiment of the application can sense the load change of factors such as CPU, IO and the like according to the actual running state of the task, and improve or maintain the frequency limiting threshold value of the cluster to which the CPU belongs through load statistics and state identification, so that the performance and the power consumption of the terminal equipment 100 can be intelligently balanced, the experience requirements of users can be met, and the problems of excessive performance and power consumption waste caused by unnecessary frequency boosting can be solved.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and that embodiments of the present application may also perform other operations or variations of the various operations. Furthermore, the various steps may be performed in a different order presented in the above embodiments, and it is possible that not all of the operations in the above embodiments are performed.
It will be appreciated that the terminal device, in order to achieve the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The various exemplary algorithm steps described in connection with the disclosed embodiments of the application may be embodied in hardware or in a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In this embodiment, the terminal device may be divided into functional modules according to the above embodiment of the method, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one module. The integrated modules described above may be implemented in hardware. It should be noted that, in this embodiment, the division of the modules is schematic, only one logic function is divided, and another division manner may be implemented in actual implementation.
Fig. 7 is a schematic structural diagram of a terminal device according to another embodiment of the present application, where, in a case where respective functional modules are divided by corresponding respective functions, fig. 7 shows a possible schematic structural diagram of a terminal device 700 related to the above embodiment, as shown in fig. 7, the terminal device 700 may include: an acquisition module 701, a determination module 702 and an adjustment module 703;
the acquiring module 701 is configured to acquire a load of a CPU and a load of other load factors in a hardware system, where the other load factors include: IO, memory and GPU;
a determining module 702, configured to determine, according to a load of one or a combination of a load of the CPU and another load factor, a load state of a cluster to which the CPU belongs in a current sampling period;
And the adjusting module 703 is configured to, when the determining module 702 determines that the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, increase the frequency limiting threshold of the cluster to which the CPU belongs or cancel the frequency limiting control of the cluster to which the CPU belongs.
In addition, the adjusting module 703 is further configured to, after the determining module 702 determines, according to the load of the CPU and the load of one or a combination of other load factors, a load state of the cluster to which the CPU belongs in the current sampling period, and when the determining module 702 determines that the load state of the cluster to which the CPU belongs in the current sampling period is a hold state, use a frequency limiting threshold of the cluster to which the CPU belongs in the previous sampling period.
Further, the determining module 702 is further configured to determine, after the adjusting module 703 increases the frequency limiting threshold of the cluster to which the CPU belongs or cancels the frequency limiting control of the cluster to which the CPU belongs, a load state of the cluster to which the CPU belongs in a sampling period of a predetermined number of consecutive sampling periods after the current sampling period according to a load of the CPU and a load of one or a combination of other load factors;
the adjusting module 703 is further configured to restore the frequency limiting threshold of the cluster to which the CPU belongs when the load states of the cluster to which the CPU belongs in the consecutive predetermined number of sampling periods are all low-load states.
In this embodiment, the load of the CPU may be a load of a cluster to which the CPU belongs; the determining module 702 is specifically configured to determine a load state of the CPU according to a load of the CPU, and determine a load state of one or a combination of other load factors according to a load of the one or the combination of other load factors; and determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load state of the CPU and the load state of the IO factor.
More specifically, the determining module 702 is specifically configured to determine that, when the load state of the CPU is a high load and the load state of one or a combination of other load factors is a high load, the load state of the cluster to which the CPU belongs in the current sampling period is a high load state; when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load; and when the load state of the CPU is hysteresis and the load state of one or a combination of other load factors is high load or the load state of the CPU is high load and the load state of one or a combination of other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
It should be noted that, all relevant contents of each step related to the method embodiments shown in fig. 5 to fig. 6 of the present application may be referred to the functional descriptions of the corresponding functional modules, which are not repeated herein.
The terminal device 700 provided in this embodiment is used to execute the method for adjusting the CPU frequency provided in the embodiments shown in fig. 5 to 6 of the present application, so that the same effects as those of the above method can be achieved.
It should be understood that the terminal device 700 may correspond to the terminal device 100 shown in fig. 1. The functions of the acquisition module 701, the determination module 702 and the adjustment module 703 may be implemented by the processor 110 in the terminal device 100 shown in fig. 3.
In case of employing an integrated unit, the terminal device 700 may include a processing module, a storage module, and a communication module.
The processing module may be configured to control and manage the actions of the terminal device 700, for example, may be configured to support the terminal device 700 to perform the steps performed by the acquiring module 701, the determining module 702, and the adjusting module 703. The memory module may be used to support the terminal device 700 to store program codes, data, and the like. And a communication module, which may be used to support communication between the terminal device 700 and other devices.
Wherein the processing module may be a processor or controller that may implement or execute the various exemplary logic blocks, modules and circuits described in connection with the present disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital signal processing (digital signal processing, DSP) and microprocessor combinations, and the like. The memory module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In an embodiment, when the processing module is a processor and the storage module is a memory, the terminal device 700 according to this embodiment may be a device having the structure shown in fig. 3.
Embodiments of the present application also provide a computer-readable storage medium having a computer program stored therein, which when run on a computer causes the computer to perform the methods provided by the embodiments of the present application shown in fig. 5 to 6.
Embodiments of the present application also provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method provided by the embodiments of the present application shown in fig. 5-6.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided by the present application, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely exemplary embodiments of the present application, and any person skilled in the art may easily conceive of changes or substitutions within the technical scope of the present application, which should be covered by the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A method for adjusting the CPU frequency of a central processing unit, comprising:
and acquiring loads of a CPU and loads of other load factors in the hardware system, wherein the other load factors comprise: input/output IO, memory and a graphics processor GPU;
according to the load of one or a combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period;
when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the frequency limiting threshold value of the cluster to which the CPU belongs is increased or the frequency limiting control of the cluster to which the CPU belongs is canceled;
the load of the CPU comprises the load of a cluster to which the CPU belongs;
the determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors comprises:
Determining the load state of the CPU according to the load of the CPU, and determining the load state of one or a combination of other load factors according to the load of the one or the combination of the other load factors;
according to the load state of the CPU and the load state of one or combination of the other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period;
the determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load state of the CPU and the load state of one or a combination of the other load factors comprises:
when the load state of the CPU is high load and the load state of one or a combination of the other load factors is high load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is high load state;
when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load;
and when the load state of the CPU is hysteresis, the load state of one or a combination of the other load factors is high load, or the load state of the CPU is high load, and the load state of one or a combination of the other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
2. The method according to claim 1, wherein after the raising of the frequency limit threshold of the cluster to which the CPU belongs or the canceling of the frequency limit control of the cluster to which the CPU belongs, further comprises:
according to the load of one or combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in a continuous preset number of sampling periods after the current sampling period;
and if the load states of the clusters to which the CPU belongs in the continuous preset number of sampling time periods are all low-load states, recovering the frequency limiting threshold value of the clusters to which the CPU belongs.
3. The method according to claim 1, wherein the determining the load state of the cluster to which the CPU belongs after the current sampling period according to the load of the CPU and one or a combination of other load factors further comprises:
and when the load state of the cluster to which the CPU belongs in the current sampling period is a holding state, adopting the frequency limiting threshold value of the cluster to which the CPU belongs in the last sampling period.
4. An apparatus for adjusting the CPU frequency of a central processing unit, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring the load of a CPU and the load of other load factors in a hardware system, and the other load factors comprise: input/output IO, memory and a graphics processor GPU;
The determining module is used for determining the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors;
the adjusting module is used for improving the frequency limiting threshold value of the cluster to which the CPU belongs or canceling the frequency limiting control of the cluster to which the CPU belongs when the determining module determines that the load state of the cluster to which the CPU belongs in the current sampling period is a high load state;
the load of the CPU comprises the load of a cluster to which the CPU belongs;
the determining module is specifically configured to determine a load state of the CPU according to a load of the CPU, and determine a load state of one or a combination of other load factors according to a load of one or a combination of other load factors; according to the load state of the CPU and the load state of one or combination of the other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period;
the determining module is specifically configured to determine that, when the load state of the CPU is a high load and the load state of one or a combination of other load factors is a high load, the load state of the cluster to which the CPU belongs in the current sampling period is a high load state; when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load; and when the load state of the CPU is hysteresis, the load state of one or a combination of other load factors is high load, or the load state of the CPU is high load, and the load state of one or a combination of other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
5. A terminal device, comprising:
one or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the terminal device, cause the terminal device to perform the steps of:
and acquiring loads of a CPU and loads of other load factors in the hardware system, wherein the other load factors comprise: input/output IO, memory and a graphics processor GPU;
according to the load of one or a combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period;
when the load state of the cluster to which the CPU belongs in the current sampling period is a high load state, the frequency limiting threshold value of the cluster to which the CPU belongs is increased or the frequency limiting control of the cluster to which the CPU belongs is canceled;
the load of the CPU comprises the load of a cluster to which the CPU belongs; when the instructions are executed by the terminal device, the step of causing the terminal device to execute the load state of the cluster to which the CPU belongs in the current sampling period according to the load of one or a combination of the load of the CPU and other load factors comprises:
Determining the load state of the CPU according to the load of the CPU, and determining the load state of one or a combination of other load factors according to the load of the one or the combination of the other load factors;
according to the load state of the CPU and the load state of one or combination of the other load factors, determining the load state of the cluster to which the CPU belongs in the current sampling period;
when the instructions are executed by the terminal device, the step of causing the terminal device to execute the load state of the cluster to which the CPU belongs in the current sampling period according to the load state of the CPU and the load state of one or a combination of the other load factors includes:
when the load state of the CPU is high load and the load state of one or a combination of the other load factors is high load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is high load state;
when the load state of the CPU is low load or the load state of one or a combination of other load factors is low load, determining that the load state of the cluster to which the CPU belongs in the current sampling period is low load;
and when the load state of the CPU is hysteresis, the load state of one or a combination of the other load factors is high load, or the load state of the CPU is high load, and the load state of one or a combination of the other load factors is hysteresis, determining that the load state of the cluster to which the CPU belongs in the current sampling period is a holding state.
6. The terminal device of claim 5, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of raising a frequency limit threshold of a cluster to which the CPU belongs or canceling frequency limit control of the cluster to which the CPU belongs, further perform the step of:
according to the load of one or combination of the load of the CPU and other load factors, determining the load state of the cluster to which the CPU belongs in a continuous preset number of sampling periods after the current sampling period;
and if the load states of the clusters to which the CPU belongs in the continuous preset number of sampling time periods are all low-load states, recovering the frequency limiting threshold value of the clusters to which the CPU belongs.
7. The terminal device of claim 5, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of determining the load status of the cluster to which the CPU belongs at the current sampling period based on the load of the CPU and one or a combination of other load factors, further comprising:
and when the load state of the cluster to which the CPU belongs in the current sampling period is a holding state, adopting the frequency limiting threshold value of the cluster to which the CPU belongs in the last sampling period.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-3.
CN202211035643.0A 2022-08-26 2022-08-26 Method and device for adjusting frequency of central processing unit and terminal equipment Active CN116048772B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211035643.0A CN116048772B (en) 2022-08-26 2022-08-26 Method and device for adjusting frequency of central processing unit and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211035643.0A CN116048772B (en) 2022-08-26 2022-08-26 Method and device for adjusting frequency of central processing unit and terminal equipment

Publications (2)

Publication Number Publication Date
CN116048772A CN116048772A (en) 2023-05-02
CN116048772B true CN116048772B (en) 2023-10-31

Family

ID=86112245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211035643.0A Active CN116048772B (en) 2022-08-26 2022-08-26 Method and device for adjusting frequency of central processing unit and terminal equipment

Country Status (1)

Country Link
CN (1) CN116048772B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848091A (en) * 2005-04-12 2006-10-18 鸿富锦精密工业(深圳)有限公司 Central processer super frequency system and method
CN103246340A (en) * 2012-02-06 2013-08-14 索尼公司 Device and method for dynamically adjusting frequency of central processing unit
KR20140080252A (en) * 2012-12-20 2014-06-30 주식회사 케이티 Method and device for adjusting CPU frequency of server using server information
CN105867896A (en) * 2015-11-24 2016-08-17 乐视移动智能信息技术(北京)有限公司 Method and system for increasing startup speed of intelligent terminal
CN107844187A (en) * 2016-09-21 2018-03-27 龙芯中科技术有限公司 Power consumption management method, device and electronic equipment
CN109960584A (en) * 2019-01-30 2019-07-02 努比亚技术有限公司 CPU frequency modulation control method, terminal and computer readable storage medium
CN111240835A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 CPU working frequency adjusting method, CPU working frequency adjusting device and storage medium
CN112789651A (en) * 2019-03-27 2021-05-11 华为技术有限公司 Frequency adjusting method and device applied to terminal and electronic equipment
CN114461323A (en) * 2022-01-26 2022-05-10 海信电子科技(深圳)有限公司 Card pause processing method and device, electronic equipment and storage medium
CN114510140A (en) * 2020-11-16 2022-05-17 深圳市万普拉斯科技有限公司 Frequency modulation method and device and electronic equipment
CN114579508A (en) * 2020-11-30 2022-06-03 华为技术有限公司 CPU frequency modulation method and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848091A (en) * 2005-04-12 2006-10-18 鸿富锦精密工业(深圳)有限公司 Central processer super frequency system and method
CN103246340A (en) * 2012-02-06 2013-08-14 索尼公司 Device and method for dynamically adjusting frequency of central processing unit
KR20140080252A (en) * 2012-12-20 2014-06-30 주식회사 케이티 Method and device for adjusting CPU frequency of server using server information
CN105867896A (en) * 2015-11-24 2016-08-17 乐视移动智能信息技术(北京)有限公司 Method and system for increasing startup speed of intelligent terminal
WO2017088407A1 (en) * 2015-11-24 2017-06-01 乐视控股(北京)有限公司 Method and system for accelerating start-up speed of intelligent terminal
CN107844187A (en) * 2016-09-21 2018-03-27 龙芯中科技术有限公司 Power consumption management method, device and electronic equipment
CN109960584A (en) * 2019-01-30 2019-07-02 努比亚技术有限公司 CPU frequency modulation control method, terminal and computer readable storage medium
CN112789651A (en) * 2019-03-27 2021-05-11 华为技术有限公司 Frequency adjusting method and device applied to terminal and electronic equipment
CN111240835A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 CPU working frequency adjusting method, CPU working frequency adjusting device and storage medium
CN114510140A (en) * 2020-11-16 2022-05-17 深圳市万普拉斯科技有限公司 Frequency modulation method and device and electronic equipment
CN114579508A (en) * 2020-11-30 2022-06-03 华为技术有限公司 CPU frequency modulation method and electronic equipment
CN114461323A (en) * 2022-01-26 2022-05-10 海信电子科技(深圳)有限公司 Card pause processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116048772A (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN110543287A (en) Screen display method and electronic equipment
CN111552451B (en) Display control method and device, computer readable medium and terminal equipment
WO2021190314A1 (en) Sliding response control method and apparatus of touch screen, and electronic device
CN114880251B (en) Memory cell access method, memory cell access device and terminal equipment
CN111651254A (en) Method and device for executing application
CN113596919B (en) Data downloading method and device and terminal equipment
CN113490291B (en) Data downloading method and device and terminal equipment
CN114968543A (en) Method for processing document page and related device
CN112437341B (en) Video stream processing method and electronic equipment
CN115665632B (en) Audio circuit, related device and control method
WO2023051094A1 (en) Memory recovery method and apparatus, electronic device, and readable storage medium
CN116055859B (en) Image processing method and electronic device
CN113901485B (en) Application program loading method, electronic device and storage medium
CN114461589B (en) Method for reading compressed file, file system and electronic equipment
CN114828098B (en) Data transmission method and electronic equipment
CN116048772B (en) Method and device for adjusting frequency of central processing unit and terminal equipment
CN116828100A (en) Bluetooth audio playing method, electronic equipment and storage medium
CN114221402A (en) Charging method and device of terminal equipment and terminal equipment
CN114332331A (en) Image processing method and device
CN114116610A (en) Method, device, electronic equipment and medium for acquiring storage information
CN116048769B (en) Memory recycling method and device and terminal equipment
CN116048831B (en) Target signal processing method and electronic equipment
CN116717486B (en) Method and device for adjusting rotation speed of fan, electronic equipment and readable storage medium
CN114125144B (en) Method, terminal and storage medium for preventing false touch
CN113704209B (en) Data sharing method, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant