Frequency adjusting method of processor and electronic equipment
By detecting the duration of the processor processing interrupted data and dynamically adjusting the frequency, the problem that the processor cannot respond in a timely manner in high touch point rate scenarios is solved, the processor's frequency increase response speed is improved, and the screen lag or delay is reduced.
Patent Information
- Application Number
- CN202311308110.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2025-04-18
AI Technical Summary
The processor cannot respond to interrupted data in a timely manner in a high touch point rate scenario, resulting in screen stuttering or delaying on the display.
By detecting the duration of the processor processing interrupted data, when it is longer than the preset threshold, the processor frequency is dynamically adjusted to increase processing speed and reduce screen lag or delay.
It improves the response speed of the processor frequency extraction and reduces picture stuttering or delay caused by the processor frequency extraction response in time.
Smart Images

Figure CN119847715A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a frequency adjustment method for a processor and an electronic device. Background Art
[0002] Currently, electronic devices (such as smart phones, electronic watches and tablet computers) are becoming more and more functional, and the performance requirements for processors in electronic devices are also becoming higher and higher.
[0003] When a user touches the display screen of an electronic device, the touch panel can obtain the corresponding touch position by scanning the display screen; then, the touch chip processes the touch position to obtain interrupt data; finally, the processor processes the interrupt data reported by the touch chip and feeds the processing results back to the display screen for display in response to the user's touch. If the processor cannot process the interrupt data in time, the display screen will experience screen freeze or screen delay.
[0004] In related technologies, the above problems are usually solved by increasing the clock frequency and power consumption of the processor to obtain higher performance. Specifically, the processor timer needs to calculate the comprehensive processing delay of the processor based on the processing information of each core in the processor, and then determine whether it is necessary to control the processor to increase the frequency based on the comprehensive processing delay. However, in scenarios such as high touch reporting rates, the processor needs to respond in a timely manner, and the screen may be stuck or delayed when the timer makes a judgment. Summary of the invention
[0005] The processor frequency adjustment method and electronic device provided in the present application are used to solve the problem of the processor frequency increase response being untimely.
[0006] In order to achieve the above objectives, this application adopts the following technical solutions:
[0007] In a first aspect, the present application provides a method for adjusting the frequency of a processor, which can be applied to an electronic device including a display screen and a processor. The method includes: when a user touches the display screen, the processor can receive interrupt data indicating the touch status of the display screen, and process the interrupt data at a first operating frequency. The duration of the detection processor processing the interrupt data at the first operating frequency is the first time overhead. When the first time overhead is greater than the time overhead threshold corresponding to the first operating frequency, it indicates that the current processor may not be able to process the interrupt data in time. The processor increases the operating frequency from the first operating frequency to a higher operating frequency to increase the processor's processing speed of the interrupt data, thereby reducing the screen freeze or screen delay in the display screen.
[0008] Interrupt data is the basis for users to touch electronic devices. The processor identifies the touch position by processing the interrupt data and then implements the corresponding touch operation. By detecting and comparing the time required to process the interrupt data, it is possible to determine whether the current processor needs to increase its frequency. This saves the process of using a timer to determine the processor's processing delay through a series of calculations and then judging whether the processor is overloaded, thereby improving the processor's response speed to increase the frequency.
[0009] In some embodiments, the processor in the electronic device is a multi-core processor, that is, it includes multiple processor cores, one or more of which are used to process interrupt data. When the operating frequency of the processor is the first operating frequency, the core frequency of the one or more processor cores is the first core frequency. The core frequency adjustment file includes a correspondence between the first core frequency, the first time overhead, and the second core frequency. The one or more processor cores can find out the corresponding second core frequency based on the first core frequency, the first time overhead, and the core frequency adjustment file, and increase the core frequency to the second core frequency.
[0010] By only improving one or more processor cores for processing interrupt data, it is possible to reduce power consumption caused by jointly improving the frequency of other processor cores while meeting the processor core's demand for interrupt data processing speed.
[0011] In some embodiments, before obtaining the first time overhead, the multiple processor cores in the multi-core processor may also preload the corresponding core frequency adjustment file. When the processor core needs to increase the frequency, the core frequency adjustment file may be directly called to find the corresponding second core frequency, and the core frequency may be increased to the second core frequency. This saves the time of loading the core frequency adjustment file during the process of increasing the frequency of the processor core, and further improves the response speed of the processor core to increase the frequency.
[0012] In some embodiments, before obtaining the first time overhead, the method further includes pre-binding one or more processor cores in the plurality of processor cores for processing the interrupt data. When the processor receives the interrupt data, the interrupt data can be directly assigned to the pre-bound one or more processor cores. This saves the processor time for assigning interrupt data processing tasks according to the resource utilization of the processor cores, and improves the processing speed of the interrupt data to a certain extent.
[0013] In some embodiments, the processor may preload a corresponding frequency adjustment file, which includes a correspondence between a first operating frequency, a first time overhead, and a second operating frequency. When the first time overhead is greater than a time overhead threshold corresponding to the first operating frequency, the processor may find the corresponding second operating frequency based on the first operating frequency, the first time overhead, and the frequency adjustment file, and increase the operating frequency to the second operating frequency. By preloading the frequency adjustment file, the frequency adjustment file may be directly called when the processor needs to increase the frequency, thereby improving the response speed of the processor to increase the frequency.
[0014] In some embodiments, the electronic device further includes a power management module. When the processor processes the interrupt data to obtain the touch position, it indicates that there is a touch on the display screen. After receiving the function activation instruction sent by the processor, the power management module enables the operating frequency switching function of the processor, so that the operating frequency switching function of the processor is in a ready state. When the processor needs to increase the frequency, there is no need to activate the operating frequency switching function again, which further improves the response speed of the processor to increase the frequency.
[0015] In some embodiments, the electronic device further includes a power management module. When the processor does not obtain the touch position when processing the interrupt data, it indicates that no touch occurs on the display screen. After receiving the sleep instruction sent by the processor, the power management module switches the power state of the processor to a low power consumption mode. This reduces the power consumption of the processor when the user does not perform a touch operation on the electronic device.
[0016] In a second aspect, the present application provides a method for adjusting the frequency of a processor, which is applied to an electronic device including a display screen and a processor cluster, wherein the processor cluster includes multiple processors, such as a first processor and a second processor, wherein one of the processors is used to process interrupt data, such as the first processor is used to process interrupt data.
[0017] When the user touches the display screen, the first processor can receive interrupt data indicating the touch status of the display screen, and process the interrupt data at the first operating frequency. The duration of the first processor processing the interrupt data at the first operating frequency is detected as the first time overhead. When the first time overhead is greater than the time overhead threshold corresponding to the first operating frequency, it indicates that the current first processor may not be able to process the interrupt data in time. The first processor increases the operating frequency from the first operating frequency to a higher operating frequency to increase the processing speed of the first processor for the interrupt data, thereby reducing the screen freeze or screen delay in the display screen.
[0018] In some embodiments, multiple processors in a processor cluster are respectively preloaded with corresponding frequency adjustment files, and the frequency adjustment file includes a correspondence between a first operating frequency, a first time overhead, and a second operating frequency. When the first time overhead is greater than a time overhead threshold corresponding to the first operating frequency, the first processor can directly call the corresponding frequency adjustment file, find the corresponding second operating frequency according to the first operating frequency and the first time overhead, and increase the operating frequency from the first operating frequency to the second operating frequency. When the first processor needs to increase the frequency, the frequency adjustment file can be directly called to improve the response speed of the processor to increase the frequency.
[0019] In some embodiments, before obtaining the first time overhead, the method further includes pre-binding a processor among the plurality of processors for processing the interrupt data. When the processor cluster receives the interrupt data, the interrupt data can be directly assigned to the pre-bound processor. This saves the time of the processor cluster in allocating interrupt data processing tasks according to the resource utilization of the processor, and improves the processing speed of the interrupt data to a certain extent.
[0020] In a third aspect, the present application provides an electronic device, comprising: a memory and one or more processors, wherein the memory is coupled to the processor;
[0021] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method as described in any one of the first aspect or the second aspect.
[0022] In a fourth aspect, the present application provides a chip system, which is applied to an electronic device including a processor and a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by lines. The interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor. The signals include computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device implements the method described in any one of the first or second aspects above.
[0023] In a fifth aspect, the present application provides a computer storage medium comprising computer instructions, which, when executed on a mobile terminal, enables the electronic device to execute a method as described in any one of the first aspect or the second aspect.
[0024] In a sixth aspect, the present application provides a computer program product, comprising instructions; when the instructions are executed by an electronic device, the electronic device executes the method described in any one of the first aspect or the second aspect.
[0025] It can be seen from the above technical solution that the present application has the following beneficial effects:
[0026] In the frequency adjustment method of the processor provided in the present application, the preset interrupt data processing time refers to the maximum time required to process the interrupt data without changing the processor frequency. If the time required for the current processor to process the interrupt data, that is, the interrupt data processing time, is greater than or equal to the preset interrupt data processing time, it indicates that the processor is in an overloaded state and cannot process the data in time, and the processor needs to be controlled to increase the frequency; if the interrupt data processing time is less than the preset interrupt data processing time, it indicates that the processor can process the interrupt data in time, so there is no need to control the processor to increase the frequency.
[0027] Therefore, the embodiment of the present application can determine whether the processor needs to be frequency-increased by comparing the interrupt data processing time with the preset interrupt data processing time. Compared with the related art that uses a timer to determine the processor processing delay through a series of calculations and then determines whether the processor is overloaded, the timer calculation time is saved, and the reaction speed of the processor frequency increase is improved to a certain extent, reducing the situation of electronic equipment display screen freeze delay caused by the processor frequency increase response untimely. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 An application scenario diagram of a frequency adjustment method for a processor provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of data processing by a processor provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of another processor performing data processing provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0033] Figure 5 An example diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0034] Figure 6 A flowchart of a method for adjusting the frequency of a processor provided in an embodiment of the present application;
[0035] Figure 7A flowchart of another method for adjusting the frequency of a processor provided in an embodiment of the present application;
[0036] Figure 8 A flowchart of another method for adjusting the frequency of a processor provided in an embodiment of the present application;
[0037] Fig. 9 A timing diagram of a frequency adjustment method for a processor provided in an embodiment of the present application;
[0038] Fig.10 A structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Reference to "one embodiment" or "some embodiments" described in this specification means that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in the different parts of this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0040] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0041] In order to make the description of the following embodiments clear and concise, firstly, relevant technical terms are introduced:
[0042] Thread: The smallest unit that the operating system can schedule operations on. It is contained in the process and is the actual operation unit in the process. A process can have many threads, and each thread executes different tasks in parallel.
[0043] Multi-core processor: refers to a processor that integrates two or more complete computing engines (cores), which can handle computing tasks independently.
[0044] Script file: is an independent text file that can be stored in the local memory of an electronic device, automatically loaded when the electronic device is turned on, and directly called when needed.
[0045] Interrupt data used to indicate the touch status of the display screen: refers to the interrupt data obtained by the touch panel (TouchPanel) scanning the display screen to obtain touch information when the electronic device is running, and then the touch chip converts the touch information to obtain interrupt data. For the sake of simplicity, the interrupt data used to indicate the touch status of the display screen will be referred to as interrupt data below.
[0046] Touch reporting rate: the number of times interrupt data is reported per unit time. For example, the touch panel reports interrupt data once each time it scans the display screen. When the electronic device runs different applications, the touch panel can be configured to scan the display screen at different frequencies, which also changes the touch reporting rate.
[0047] For example, compared to running a reading application, when running a game application, the electronic device can actively increase the scanning frequency and touch reporting rate of the touch panel, and the amount of interrupt data to be processed by the processor per unit time will also increase. Therefore, in some scenarios with a high touch reporting rate, the screen displayed by the electronic device may be more prone to freezes and delays.
[0048] Let's take a smartphone as an example. The smartphone includes a touch panel, a touch chip, a processor, and a display. Figure 1 The whole process from the user clicking the display screen to the display screen showing the corresponding result is introduced.
[0049] like Figure 1 As shown, when a mobile phone is running a game application, the touch panel can scan the display screen up to 1000 times per second, and each scan will generate a touch information.
[0050] When the user touches the display screen, the touch information includes information indicating the touched position on the display screen.
[0051] After the touch panel sends the touch information to the touch chip, the touch chip processes the touch information to obtain corresponding interrupt data, and reports the interrupt data to the processor.
[0052] After receiving the interrupt data reported by the touch chip, the processor processes the interrupt data to determine the touch position in the display screen, and then determines the coordinates of the touch point in the display screen according to the touch position.
[0053] The processor determines the game action (such as forward, backward or jump) corresponding to the coordinate in the interface displayed by the current display screen, and sends a display instruction to display the game action to the display screen, and the display screen displays the corresponding game action to the user.
[0054] Figure 2 A schematic diagram of a processor performing data processing according to an embodiment of the present application. The processing process of the processor for interrupt data is as follows: Figure 2 As shown:
[0055] Figure 2 The thread 1 shown is the thread when the processor processes the interrupt data.
[0056] Each color block in thread 1 represents the processor processing an interrupt data, and the width of the color block represents the time required for the processor to process an interrupt data. The higher the frequency of the processor, the narrower the width of the color block.
[0057] The distance between two adjacent color blocks indicates the interval between two adjacent scans of the touch chip.
[0058] When a user touches the display screen once, the touch panel may scan the display screen hundreds of times. Correspondingly, the touch chip will report hundreds of interrupt data. Figure 2 , thread 1 includes multiple color blocks.
[0059] Take the example of a user clicking on the display screen. From the time the user touches the display screen with their finger to the time the finger leaves the display screen, the multiple interruption data reported by the touch chip are approximately the same. Ideally, the processor's processing time for each interruption data should also be approximately the same, that is, the width of each color block is approximately the same. However, since the processor has different loads when processing each interruption data, the processing time required to process multiple interruption data that is approximately the same will be different, causing delays in the subsequent processing of the processor, and ultimately causing the display of the electronic device to become stuck and delayed. Figure 2 In the example, the different processing times required for a plurality of approximately identical interrupt data are represented by the uneven widths of the color blocks.
[0060] After the processor processes the interrupt data to obtain the touch position, it needs to perform further processing, as follows: Figure 3 As shown, Figure 3 A schematic diagram of another processor performing data processing provided in an embodiment of the present application.
[0061] exist Figure 3 Includes threads 1 to 4. Among them, Figure 3 Thread 1 in Figure 2 The same as thread 1 in, which is the thread when the processor processes the interrupt data.
[0062] Thread 2 is the thread when the processor processes the touch position. The width of the color block in thread 2 indicates the time required for the processor to process a touch position. Thread 3 is the thread when the processor processes the touch coordinates. The width of the color block in thread 3 indicates the time required for the processor to process a touch coordinate. Thread 4 is the thread when the processor processes the game action. The width of the color block in thread 4 indicates the time required for the processor to process a game action.
[0063] The processor processes threads 1-4 simultaneously from left to right. When the processor completes processing an interrupt data to obtain the touch position, the thread execution progress can be at the position marked by A. The processor continues to process the touch position to obtain the touch coordinates. At this time, the thread execution progress can be at the position marked by B. After the processor determines the corresponding game action based on the touch coordinates, the thread execution progress can be at the position marked by C. Finally, the processor generates a display instruction based on the game action and sends the display instruction to the display screen, which displays the corresponding game action. At this time, the thread execution progress can be at the position marked by D.
[0064] Ideally, the widths of the color blocks in thread 2 should be approximately the same; the widths of the color blocks in thread 3 should be approximately the same; and the widths of the color blocks in thread 4 should be approximately the same. However, the start time of the color blocks in threads 2-4 is affected by the end time of the color blocks in the previous thread. Figure 3 As shown in the figure, when the thread execution progress is at the position marked by E, the processor may process interrupt data and touch coordinates at the same time. The processor needs to allocate computing resources to the two tasks, resulting in different degrees of extension of the interrupt data processing time and the touch coordinate processing time. This will further affect the processing of subsequent tasks. It may even cause the processor to process more tasks at the same time, eventually leading to processor overload, causing the screen to freeze or drop frames.
[0065] Take a multi-core processor as an example. In related technologies, the processing information of each core in the multi-core processor is collected, and then the processing delay corresponding to each core is calculated using a timer according to the processing information, and then the processing delay of each core is calculated according to a preset algorithm to obtain the comprehensive processing delay of the processor.
[0066] If the combined processing delay is greater than the preset processing delay, it indicates that the processor is overloaded. The timer controls the processor to actively classify the data processed by multiple cores into one core for processing, thereby increasing the processor load and triggering the frequency increase operation.
[0067] In the above-mentioned existing frequency increase method, the timer needs to perform a series of logical operations. In some scenarios with high reporting rates, the processor needs to respond to the frequency increase at any time, and it is impossible to provide the processor timer with sufficient operation time to control the processor to increase the frequency. In the process of the timer performing logical operations, since the operation results have not yet been obtained, the processor still maintains the original clock frequency for data processing. In the scenario of high reporting rates, a large amount of data is continuously reported to the processor, and the processor may not be able to complete the processing of this data at the original clock frequency, which ultimately causes the screen displayed by the electronic device to be delayed or stuck.
[0068] In view of the technical problems existing in the prior art, the present application provides a method for adjusting the frequency of a processor. In the process of the processor processing interrupt data, the interrupt data processing duration is obtained, and the frequency of the processor is adjusted according to the relationship between the interrupt data processing duration and the maximum interrupt processing duration, which saves the process of using a timer to determine the processor processing delay through a series of calculations and then judging whether the processor is overloaded, thereby improving the reaction speed of the processor frequency increase. .
[0069] Interrupt data is the "key" for users to realize corresponding functions by touching the display screen. The processor must first process the interrupt data to determine the touch position before it can perform subsequent processing. That is to say, when the user touches the screen, it is a necessary process for the processor to process the interrupt data. The inventive concept of this application is based on this necessary process. By monitoring the processing time of the interrupt data and judging whether it is necessary to control the processor to increase the frequency according to the processing time of the interrupt data, the long logic operation time of the processor timer can be saved. When the processor is overloaded, the processor frequency can be controlled in time to increase, which can improve the smoothness of the picture to a certain extent.
[0070] The frequency adjustment method of the processor provided in the embodiment of the present application can be applied to any scenario of electronic device operation, especially in scenarios with high reporting rates. For example, the electronic device is running games, shopping, videos, navigation and other scenarios with high reporting rates.
[0071] The electronic device involved in the embodiment of the present application may include a processor cluster. Each processor cluster in at least one processor cluster may include at least one processor, and each processor may include multiple cores. Specifically, the processor is a central processing unit (CPU).
[0072] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 4 As shown, Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0073] like Figure 4 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, etc.
[0074] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0075] The processor 110 may include one or more processing units, such as a controller, wherein different processing units may be independent devices or may be integrated into one or more processors.
[0076] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction opcode and timing signal to complete the control of instruction fetching and execution. For example, the processor frequency can be increased according to the frequency increase strategy or the processor can be controlled according to the overall frequency modulation strategy of the system.
[0077] In the embodiment of the present application, the processor 110 may be a multi-core processor, such as an octa-core processor or a twelve-core processor, and each core may execute a thread separately. After the electronic device is turned on, the core for processing interrupt data may be pre-bound, and the thread may be initialized to establish a connection with the core.
[0078] 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. In the embodiment of the present application, a script file for controlling the frequency increase of the processor may be stored in the memory. When the frequency increase of the processor 110 needs to be controlled, the script file may be directly called from the memory to control the frequency increase of the processor 110.
[0079] In some embodiments, the processor 110 may include one or more interfaces. The interface may be an inter-integrated circuit (I2C) interface. In an embodiment of the present application, the processor 110 may couple the touch sensor 180C via the I2C interface, so that the processor 110 communicates with the touch sensor 180C via the I2C bus interface to implement the touch function of the electronic device. In an embodiment of the present application, the touch sensor 180C may be a touch chip, and the processor 110 may receive interrupt data reported by the touch chip via I2C.
[0080] The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the electronic device. In the embodiment of the present application, after the processor 110 generates a corresponding display instruction according to the game action, it can send the display instruction to the display screen 194 via the MIPI interface, so that the display screen 194 displays the corresponding game action after receiving the display instruction.
[0081] In an embodiment of the present application, when it is determined that the user clicks on the display screen, the power management module can wake up the frequency boosting function of the processor, and when the user ends clicking, the power management module can turn off the frequency boosting function of the processor and switch the power state (C-States) of the processor to a low power state.
[0082] The internal memory 121 can be used to store computer executable program codes, which include instructions. In an embodiment of the present application, a driver program of the touch panel can be stored in the internal memory 121. When the electronic device is in operation, the processor 110 controls the touch panel to scan the display screen by running the driver program of the touch panel.
[0083] The touch sensor 180C is also called a "touch control device". The touch sensor 180C can be set on the display screen 194, and the touch sensor 180C and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180C is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180C can also be set on the surface of the electronic device, which is different from the position of the display screen 194.
[0084] In the embodiment of the present application, the touch sensor 180C may be a touch panel. When the touch panel obtains a touch signal by scanning the display screen, the touch signal is sent to a touch chip. The touch chip converts the touch signal from an analog signal to a digital signal and reports it to a processor for processing, thereby finally controlling the electronic device.
[0085] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0086] Figure 5 It is an example diagram of the software structure of the electronic device according to the embodiment of the present application.
[0087] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application programmer framework layer, the Android runtime and the system library, and the kernel layer. To facilitate the understanding of this solution, a hardware layer is added after the kernel layer.
[0088] The application layer can include a series of application packages. Figure 5 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0089] The application framework layer provides application programming interface (API) and programming framework for the application layer applications. The framework layer includes some predefined functions. Figure 5 As shown, the framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a regulator, and the like.
[0090] The regulator is used to distinguish application processes and allocate corresponding processors or processor cores to application processes. Application processes are divided into dynamic process groups and non-dynamic process groups. Generally speaking, non-dynamic process groups are processed by designated processors or processor cores, while dynamic process groups are allocated according to the load of the processor or processor core.
[0091] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0092] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0093] The kernel layer includes at least a display driver, a camera driver, a touch panel driver, and a sensor driver. The above touch panel driver is used to call the touch panel in the hardware layer to scan the display screen, and the touch panel driver is also used to establish a thread queue for processing interrupt data in the processor or processor core. The kernel layer also includes a power management module and a kernel scheduler. The power management module is used to wake up or stop the frequency increase function of the processor and control the power state of the processor. The kernel scheduler is used to issue a scheduling policy based on the processor's processing time and the preset time for the data.
[0094] The hardware layer may include one or more processors, as well as a touch panel, a display, a touch chip, and a power management module. The type of processor is not limited, and it can be an octa-core processor or a twelve-core processor. The processor is used to load a script file corresponding to the processor architecture when the electronic device is started, and to implement the touch function of the electronic device according to the interrupt data after receiving the interrupt data. The display is used to show animations or pictures to the user, and it is also the component that the user clicks when touching the electronic device. The touch chip is used to receive the touch information obtained by scanning the touch panel, and after processing the touch information to obtain the interrupt data, the interrupt data is reported to the processor. The power management module is used to receive instructions from the processor and switch the power state of the processor according to the instructions of the processor.
[0095] The present application embodiment will be combined with Figure 5 The software architecture of Figure 1 An implementation process of the scenario shown is described below:
[0096] When the electronic device is turned on, a script file related to the frequency increase strategy is loaded in the processor, and the touch panel driver establishes an interrupt data processing thread queue in the processor or processor core. When the user clicks on the game interface in the display screen of the electronic device, the touch panel sends the scanned touch position to the touch chip, and the touch chip processes the touch position to obtain the interrupt data and reports it to the processor. After the processor receives the interrupt data, it processes the interrupt data using the pre-established interrupt data processing thread queue. During the interrupt data processing process, the kernel scheduler detects the interrupt data processing time. When the interrupt data processing time is greater than or equal to the preset interrupt data processing time, the frequency increase strategy is sent to the processor. After the processor receives the frequency increase strategy, it calls the relevant script file to increase the clock frequency of the processor, improve the performance of the processor, reduce the interrupt data processing time, and improve the smoothness of the picture.
[0097] In order to make the technical solution of the present application clearer and easier to understand, the frequency adjustment method of the processor provided by the embodiment of the present application is introduced below in combination with the above embodiments and corresponding drawings. Figure 4 The electronic device of the structure shown in the figure is implemented, wherein the electronic device includes a camera, a microphone and a display screen. Figure 6 A flowchart of a method for adjusting the frequency of a processor is shown in FIG. Figure 6 As shown, the frequency adjustment method of the processor provided in the embodiment of the present application may include:
[0098] S601: The touch chip processes the touch information to obtain interrupt data, and reports the interrupt data to the processor.
[0099] When the electronic device is powered on, the touch panel will continuously scan the display screen to obtain the touch position. When the user touches the display screen, the touch panel scans the touch screen to obtain the location information of the touch point; then, the touch chip converts the scanned touch information into interrupt data and reports it to the processor.
[0100] It is understandable that when the user does not touch the display screen, the interrupt data may be blank data or contain no position information. At this time, after the touch chip reports the interrupt data to the processor, the processor does not need to process the interrupt data, or the processor cannot obtain the position information of the touch point from the interrupt data, and no subsequent processing action for the touch position will be generated.
[0101] S602: The processor receives and processes the interrupt data to determine whether the user touches the display screen.
[0102] After receiving the interrupt data, the processor processes the interrupt data. If the corresponding touch point position information, that is, the touch position, is obtained by processing the interrupt data, it indicates that the user has touched the display screen, and the process jumps to step S604. If the corresponding touch position is not obtained, it indicates that the user has not touched the display screen, and the process jumps to step S603.
[0103] S603: The power management module switches the power state of the processor to a low power consumption state.
[0104] When it is determined that the user has not touched the display screen, the power management module can switch the power state of the processor to a stop-allowed state (C2 state), a deep sleep state (C3 state), and a deeper sleep state (C4 state). Compared with the C1 state, the processor power consumption is lower in the C2 state, the C3 state, and the C4 state.
[0105] When the user is not touching the display screen, switching the power state of the processor to a low power state can reduce the overall energy consumption of the processor and reduce the heat of the processor to a certain extent.
[0106] S604: enabling the frequency increase function of the processor, and comparing the interrupt data processing time with the preset interrupt data processing time.
[0107] After determining that the user has touched the display screen, the power management module can activate the processor's frequency-boosting function by changing the processor's power state. At this time, the processor has not yet been frequency-boosted but can be frequency-boosted immediately. Specifically, the power management module can switch the processor's power state to an active state (C0 state) or a suspended state (C1 state). In the active state, the processor can receive instructions and process data; in the suspended state, the processor's various functions can be quickly awakened, and about 70% of power consumption can be saved.
[0108] By enabling the frequency increase function of the processor in advance, the frequency of the processor can be increased in time when it is needed, thus shortening the reaction time of the processor frequency increase to a certain extent.
[0109] At the same time, after determining that the user has touched the display screen, the kernel controller detects the time required for the processor to process the interrupt data, that is, the interrupt data processing time. It can be understood that when the amount of interrupt data remains unchanged, the stronger the processor performance, the shorter the interrupt data processing time; conversely, the weaker the processor performance, the longer the interrupt data processing time.
[0110] The performance of a processor is related to its clock frequency, which is used to indicate the speed at which the CPU calculates and processes data. Generally speaking, the higher the clock frequency, the faster the processor processes data and the better the performance of the processor.
[0111] In an embodiment of the present application, the preset interrupt data processing duration refers to the maximum duration required for the processor or processor core to process interrupt data when the processor or processor core is at a certain frequency. When the processor or processor core is at different frequencies, the preset interrupt data processing duration is also different. For example, a technician can control the frequency of the processor to remain unchanged, test the time for the processor to process interrupt data multiple times, and use the longest processing time as the preset interrupt data processing duration. Of course, the technician can also directly calculate the preset interrupt data processing duration based on the frequency of the processor and the amount of data of the interrupt data.
[0112] By comparing the interrupt data processing time with the preset interrupt data processing time, the current working state of the processor can be reflected to a certain extent, and then the processor can be controlled and adjusted according to the comparison result. When the interrupt data processing time is greater than or equal to the preset interrupt data processing time, step S605 is executed; when the interrupt data processing time is less than the preset interrupt data processing time, step S606 is executed.
[0113] It should be noted that the frequency increase in the embodiments of the present application is different from overclocking in the known sense. Frequency increase refers to increasing the main frequency of the processor, that is, the clock frequency, and the increase is performed within the maximum clock frequency range of the processor, and the clock frequency of the processor can be increased to the maximum constant frequency at most. Overclocking refers to increasing the external frequency of the processor, that is, the base frequency. For the processor in the server, overclocking will cause the motherboard to run asynchronously, resulting in instability of the server system.
[0114] S605: Control the processor to increase frequency.
[0115] If the interrupt data processing time is greater than or equal to the preset interrupt data processing time, it means that the processor may be overloaded and unable to process the interrupt data and other data in time, and the display screen may experience screen freeze or frame loss.
[0116] By controlling the processor to increase the clock frequency, the processor's computing power is improved, so that the processor can process more data per unit time, thereby reducing the processor's load and shortening the time required for the processor to process interrupt data or other data, so that the display screen can smoothly display the image to the user.
[0117] The processor frequency must be increased to at least make the interrupt data processing time shorter than the preset interrupt data processing time. The duration of the frequency increase can be calculated synchronously based on the interrupt data processing time period, or it can be pre-written into the script file. Specifically, after the frequency increase, the subsequent interrupt data processing time is shorter than the preset interrupt data processing time.
[0118] S606: There is no need to control the processor frequency increase.
[0119] If the interrupt data processing time is less than the preset interrupt data processing time, it indicates that the processor can process the interrupt data or other data in time. Therefore, the processor can maintain the clock frequency without frequency increase, or obey the unified scheduling strategy of the system.
[0120] In the embodiment of the present application, by detecting the processing time of the interrupt data, it is determined whether it is necessary to control the processor frequency to increase. Compared with the process of using a timer to perform logical operations and make judgments based on the processing information of the processor core, by detecting the processing time of the necessary data processing process in the touch operation process and making a judgment result, the time consumed is shorter, so the processor frequency increase response speed is faster. In addition, when it is determined that the user touches the display screen, the processor frequency increase function is enabled in advance. When the frequency increase is required, the processor frequency increase can be directly controlled to further improve the response speed of the processor frequency increase.
[0121] On the basis of the above-mentioned embodiment, in order to further improve the response speed of the processor frequency increase, the embodiment of the present application can also load the script file in advance and initialize the thread queue during the startup phase of the electronic device.
[0122] Before step S601, the frequency adjustment method of the processor further includes: loading a script file related to the frequency increase function of the processor.
[0123] In the embodiment of the present application, the script file is a file related to the processor frequency increase function implemented. In addition, the script file may include multiple processor frequency increase files corresponding to the processor, and may also include multiple processor core frequency increase files corresponding to the processor core.
[0124] When the script file includes multiple processor frequency increase files corresponding to the processor, each processor frequency increase file includes a processor core frequency increase file corresponding to each core of the processor.
[0125] For example, when the processor cluster in the electronic device includes three processors, the main frequency of each processor is different, and the corresponding processor frequency increase files are also different. The script file includes three processor frequency increase files corresponding to different processors. For another example, when the electronic device includes an eight-core processor, the main frequency of each core is different, and the corresponding frequency increase files are also different. The script file includes three frequency increase files corresponding to different cores.
[0126] When the electronic device includes a multi-core processor, a corresponding processor core frequency boosting file is loaded in each core. The processor core frequency boosting file includes a plurality of sets of correspondences between first core frequencies, second core frequencies and interrupt data processing durations, as shown in Table 1.
[0127] Table 1: Schematic table of kernel frequency boost files
[0128]
[0129] When the first core frequency is 120MHz and the interrupt data processing time is 58ms, the second core frequency can be determined to be 140MHz according to the corresponding relationship in the processor core frequency increase file, and the core frequency of the processor core is increased to 140MHz. When the first core frequency is 120MHz and the interrupt data processing time is 99ms, the second core frequency can be determined to be 180MHz according to the corresponding relationship in the processor core frequency increase file, and the core frequency of the processor core is increased to 180MHz.
[0130] When the electronic device includes multiple processors, the corresponding processor frequency boosting file can be loaded into each processor first, and then the corresponding processor core frequency boosting file can be loaded into the processor core. The processor frequency boosting file includes multiple sets of corresponding relationships between the first operating frequency, the second operating frequency, and the interrupt data processing duration, as shown in Table 2.
[0131] Table 2: Schematic table of processor frequency boost files
[0132] First operating frequency Interruption data processing duration Second operating frequency 1.2GHz 50~70ms 1.4GHz 1.2GHz 71~90ms 1.6GHz 1.2GHz 91~110ms 1.8GHz 1.4GHz 50~70ms 1.6GHz 1.4GHz 71~90ms 1.8GHz
[0133] When the first operating frequency is 1.2GHz and the interrupt data processing time is 58ms, the second operating frequency can be determined to be 1.4GHz according to the corresponding relationship in the processor frequency increase file, and the operating frequency of the processor is increased to 1.4GHz. When the first operating frequency is 1.2GHz and the interrupt data processing time is 99ms, the second operating frequency can be determined to be 1.8GHz according to the corresponding relationship in the processor frequency increase file, and the operating frequency of the processor is increased to 1.8GHz.
[0134] Through the above process, when the electronic device is turned on, the script file is pre-loaded, and when the processor frequency needs to be increased, the corresponding script file can be directly called without the need for a loading process, thereby shortening the response time of the processor frequency increase.
[0135] In the embodiment of the present application, in addition to preloading the script file related to the processor frequency increase function, before step S601, it also includes binding the processor or processor core, and establishing an initialization thread for processing interrupt data in the bound processor or processor core. The following takes binding the processor core and establishing an initialization thread for processing interrupt data in the bound processor core as an example. Figure 7 As shown, Figure 7 A flowchart of another method for adjusting the frequency of a processor provided in an embodiment of the present application.
[0136] S701: Bind a processor core, and establish an initialization thread for processing interrupt data in the bound processor core.
[0137] After the interrupt data is reported to the processor, it needs to be allocated according to the working status of the processor or processor core, and a processor or a processor core processes the interrupt data. During the allocation process, the resource utilization of each processor or processor core can be calculated, and then the interrupt data is allocated to the processor or processor core with lower resource utilization.
[0138] In an embodiment of the present application, when the electronic device is powered on, a processor or processor core is pre-bound, and a thread queue for processing interrupt data is established in the bound processor or processor core.
[0139] S702: The touch chip scans the display screen to obtain interrupt data, and reports the interrupt data to the processor.
[0140] S703: Using the bound processor core to process the interrupt data, determine whether the user touches the display screen.
[0141] In step S701, the processor core for processing the interrupt data has been pre-bound, and a thread queue for processing the interrupt data has been established. When the interrupt data is reported to the processor, the processor can directly assign the interrupt data to the pre-bound processor core and process it using the pre-established thread queue.
[0142] S704: The power management module switches the power state of the processor to a low power consumption state.
[0143] S705: The power management module enables the frequency increase function of the processor, and the core controller compares the interrupt data processing time with the preset interrupt data processing time.
[0144] S706: Control the bound processor core to increase its frequency.
[0145] S707: There is no need to control the frequency increase of the bound processor core.
[0146] Through the above process, the time consumed in the allocation process can be saved and the processing speed of the interrupt data can be improved. In addition, since a thread queue for processing the interrupt data is established in advance, when detecting the processing time of the interrupt data, the thread queue for processing the interrupt data can be detected to directly obtain the processing time of the interrupt data.
[0147] The above embodiments introduce loading frequency-boosting files in each processor or processor core. In the implementation of this application, in order to solve the storage resource problem of the processor or processor core, after binding the processor or processor core, the corresponding frequency-boosting files can be loaded only in the pre-bound processor or processor core. Figure 8 As shown, Figure 8 A flowchart of another method for adjusting the frequency of a processor provided in an embodiment of the present application.
[0148] S801: Bind a processor core, and establish an initialization thread for processing interrupt data in the bound processor core.
[0149] S802: Loading a corresponding frequency-increasing file into a pre-bound processor or processor core.
[0150] By pre-binding processors or processor cores, interrupt data can be directly assigned to the pre-bound processors or processor cores after receiving them, while other processors or processor cores can process other data. In the embodiment of the present application, the frequency adjustment of the processor or processor core is based on the control of the processing time of the interrupt data. Therefore, for the processor or processor core that processes data other than the interrupt data, it is not necessary to load the frequency increase file; only the corresponding frequency increase file needs to be loaded in the processor or processor core that is pre-bound for processing the interrupt data.
[0151] S803: The touch chip scans the display screen to obtain interrupt data, and reports the interrupt data to the processor.
[0152] S804: Using the bound processor core to process the interrupt data, determine whether the user touches the display screen.
[0153] S805: The power management module switches the power state of the processor to a low power consumption state.
[0154] S806: The power management module enables the frequency increase function of the processor, and the core controller compares the interrupt data processing time with the preset interrupt data processing time.
[0155] S807: Control the frequency increase of the bound processor core.
[0156] S808: No need to control the frequency increase of the bound processor core.
[0157] For the scenario where electronic devices include multi-core processors, in the relevant technologies, in addition to the problem of screen freezes caused by processor frequency increase response delays, there is also the problem of excessive power consumption after the processor frequency increase. Take an eight-core processor with an architecture of 4 small cores + 3 medium cores + 1 large core as an example. In this processor, 4 small cores form a cluster, 3 medium cores form a cluster, and 1 large core forms a cluster. In the existing processor frequency increase technology, the frequency is increased in clusters. If a small core is overloaded and needs to be increased in frequency, the cluster to which the overloaded small core belongs will be directly controlled to increase in frequency, that is, the 4 small cores will be controlled to increase in frequency at the same time. For the other 3 overloaded small cores, the additional power consumption caused by the frequency increase is useless power consumption.
[0158] In an embodiment of the present application, when the electronic device is turned on, a script file containing files for implementing frequency increase of each processor core can be pre-loaded, and a processor core for processing interrupt data can be pre-bound to establish a thread queue for processing interrupt data. Therefore, the kernel scheduler can directly detect the thread queue for processing interrupt data in the pre-bound processor core and obtain the interrupt data processing time. When the interrupt data processing time is greater than the preset interrupt data processing time, the file corresponding to the processor core can be directly called from the script file, and the frequency increase action is only performed on the processor core, which saves the useless power consumption generated by the processor frequency increase to a certain extent.
[0159] The preset interrupt data processing time in the embodiment of the present application corresponds to the processor core and the core frequency of the processor core. When different processor cores operate at the same core frequency, the maximum time required for different processor cores to process the same interrupt data may be different. When the same processor core operates at different core frequencies, the maximum time required to process the same interrupt data is also different.
[0160] It is understandable that when the processor core pre-bound when the electronic device is powered on is the first core, the preset interrupt data processing duration compared with the interrupt data processing duration should be: the maximum duration required to process the interrupt data when the first core operates at the first core frequency. When the interrupt data processing duration is greater than or equal to the preset interrupt data processing duration, the file related to the first core can be called from the script file to control the first core to increase the frequency. Therefore, the embodiment of the present application can increase the frequency in units of processor cores rather than clusters or processors, thereby reducing unnecessary power consumption.
[0161] The embodiment of the present application controls the processor core to increase the frequency, thereby shortening the time spent on subsequent interrupt data processing. When the interrupt data processing time is detected again to be less than the preset interrupt data processing time, the processor core can also be controlled to restore the previous frequency to process the interrupt data, or the above step S606 is executed to save power consumption.
[0162] In another embodiment of the present application, if the processor core is not pre-bound and a thread queue for processing interrupt data is not established, after receiving the interrupt data, the processor can determine one or more target processor cores for processing the interrupt data according to the computing resource status of each processor core, and the target processor core establishes a thread queue for processing the interrupt data and processes the interrupt data.
[0163] The kernel scheduler can determine the kernel and the queue for processing the interrupt data according to the flow path of the interrupt data, and perform detection. Of course, after receiving the interrupt data, the target processor kernel can send an identifier for indicating the target processor and the thread queue for processing the interrupt data to the kernel scheduler, so that the kernel scheduler can determine the target processor and the thread queue for processing the interrupt data according to the identifier and detect the processing time of the interrupt data.
[0164] To more clearly understand the frequency adjustment method of the processor provided in the embodiment of the present application, the following is combined with Fig. 9 The embodiment of the present application is described. In the embodiment of the present application, the electronic device includes a multi-core processor, a touch panel driver, a core scheduler, a touch chip and a power management module.
[0165] S901: When the electronic device is powered on, the multi-core processor loads a script file corresponding to the multi-core processor architecture.
[0166] S902: When the electronic device is powered on, the touch panel driver is bound to one or more cores in the multi-core processor, and a thread queue for processing interrupt data is established in the core.
[0167] It should be noted that the execution order of step S901 and step S902 is not limited and they may be executed simultaneously.
[0168] S903: During the operation of the electronic device, the touch panel driver controls the touch panel to scan the display screen at a certain frequency.
[0169] S904: The touch panel driver transmits the touch information obtained by scanning to the control chip.
[0170] S905: After receiving the touch information, the touch chip processes the touch information to obtain interrupt data.
[0171] S906: The touch chip reports the interrupt data to the multi-core processor.
[0172] S907: The multi-core processor processes the interrupt data.
[0173] After receiving the interrupt data, the multi-core processor distributes the interrupt data to one or more pre-bound cores, and processes the interrupt data using a pre-established thread queue for processing the interrupt data. The multi-core processor can determine whether the user touches the display screen by processing the interrupt data.
[0174] When the user does not touch the display screen, the interruption data does not include the location information of the touch point. The multi-core processor can determine that the user has not touched the display screen by processing the interruption data, and execute step S908. When the user touches the display screen, the interruption data includes the location information of the touch point. The multi-core processor can obtain the touch position by processing the interruption data, and then determine that the user has touched the display screen, and execute step S910.
[0175] S908: The multi-core processor sends a first instruction to the power management module.
[0176] S909: The power management module switches the power state of the multi-core processor to a low power consumption state according to the first instruction.
[0177] S910: The multi-core processor sends a second instruction to the power management module.
[0178] S911: After receiving the second instruction, the power management module enables the frequency increase function of the multi-core processor to improve the response time of the frequency increase of the multi-core processor.
[0179] S912: The kernel scheduler sends a frequency increase policy to the multi-core processor.
[0180] When the multi-core processor processes interrupt data, the kernel scheduler continuously detects the interrupt data processing time and determines whether the interrupt data execution time is greater than or equal to the preset interrupt execution time. If the judgment result is yes, it indicates that the core used to process interrupt data in the multi-core processor is overloaded, and the frequency increase strategy is sent to the multi-core processor. If the judgment result is no, the multi-core processor obeys the unified scheduling of the system, and there is no need to increase the frequency of the core that processes the interrupt data.
[0181] S913: The multi-core processor calls the script file.
[0182] When receiving the frequency increase strategy, the multi-core processor calls the script file to increase the frequency of the core that processes the interrupt data.
[0183] It should be noted that in an electronic device, the implementation process of the frequency adjustment method of the processor can be recorded in the operating system kernel log, such as the call of the script file, the switching of the processor power state, and the frequency increase of the processor or the processor core. The operating system kernel log can be used to find the actions executed in the system at each time point.
[0184] The embodiment of the present application also provides an electronic device, which may include: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the smartphone in the above method embodiment. In addition, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.
[0185] The present application also provides a chip system, such as Fig.10 As shown, the chip system 1000 includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1002 can be used to send signals to other devices (such as the processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0186] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes each function or step executed by the mobile phone in the above method embodiment.
[0187] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer executes each function or step executed by the mobile phone in the above method embodiment.
[0188] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes each function or step performed by the mobile phone in the above method embodiment.
[0189] Among them, the electronic device, computer-readable storage medium, computer program product or chip system provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0190] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, etc., various media that can store program codes.
[0191] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for adjusting the frequency of a processor, characterized in that: Applied to an electronic device, the electronic device includes a display screen and a processor, and the method includes: Acquire a first time overhead of processing interrupt data when the processor is at a first operating frequency, wherein the interrupt data is used to indicate a touch state of the display screen; When the first time overhead is greater than a time overhead threshold corresponding to the first operating frequency, the processor increases the operating frequency.
2. The method according to claim 1, characterized in that The processor includes a plurality of processor cores, one or more processor cores of the plurality of processor cores are used to process the interrupt data, and the processor increases the operating frequency, including: The one or more processor cores increase the core frequency to a second core frequency according to the first core frequency, the first time overhead and the core frequency adjustment file; wherein the core frequency adjustment file corresponds to the processor core one-to-one, and the core frequency adjustment file includes the correspondence between the first core frequency, the first time overhead and the second core frequency, and the first core frequency is the core frequency of the processor core when the processor is at the first operating frequency.
3. The method according to claim 2, characterized in that Before obtaining the first time overhead, the method further includes: The multiple processor cores load corresponding core frequency adjustment files.
4. The method according to claim 2, characterized in that: Before obtaining the first time overhead, the method further includes: Binding one or more processor cores among the multiple processor cores for processing the interrupt data; The one or more processor cores increase the core frequency to a second core frequency according to the first core frequency, the first time overhead and the core frequency adjustment file, including: One or more processor cores bound to process the interrupt data increase the core frequency to a second core frequency according to the first core frequency, the first time overhead and the core frequency adjustment file.
5. The method according to claim 1, characterized in that The processor increases the operating frequency, including: The processor increases the operating frequency to a second operating frequency according to the first operating frequency, the first time overhead and a preloaded frequency adjustment file, wherein the frequency adjustment file includes a correspondence between the first operating frequency, the first time overhead and the second operating frequency.
6. The method according to any one of claims 1 to 5, characterized in that: The electronic device further includes a power management module, and the method further includes: When the processor processes the interrupt data to obtain the touch position, the processor sends a function activation instruction to the power management module; the function activation instruction is used to instruct the power management module to enable the operating frequency switching function of the processor.
7. The method according to any one of claims 1 to 5, characterized in that: The electronic device further includes a power management module, and the method further includes: When the processor fails to obtain a touch position by processing the interrupt data, the processor sends a sleep instruction to the power management module; the sleep instruction is used to instruct the power management module to reduce the power consumption of the processor.
8. A method for adjusting the frequency of a processor, characterized in that: Applied to an electronic device, the electronic device includes a display screen and a processor cluster, the processor cluster includes at least a first processor and a second processor, the first processor is a processor for processing interrupt data, the method includes: acquiring a first time overhead of processing interrupt data when the first processor is at a first operating frequency, wherein the interrupt data is used to indicate a touch state of the display screen; When the first time overhead is greater than a time overhead threshold corresponding to the first operating frequency, the first processor increases the operating frequency.
9. A chip system, characterized in that: The chip system is applied to an electronic device including a processor and a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through lines. The interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor. The signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device executes the frequency adjustment method of the processor as described in any one of claims 1-8.
10. An electronic device, characterized in that: The electronic device includes a memory and one or more processors, and the memory is coupled to the processor; wherein the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the frequency adjustment method of the processor as described in any one of claims 1-8.