Dynamic frequency adjustment method, electronic equipment and storage medium
By dynamically adjusting the frequency of electronic devices, the frequency lag problem of the DVFS mechanism during transient IO events is resolved, improving system performance and user experience while reducing power consumption and resource waste.
Patent Information
- Application Number
- CN202410410618.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-07
- Publication Date
- 2025-10-21
AI Technical Summary
The existing DVFS mechanism is unable to adjust the frequency in a timely manner when a large number of transient I/O events occur, resulting in frequency lag, frequency drop, lag, and data delay, affecting the user experience, while increasing device power consumption and wasting resources.
Electronic devices dynamically adjust the frequency of target devices by monitoring user operations and scenarios, including determining the frequency point, lock period and load conditions, and using a voting mechanism to improve the accuracy and stability of frequency adjustment and avoid repeated adjustments.
It achieves timely frequency adjustment, reduces system latency and device power consumption, improves system performance and user experience, and avoids resource waste.
Smart Images

Figure CN120825541A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart terminals, and in particular to a method for dynamically adjusting frequency, an electronic device, and a storage medium. Background Art
[0002] DVFS (Dynamic Voltage and Frequency Scaling) is a chip-level mechanism for managing power consumption and performance. It dynamically adjusts the voltage and frequency of related hardware devices (such as the CPU and memory devices) based on load, achieving a balance between performance and power consumption.
[0003] That is, when the system doesn't require high performance, DVFS lowers the voltage and frequency to reduce power consumption; when the system does require high performance, it increases the voltage and frequency to improve performance. However, when a large number of transient IO (Input / Output) events occur, DVFS-based frequency adjustments will lag and fail to adjust the frequencies of related hardware devices in a timely manner, resulting in frequency drops, lags, data delays, and other phenomena that affect the user experience.
[0004] To avoid frequency adjustment lag, existing technologies disable the DVFS mechanism and adjust the frequency of related hardware devices to the maximum value when a large number of transient I / O events occur, thereby improving the performance of the related hardware devices. However, while this method improves the performance of the related hardware devices, it also increases the power consumption of the devices, resulting in a waste of device resources and increased power consumption. Summary of the Invention
[0005] To address the above technical issues, embodiments of the present application provide a method, electronic device, and storage medium for dynamically adjusting frequency. This method allows the electronic device to dynamically adjust the frequency of a target device in a timely manner, thereby reducing system latency and device power consumption, and improving system performance and user experience.
[0006] In a first aspect, embodiments of the present application provide a method for dynamically adjusting frequency. The method includes: an electronic device monitoring a current event corresponding to a user operation; when the scene corresponding to the current event is a target scene, the electronic device determining a first frequency point of a target device, and adjusting the frequency of the target device based on the first frequency point.
[0007] For example, the user operation may be an operation in which the user triggers a cold start of an application, an operation in which the user plays a local video, or an operation in which the user triggers a switch of game resources.
[0008] The target scenario may be a scenario where the throughput demand for data in the UFS storage device increases instantaneously, i.e., a transient high UFS IO scenario. The first frequency point may be a frequency point of the target device. It is understood that the frequency point and the frequency can be converted to each other and are both used to describe the operating speed of the target device.
[0009] The target device may be a hardware device in an electronic device.
[0010] Exemplarily, the target device may be a UFS storage device.
[0011] In this way, the electronic device can timely and dynamically adjust the frequency of the target device, thereby reducing system latency and device power consumption, and improving system performance and user experience.
[0012] According to the first aspect, after determining the first frequency point of the target device, the electronic device may further include: the electronic device determining a lock period corresponding to the first frequency point, and determining a target state of the target device according to the lock period.
[0013] The target state is a locked state of the frequency of the target device, that is, whether the frequency of the target device is locked can be determined according to the target state.
[0014] Specifically, the target state may be a state in which the frequency of the target device is locked, or a state in which the frequency of the target device is unlocked.
[0015] In this way, the electronic device can determine the locking period corresponding to the first frequency point, thereby maintaining the frequency point of the target device at the first frequency point during the locking period.
[0016] According to the first aspect, or any implementation of the first aspect above, the method may further include: the electronic device obtains a target state when a preset period is satisfied at the current moment; when the target state is a first value, the electronic device obtains a first load corresponding to the current moment, and calculates a second frequency point of the target device based on the first load; and the electronic device adjusts the frequency of the target device based on the second frequency point.
[0017] The preset period may be a pre-set period for adjusting the frequency of the target device. Specifically, the preset period is also a frequency modulation period.
[0018] For example, the preset period may be 60 ms, that is, the frequency of the target device is adjusted every 60 ms.
[0019] In the present application, the first value may be used to indicate that the frequency locking state of the target device is an unlocked state.
[0020] The first load may be a window load corresponding to the current moment, and the second frequency may be another frequency of the target device.
[0021] In this way, the electronic device can periodically adjust the frequency of the target device when the frequency of the target device is not locked.
[0022] According to the first aspect, or any implementation of the first aspect above, after obtaining the target state, the electronic device may further include: when the target state is a second value, the electronic device returns to execute when the preset cycle is satisfied at the current moment to obtain the target state.
[0023] In the present application, the second value may be used to indicate that the frequency locking state of the target device is a locked state.
[0024] In this way, the electronic device can skip periodic frequency adjustment when the frequency of the target device is locked, thereby avoiding repeated frequency adjustment and avoiding waste of resources.
[0025] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the first frequency point of the target device, which may include: the electronic device determines the target demand corresponding to the current event, and determines the first frequency point of the target device according to the target demand.
[0026] The target requirement may be a throughput requirement for data in the UFS storage device corresponding to the scenario of the current event. Specifically, the target requirement is also the scenario requirement.
[0027] In this way, the electronic device can determine the frequency of the target device according to the data throughput requirement corresponding to the user operation, thereby accurately determining the frequency of the target device and further improving system performance.
[0028] According to the first aspect, or any implementation method of the first aspect above, the electronic device determines the first frequency point of the target device, which may also include: the electronic device determines the target demand corresponding to the current event, the bandwidth occupancy corresponding to the target device, and the second load; the electronic device determines the first frequency point of the target device based on the target demand, bandwidth occupancy, and the second load.
[0029] The second load may be a system load when determining the first frequency point of the target device.
[0030] It is understandable that the target demand corresponding to the current event, the bandwidth occupancy corresponding to the target device, and the second load can all affect the frequency of the target device.
[0031] In this way, the electronic device can determine the frequency of the target device according to multiple factors that affect the frequency of the target device, thereby being able to more accurately determine the frequency of the target device.
[0032] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the first frequency of the target device, which may include: the electronic device votes on the frequency of the target device and determines the first frequency of the target device based on the first voting result.
[0033] The first voting result may be a result obtained by the electronic device voting on the frequency point of the target device.
[0034] In this way, the electronic devices can determine the first frequency point of the target device by voting, thereby improving the accuracy of the frequency point of the target device.
[0035] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the lock period corresponding to the first frequency point, which may include: the electronic device determines the target demand corresponding to the current event, and determines the lock period corresponding to the first frequency point based on the target demand.
[0036] In this way, the electronic device can determine the frequency locking period of the target device according to the data throughput requirement corresponding to the user operation, thereby accurately determining the frequency locking period of the target device and further improving system performance.
[0037] According to the first aspect, or any implementation method of the first aspect above, the electronic device determines the locking period corresponding to the first frequency point, and may also include: the electronic device determines the target demand corresponding to the current event, the bandwidth occupancy corresponding to the target device, and the second load; the electronic device determines the locking period corresponding to the first frequency point based on the target demand, bandwidth occupancy, and the second load.
[0038] It is understandable that the target demand corresponding to the current event, the bandwidth occupancy corresponding to the target device, and the second load can all affect the frequency locking period of the target device.
[0039] In this way, the electronic device can determine the frequency locking period of the target device according to multiple factors that affect the frequency locking period of the target device, thereby being able to more accurately determine the frequency locking period of the target device.
[0040] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the lock period corresponding to the first frequency point, which may include: the electronic device votes on the lock period of the frequency point of the target device, and determines the lock period corresponding to the first frequency point based on a second voting result.
[0041] The second voting result may be a result obtained by the electronic device voting on the locking period of the frequency of the target device.
[0042] In this way, the electronic devices can determine the locking period of the frequency of the target device by voting, thereby improving the accuracy of the locking period of the frequency of the target device.
[0043] According to the first aspect, or any implementation method of the first aspect above, the electronic device determines the lock-in period corresponding to the first frequency point based on the second voting result, and may also include: the electronic device determines the target period in which the end time of the lock-in period is located, and the end time of the target period; the electronic device calculates the end time of the target period and the difference between the end time of the lock-in period; when the difference is less than the period length of the preset period, the electronic device updates the end time of the lock-in period to the end time of the target period.
[0044] The target period may be one of the preset periods.
[0045] Specifically, the end time of the lock-up period is within the target period.
[0046] For example, see Figure 13b , assuming that the end time of the lock-up period is time b, then the i+1th period is the target period, and time t3 is the end time of the target period.
[0047] It can be understood that the end time of the target cycle is also the start time of the next cycle adjacent to the target cycle.
[0048] See also Figure 13b , the difference between the end time of the target period and the end time of the lock-up period, that is, the difference c between time b and time t3.
[0049] In this way, the electronic device can extend the frequency locking period to the start time of the adjustment cycle, thereby improving the stability of the frequency adjustment.
[0050] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the target state of the target device based on the lock period, which may include: the electronic device sets the value of the target state to the second value at the beginning of the lock period; and the electronic device sets the value of the target state to the first value at the end of the lock period.
[0051] In this way, the electronic device can set the locking state of the frequency of the target device according to the start or end time of the locking period, thereby further improving the stability of the frequency adjustment.
[0052] According to the first aspect, or any implementation of the first aspect, the target device is a UFS storage device.
[0053] In a second aspect, embodiments of the present application provide an electronic device. The electronic device includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the dynamic frequency adjustment method of the first aspect and any one of the first aspects.
[0054] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.
[0055] In a third aspect, an embodiment of the present application provides a computer-readable storage medium comprising a computer program, which, when executed on an electronic device, causes the electronic device to execute the method for dynamically adjusting frequency according to the first aspect and any one of the first aspects.
[0056] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.
[0057] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed, enables a computer to execute a method for dynamically adjusting frequency as in the first aspect or any one of the items in the first aspect.
[0058] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.
[0059] In a fifth aspect, the present application provides a chip comprising a processing circuit and a transceiver pin. The transceiver pin and the processing circuit communicate with each other via an internal connection path, and the processing circuit performs the dynamic frequency adjustment method according to the first aspect or any one of the first aspects to control the receive pin to receive a signal and the transmit pin to transmit a signal.
[0060] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 is a schematic diagram of the hardware structure of an electronic device shown as an example;
[0062] Figure 2 is a schematic diagram of the software structure of an electronic device shown as an example;
[0063] Figure 3 Schematic diagram of module interaction for a method of dynamically adjusting frequency based on DVFS;
[0064] Figure 4 Schematic diagram showing an exemplary relationship between UFS load and frequency;
[0065] Figure 5 1 is a schematic diagram of a flow chart showing an exemplary dynamic adjustment of frequency;
[0066] Figure 6 FIG1 is a schematic diagram showing another exemplary relationship between UFS load and frequency;
[0067] Figure 7-8 A schematic diagram of module interaction of an exemplary method for dynamic frequency adjustment is shown;
[0068] Figure 9-10 A schematic diagram of module interaction of another method for dynamically adjusting frequency is shown as an example;
[0069] Figure 11-12 A schematic diagram of module interaction of another method for dynamically adjusting frequency is shown as an example;
[0070] Figures 13a-13b FIG. 1 is a schematic diagram showing an exemplary timing relationship between frequency adjustment and adjustment period. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0072] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0073] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.
[0074] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0075] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.
[0076] The dynamic frequency adjustment method provided in the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device in the embodiment of the present application can be a mobile phone with a UFS (Universal Flash Storage) storage device, a sports camera (GoPro), a digital camera, a tablet computer, a handheld computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, etc. The embodiment of the present application does not impose any special restrictions on the specific form of the electronic device.
[0077] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below:
[0078] like Figure 1FIG2 is a schematic diagram of the structure of the electronic device 100. Optionally, the electronic device 100 may be a terminal, which may also be referred to as a terminal device. The terminal may be a device having a UFS storage device, such as a cellular phone or a tablet computer, which is not limited in this application.
[0079] It should be understood that Figure 1 The illustrated electronic device 100 is merely one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. Figure 1 The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0080] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a temperature sensor, a motion sensor, an air pressure sensor, a magnetic sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0081] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0082] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0083] The processor 110 may further include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
[0084] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0085] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0086] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0087] The wireless communication module 160 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0088] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0089] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 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 modify display information.
[0090] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0091] The electronic device 100 can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 format such as RGB, YUV, etc.
[0092] In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
[0093] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function.
[0094] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, such as enabling the electronic device 100 to implement the dynamic frequency adjustment method in the embodiment of the present application. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc.
[0095] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0096] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0097] The pressure sensor is used to sense pressure signals and convert the pressure signals into electrical signals. In some embodiments, the pressure sensor can be provided on the display screen 194. The electronic device 100 can also calculate the touch position based on the detection signal of the pressure sensor.
[0098] A touch sensor, also known as a "touch panel," can be mounted on display screen 194. The touch sensor and display screen 194 together form a touch screen, also known as a "touch screen." The touch sensor detects touch operations applied to or near the touch sensor. The touch sensor can communicate the detected touch operations to the application processor to determine the type of touch event.
[0099] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0100] Figure 2 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0101] The layered architecture of electronic device 100 divides the software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom, the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0102] The application layer can include a series of application packages.
[0103] like Figure 2 As shown, the application package may include a camera, a gallery, and third-party applications with camera functions, etc. For example, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0104] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer, including various components and services to support developers' Android development. The application framework layer includes some predefined functions.
[0105] like Figure 2 As shown, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, a scene recognition engine, and the like.
[0106] The activity manager is responsible for managing activities, as well as the startup, switching, scheduling of components in the system and the management and scheduling of applications.
[0107] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0108] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0109] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0110] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0111] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating electronic devices, or flashing indicator lights.
[0112] The scene recognition engine is used to identify scenarios where the throughput demand for data in the UFS storage device increases instantaneously (i.e., a sudden increase in data throughput demand). For example, scenarios such as application cold start, local video playback, game resource switching or loading, etc. are not limited to this application.
[0113] For the convenience of description, the “scenario in which the throughput demand for data in the UFS storage device increases instantaneously” is referred to as the “instantaneous high UFS IO scenario” hereinafter.
[0114] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.
[0115] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0116] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0117] The system library can 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.
[0118] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0119] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0120] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0121] A 2D graphics engine is a drawing engine for 2D drawings.
[0122] The HAL layer is the interface between the operating system kernel and the hardware circuitry. The HAL layer includes, but is not limited to, a camera HAL module and an audio HAL module. The camera HAL module processes image streams, while the audio HAL module processes audio streams (for example, by performing noise reduction, directional enhancement, and other processing).
[0123] The kernel layer is the layer between hardware and software. It includes at least the UFS driver, UFS boost module, OPP device, and DVFS driver. Hardware includes at least the processor, display, camera, and UFS.
[0124] Among them, the UFS boost module is used to determine the UFS frequency corresponding to the instantaneous high UFS IO scenario and the UFS frequency locking period.
[0125] The OPP device is used to manage non-CPU devices (such as UFS storage devices) with OPP (Operating Performance Point) functions.
[0126] The DVFS driver is used to dynamically adjust the frequency and voltage of non-CPU devices with OPP capabilities.
[0127] It's important to note that existing SoCs (system-on-chips) consist of multiple submodules working together. During system operation, not all modules need to run at the highest frequency to maintain peak performance. For convenience, submodules within an SoC are grouped into domains, allowing some domains to operate at lower voltages and frequencies while others operate at higher voltage / frequency pairs. The set of voltage / frequency pairs supported by a domain is called an OPP.
[0128] It is understandable that Figure 2 The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.
[0129] It is understandable that, in order to implement the dynamic frequency adjustment method in the embodiment of the present application, the electronic device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.
[0130] The following describes a scenario of dynamic frequency adjustment provided by an embodiment of the present application. The dynamic frequency adjustment scenario is one of the common application scenarios of electronic devices. Among them, frequency is the clock frequency of the device, which can determine the operating speed of the device.
[0131] With the development of intelligent technology, users have higher and higher performance requirements for electronic devices. When users use electronic devices, electronic devices can dynamically adjust the frequency of related hardware devices (such as central processing unit CPU, UFS storage device, etc.) in the electronic devices according to user needs to meet the user's high performance requirements for electronic devices.
[0132] In this scenario, the dynamic adjustment of the frequency of a UFS storage device is taken as an example for explanation.
[0133] UFS (Universal Flash Storage) is a non-volatile storage technology for long-term data storage. It is typically used to store operating systems, applications, multimedia files, and other user data. It offers high read and write speeds and preserves data even when power is lost or the device is shut down.
[0134] During system operation, such as when cold-starting an application, playing a local video, or switching or loading game resources, the data required for system operation can be read from the UFS storage device. To improve system performance and energy efficiency, the UFS operating frequency can be dynamically adjusted. In other words, when the system does not require high performance, the UFS operating frequency can be lowered to reduce system power consumption; when the system does require high performance, the UFS operating frequency can be increased to improve system read and write performance.
[0135] The following describes the related technologies and problems related to the embodiments of the present application.
[0136] Figure 3 FIG. 1 is a schematic diagram showing the module interaction of a method for dynamically adjusting frequency based on DVFS. Figure 3 As shown in FIG, the process of the method for dynamically adjusting frequency based on DVFS may specifically include:
[0137] S101. The UFS driver sends a UFS registration device request to the DVFS driver.
[0138] Specifically, the UFS registration device is to register the UFS device in the devfreq framework.
[0139] Among them, the devfreq framework can be used to implement frequency adjustment of hardware devices other than the CPU.
[0140] For hardware devices in electronic devices that can adjust their frequency (such as CPU, UFS, etc.), the purpose of saving power and improving performance can be achieved by adjusting the device frequency.
[0141] For the CPU, its frequency can be controlled and managed through the cpufreq framework, but the cpufreq framework is not compatible with other hardware devices. Therefore, the frequency adjustment of other hardware devices that can adjust the frequency in electronic devices besides the CPU can be achieved through the devfreq framework.
[0142] Before the devfreq framework can adjust the frequency of a hardware device, the hardware device must be registered with the devfreq framework. In other words, only after the UFS device is registered with the devfreq framework can the electronic device adjust the frequency of the UFS device through the devfreq framework.
[0143] Specifically, after the UFS is powered on, a UFS registration device request can be sent to the DVFS driver through the UFS driver to register the UFS device in the devfreq framework.
[0144] S102 : After receiving the UFS device registration request sent by the UFS driver, the DVFS driver initializes UFSdevfreq.
[0145] Specifically, the DVFS driver can register the UFS device during the UFS devfreq initialization process.
[0146] It should be noted that, regarding the related processing flow of UFS devfreq initialization and device registration, reference can be made to the existing technology and will not be repeated here.
[0147] S103. The DVFS driver determines whether the current time satisfies the frequency modulation period; if so, executes step S104; if not, returns to execute step S103.
[0148] The frequency modulation period may be a preset period for adjusting the frequency.
[0149] Exemplarily, the period length of the frequency modulation period may be 60 ms.
[0150] It is understandable that different hardware devices may correspond to different frequency modulation periods, and the period length of the frequency modulation period may be configured according to actual needs, which is not limited in the embodiments of the present application.
[0151] It should be noted that there may be many specific implementations of "DVFS driver determining whether the current moment meets the frequency modulation period", and this application does not impose any restrictions on this.
[0152] For example, the DVFS driver determines whether the current time meets the frequency modulation period based on the time interval between the current time and the last frequency modulation period, as well as the duration of the frequency modulation period. Specifically, if the time interval is less than the duration of the frequency modulation period, the current time does not meet the frequency modulation period. If the time interval is equal to the duration of the frequency modulation period, the current time meets the frequency modulation period.
[0153] In another example, the DVFS driver determines whether the current time satisfies the frequency modulation period by determining whether the current time is the start time of the frequency modulation period. That is, if the current time is the start time of the frequency modulation period, the current time satisfies the frequency modulation period. If the current time is not the start time of the frequency modulation period, the current time does not satisfy the frequency modulation period.
[0154] Specifically, if the current time satisfies the frequency modulation period, frequency adjustment can be performed, and the window period load corresponding to the current time can be obtained. If the current time does not meet the frequency modulation period, frequency adjustment is not required, and the next current time can be waited for until the next current time meets the adjustment period, and the window period load corresponding to the current time can be obtained.
[0155] S104. The DVFS driver obtains the window load corresponding to the current moment from the OPP device.
[0156] The window period load may be a load condition of the UFS storage device within the window period corresponding to the current moment.
[0157] Specifically, when determining the load of the UFS storage device, it is necessary to calculate the load situation in a certain time period before the current moment. The certain time period before the current moment can be called a window period.
[0158] For example, the window period may be 60 ms long, that is, the window period load is the load of the UFS storage device within 60 ms before the current moment.
[0159] It should be noted that, for the relevant processing flow of the OPP device determining the window period load, reference can be made to the existing technology and will not be repeated here.
[0160] S105. The DVFS driver calculates the current frequency of the UFS device based on the window period load and sends the current frequency to the UFS driver.
[0161] The current frequency may be a frequency corresponding to the current moment.
[0162] Specifically, the DVFS driver can calculate the current frequency of the UFS device based on the window load based on the pre-set frequency modulation strategy. It is understandable that different window loads can correspond to different frequencies, and different hardware devices can correspond to different frequency modulation strategies.
[0163] It should be noted that the frequency modulation strategy of UFS can be configured according to actual needs, and the embodiments of the present application do not limit this.
[0164] After receiving the current frequency, the UFS driver can drive the UFS device to operate at the current frequency.
[0165] Figure 4 The following is an example of a corresponding relationship diagram of UFS load and frequency, wherein the horizontal axis is time T and the vertical axis is UFS load L or UFS frequency F. Specifically, Figure 4 The corresponding relationship between the UFS load and the frequency is exemplarily shown when the electronic device adjusts the UFS frequency based on the DVFS dynamic frequency adjustment method.
[0166] See also Figure 4 , the UFS load curve 201 changes with time T, and at time t2, the UFS load reaches the highest value. It is understandable that when the throughput demand of the data in the UFS storage device increases instantaneously, the UFS load can increase in a short time (for example, within a window period). Similarly, the electronic device can adjust the UFS frequency (such as Figure 4 202 in FIG. 1 ).
[0167] For example, assuming that the frequency adjustment period is met at time t3, the electronic device can determine the UFS load between time t0 and time t3 (i.e., the window period load), and calculate the frequency F2 of the UFS device based on the load, so as to adjust the frequency F1 of the UFS device to F2 at time t3, thereby enabling the UFS device to operate at frequency F2, thereby improving the performance of the electronic device.
[0168] Continue to see Figure 4 The load of UFS begins to increase at time t1 and reaches its maximum value at time t2. Therefore, the electronic device can adjust the frequency of UFS to frequency F2 at time t3 by dynamically adjusting the frequency based on DVFS.
[0169] That is to say, in the instantaneous high UFS IO scenario, when the electronic device adjusts the UFS frequency based on the DVFS dynamic frequency adjustment method, it cannot adjust the frequency when the UFS load increases (that is, at time t1), but instead adjusts the frequency in the first adjustment cycle after the UFS load increases (that is, at time t3), resulting in a lag in frequency adjustment. The UFS frequency cannot be adjusted in time when the load increases, resulting in frequency drops, freezes, data delays, etc., affecting the user experience.
[0170] To avoid frequency adjustment lag, existing technologies disable the DVFS-based dynamic frequency adjustment method and adjust the UFS frequency to the highest frequency when a large number of transient IO events occur.
[0171] Specifically, when the load on the UFS storage device of an electronic device is low, UFS runs at the lowest frequency; when the electronic device detects the arrival of a high-load event (that is, the load on the UFS storage device increases), it immediately adjusts the UFS frequency to the highest frequency without calculating the window period load.
[0172] That is to say, when the load of the UFS storage device increases, the electronic device adjusts the UFS frequency to the highest frequency point regardless of the size of the load increase.
[0173] However, although this method can avoid the frequency adjustment lag, it still adjusts the UFS frequency to the highest frequency when the load increase of the UFS storage device is small, thereby increasing the power consumption of the electronic device, causing a waste of device resources, and increasing the power consumption of the device.
[0174] To address the above technical issues, embodiments of the present application provide a method for dynamically adjusting frequency. In this method, an electronic device can generate a current event in response to a user operation and monitor the current event. When the current event is detected to correspond to a transient high UFS IO scenario, the target frequency of the UFS storage device and the lockout period corresponding to the target frequency are determined based on the scenario requirements, system load, and UFS bandwidth usage. The frequency of the UFS storage device is adjusted according to the target frequency, so that the UFS storage device operates at the frequency corresponding to the target frequency during the lockout period corresponding to the target frequency.
[0175] At the same time, the electronic device can also obtain the frequency lock status when the frequency modulation period is met at the current moment, and obtain the window period load corresponding to the current moment when the frequency lock status is unlocked. The electronic device calculates the current frequency of the UFS storage device based on the window period load and adjusts the frequency of the UFS storage device based on the current frequency, so that the UFS storage device operates at the frequency corresponding to the target frequency within the frequency modulation period.
[0176] In this way, the electronic device can timely and dynamically adjust the frequency of the target device, avoiding frequency adjustment lag, while reducing device power consumption and avoiding resource waste, thereby reducing system latency and device power consumption, and improving system performance and user experience.
[0177] The specific process of dynamic frequency adjustment provided by the embodiment of the present application is described in detail below in conjunction with specific scenarios.
[0178] Figure 5 FIG. 1 is a flow chart showing an exemplary process of dynamic frequency adjustment. Figure 5 As shown, the dynamic adjustment of frequency may include two parts, one of which is "periodic frequency adjustment" and the other is "frequency adjustment under scenario".
[0179] During the "periodic frequency adjustment" process, the electronic device can periodically determine the frequency lock status. If the frequency is not locked, the UFS frequency can be adjusted based on the window load of the UFS storage device. If the frequency is locked, the UFS frequency adjustment for this adjustment cycle can be skipped.
[0180] Specifically, "periodic frequency adjustment" may include: after the UFS device is powered on, the UFS driver may register the UFS device through the DVFS driver. After completing the device registration, the DVFS driver may read the frequency lock status in the UFS driver.
[0181] If the frequency lock status read during the current adjustment period is unlocked, the DVFS driver can obtain the window period load of the UFS storage device from the OPP device and determine frequency point B based on the window period load of the UFS storage device. After determining frequency point B, the DVFS driver can send frequency point B to the UFS driver.
[0182] If the frequency lock status read in the current adjustment cycle is locked, the DVFS driver can read the frequency lock status from the UFS driver again when the next adjustment cycle arrives.
[0183] The frequency lock status is used to identify whether the frequency is locked.
[0184] In the embodiment of the present application, the frequency lock state may be stored in the UFS driver, and the UFS driver may determine a state value corresponding to the frequency lock state.
[0185] For example, when the UFS frequency is locked, the UFS driver may set the frequency lock state to 0; when the UFS frequency is not locked, the UFS driver may set the frequency lock state to 1.
[0186] In an optional implementation, the frequency lock status can also be stored in the UFS boost module, which can determine the status value corresponding to the frequency lock status. In this way, after completing device registration, the DVFS driver can also read the frequency lock status from the UFS boost module (as shown in the dotted line in the figure).
[0187] In another optional implementation, the frequency lock status can also be stored in the DVFS driver, and the DVFS driver can determine the status value corresponding to the frequency lock status. In this way, the DVFS driver can also directly read the frequency lock status from the DVFS driver after completing device registration (not shown in the figure).
[0188] During the "frequency adjustment under scenario" process, the electronic device can identify the instantaneous high UFS IO scenario, and when it identifies the instantaneous high UFS IO scenario, it adjusts the UFS frequency according to the scenario requirements, system load and UFS bandwidth occupancy, and sets the frequency point lock state to the locked state.
[0189] Specifically, "frequency adjustment in a scenario" may include: when a user operates an electronic device, the electronic device generates a response event in response to the user operation and reports the event to a scenario recognition engine. The scenario recognition engine identifies whether the scenario corresponding to the response event is a transient high UFS IO scenario.
[0190] If so, the scene recognition engine can determine that the current scene is a transient high UFS IO scene and send a response event to the UFS boost module. The UFS boost module can determine frequency A and the lock period of frequency A based on the corresponding scene requirements, system load, and UFS bandwidth usage of the response event, and send frequency A and the lock period of frequency A to the UFS driver.
[0191] If not, the scene recognition engine may determine that the current scene is not a transient high UFS IO scene, and may terminate the frequency adjustment of the UFS.
[0192] The response event generated by the electronic device in response to the user operation may be an event corresponding to the user operation generated by the electronic device in response to the user operation after the user operates the electronic device.
[0193] Exemplary cold start process of an application: when a user clicks an application icon to start the application, the application responds to the user operation and sends the application framework to the activity manager, which then creates the main activity of the application.
[0194] The "Create Application Main Activity" event, generated by the electronic device in response to a user action, can be identified by the scene recognition engine as an event corresponding to the transient high UFS IO scenario. In other words, when the scene recognition engine detects the creation of an application's main activity, it can determine that the current scenario is a transient high UFS IO scenario.
[0195] A cold start of an application refers to the process of reloading all of the application's resources and data when a user opens an application for the first time, or when the application is opened again after being completely closed.
[0196] In another example, local video playback: when the user clicks on the local video playback, the electronic device responds to the user operation and loads the data in the UFS into the decoder (codec).
[0197] The "UFS data loaded to the decoder" event, generated by the electronic device in response to a user action, can be identified by the scene recognition engine as an event corresponding to a transient high UFS IO scenario. In other words, when the scene recognition engine detects UFS data being loaded to the decoder, it can determine that the current scenario is a transient high UFS IO scenario.
[0198] In another example, game resource switching: when the user clicks to switch game resources (for example, switch game maps), the electronic device responds to the user operation and reads data in the UFS to switch the screen.
[0199] The "reading data from UFS for screen switching" event, generated by the electronic device in response to a user action, can be identified by the scene recognition engine as an event corresponding to a transient high UFS IO scenario. In other words, when the scene recognition engine detects that UFS data is being read for screen switching, it can determine that the current scenario is a transient high UFS IO scenario.
[0200] The system load is a measure of the system CPU's busyness, which represents the total number of processes currently being executed by the CPU and waiting to be executed by the CPU.
[0201] It is understandable that scenario requirements, system load, and UFS bandwidth usage will all affect the UFS operating frequency. Therefore, when determining UFS frequency point A, the frequency point A and the lock period of frequency point A can be determined based on the scenario requirements, system load, and UFS bandwidth usage corresponding to the response event.
[0202] In an optional implementation, the UFS boost module may further determine frequency A and a locking period of frequency A according to scenario requirements corresponding to the response event.
[0203] Figure 6 Another schematic diagram of the corresponding relationship between UFS load and frequency is shown as an example, wherein the horizontal axis is time T and the vertical axis is UFS load L or UFS frequency F. Specifically, Figure 6 The embodiment exemplifies the corresponding relationship between the UFS load and the frequency when the electronic device adjusts the UFS frequency based on the dynamic frequency adjustment method provided in the embodiment of the present application.
[0204] It should be noted that Figure 6 The load curve 201 of the UFS changes with time, and Figure 4 The load curve 201 of the UFS in FIG. 2 changes with time in the same manner.
[0205] In the embodiment of the present application, the electronic device can increase the UFS frequency when detecting an event corresponding to a transient high UFS IO scenario, lock the frequency during the frequency locking period, and reduce the UFS frequency after the frequency locking period ends (e.g., Figure 6 203 in FIG. 1 ).
[0206] For example, assuming that the electronic device detects an event corresponding to an instantaneous high UFS IO scenario at time t4, the electronic device can calculate the frequency F2 of the UFS device based on the scenario requirements, system load, and UFS bandwidth occupancy at time t4, and adjust the frequency F2 of the UFS device from frequency F1 to frequency F2 at time t4, so that the UFS device can operate at frequency F2, thereby improving the performance of the electronic device.
[0207] At the same time, the electronic device can maintain the UFS frequency at frequency F2 from time t4 to time t5 (frequency locking period), and reduce the UFS frequency at time t5 to reduce device power consumption and avoid waste of device resources.
[0208] Continue to see Figure 6 , the load of the UFS begins to increase at time t1. The electronic device can adjust the frequency of the UFS to frequency F2 at time t4 based on the dynamic frequency adjustment method provided in the embodiment of the present application, and reduce the frequency of the UFS at time t5.
[0209] That is to say, in the instantaneous high UFS IO scenario, when the electronic device adjusts the UFS frequency based on the dynamic frequency adjustment method provided in the embodiment of the present application, it can promptly increase the frequency when the UFS load increases, and promptly reduce the frequency after the frequency point locking period ends, thereby avoiding the frequency adjustment lag, while reducing device power consumption, avoiding waste of device resources, and reducing device power consumption, thereby improving device performance and user experience.
[0210] The following uses a specific example to explain the dynamic frequency adjustment method. Figure 7-8The figure is a schematic diagram of module interaction of an exemplary method for dynamic frequency adjustment.
[0211] Reference Figure 7 The process of "periodic frequency adjustment" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0212] S201: The UFS driver sends a UFS registration device request to the DVFS driver.
[0213] S202 : After receiving the UFS device registration request sent by the UFS driver, the DVFS driver initializes UFSdevfreq.
[0214] S203. The DVFS driver determines whether the current time meets the frequency modulation period; if so, executes step S204; if not, returns to execute step S203.
[0215] The specific processing flow of steps S201-S203 is the same as that of steps S101-S103, and will not be repeated here.
[0216] S204. The DVFS driver reads the frequency lock status in the UFS driver.
[0217] S205. The DVFS driver determines whether the UFS frequency is locked; if so, returns to step S203; if not, executes step S206.
[0218] In an embodiment of the present application, the frequency lock status may be stored in a UFS drive.
[0219] Specifically, after determining that the current time meets the frequency modulation period, the DVFS driver can read the frequency lock status in the UFS driver and determine whether the UFS frequency is locked based on the frequency lock status.
[0220] If the UFS frequency point is locked, the frequency adjustment of this frequency modulation cycle can be skipped and the system returns to wait for the next frequency modulation cycle.
[0221] If the UFS frequency is not locked, the window load corresponding to the current moment can be obtained from the OPP device to calculate the current frequency of the UFS device based on the window load, thereby achieving frequency adjustment in this frequency modulation cycle.
[0222] S206 : The DVFS driver obtains the window load corresponding to the current moment from the OPP device.
[0223] S207 : The DVFS driver calculates the current frequency of the UFS device according to the window period load, and sends the current frequency to the UFS driver.
[0224] The specific processing flow of steps S206-S207 is the same as that of steps S104-S105, and will not be repeated here.
[0225] Reference Figure 8 The process of "frequency adjustment under scenario" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0226] S301: The application responds to the user operation and reports the current event to the scene recognition engine.
[0227] The current event may be an event generated by the application in response to a user operation.
[0228] For example, if a user triggers a cold start of an application, the corresponding current event might be creating the main activity. If a user plays a local video, the corresponding current event might be loading UFS data into the decoder. If a user switches game resources, the corresponding current event might be reading data from the UFS to switch screens.
[0229] S302. After receiving the current event, the scene recognition engine determines whether the scene corresponding to the current event is an instantaneous high UFS IO scene; if so, execute S303; if not, end the frequency adjustment.
[0230] Before determining whether the scene corresponding to the current event is an instantaneous high UFS IO scene, the scene recognition engine can divide the scenes corresponding to each event into scenes according to a pre-set scene division rule.
[0231] It is understandable that each event generated in response to a user operation may correspond to a scenario, and each scenario may be divided into an instantaneous high UFS IO scenario or a non-instantaneous high UFS IO scenario.
[0232] For example, assuming that a user triggers a hot start of an application, or the user plays a network video, since the above user operations will not cause a sudden increase in the data throughput demand in the UFS, the scenario corresponding to the current event generated by the electronic device in response to the above user operations can be determined as a non-instantaneous high UFS IO scenario.
[0233] In another example, assuming that the user triggers a hot start of an application, or the user plays a local video, since the above user operations will cause a sudden increase in the data throughput demand in the UFS, the scenario corresponding to the current event generated by the electronic device in response to the above user operations can be determined as an instantaneous high UFS IO scenario.
[0234] It should be noted that there may be many specific implementation methods for "dividing the scenes corresponding to each event into scenes", and this application does not impose any restrictions on this.
[0235] Specifically, after receiving the current event, the scene recognition engine can determine whether the scene corresponding to the current event is an instantaneous high UFS IO scene based on the result of scene division.
[0236] For example, the scene recognition engine pre-classifies the scene corresponding to event A as an instantaneous high UFS IO scene, and the scene corresponding to event B as a non-instantaneous high UFS IO scene.
[0237] Thus, when the scene recognition engine receives event A, it can determine that the scene corresponding to event A is a transient high UFSIO scene. When the scene recognition engine receives event B, it can determine that the scene corresponding to event B is a non-transient high UFSIO scene.
[0238] Specifically, after the scene recognition engine determines that the current event corresponds to a transient high UFS IO scenario, it can send the current event information to the UFS boost module to continue adjusting the UFS frequency. After the scene recognition engine determines that the current event corresponds to a non-transient high UFS IO scenario, it can end the UFS frequency adjustment.
[0239] S303: The scene recognition engine sends current event information to the UFS boost module.
[0240] The current event information may be any information corresponding to the current event.
[0241] Exemplarily, the current event information may include the type of the current event, the module that initiated the current event, the scene corresponding to the current event, and other information, which is not limited in this application.
[0242] Specifically, when the scene recognition engine recognizes that the scene corresponding to the current event is an instantaneous high UFS IO scene, it can determine the current event information and send the current event information to the UFS boost module.
[0243] S304 : The UFS boost module determines a target frequency of the UFS and a frequency locking period corresponding to the target frequency according to the current event information and the current state information.
[0244] The current status information is any information that can currently affect the UFS frequency.
[0245] Exemplarily, the current status information may be information such as the current system load, the current UFS bandwidth usage, etc., which is not limited in this application.
[0246] The UFS boost module can determine the scenario requirements corresponding to the current event based on the current event information.
[0247] The scenario requirement corresponding to the current event may be a throughput requirement for data in the UFS storage device in the scenario corresponding to the current event.
[0248] The UFS boost module can determine the target frequency of UFS and the frequency locking period corresponding to the target frequency based on the scenario requirements corresponding to the current event, the current system load, and the current UFS bandwidth occupancy.
[0249] Specifically, when the UFS boost module determines the frequency locking period corresponding to the target frequency, if the calculated difference between the end time of the frequency locking period and the start time of the next frequency modulation cycle is less than the period length of the frequency modulation cycle, the end time of the frequency locking period can be aligned with the start time of the next frequency modulation cycle, that is, the start time of the next frequency modulation cycle can be determined as the end time of the frequency locking period.
[0250] Reference Figure 13b As shown, assuming that the end time of the frequency locking period calculated by the electronic device is time b, the difference c between time b and the start time of the next frequency modulation cycle (that is, the start time of the i+2th frequency modulation cycle, time t3) is less than the period length of the frequency modulation cycle. At this time, time t3 can be determined as the end time of the frequency locking period.
[0251] It is understandable that if the end time of the frequency lock period calculated by the electronic device is time b, then the UFS will operate at the frequency F from time a to time b. i+1 However, after time b, the frequency of UFS will be adjusted again only at the beginning of the (i+2) FM cycle (i.e., time t3). Therefore, the end time of the frequency locking period can be extended to the beginning time of the next FM cycle.
[0252] It should be noted that, for the relevant processing procedures of "frequency voting and lock-up period voting using the frequency voting model", reference can be made to the existing technology and will not be repeated here.
[0253] For example, the UFS boost module includes a frequency voting model. The UFS boost module can input the scenario requirements corresponding to the current event, the current system load, and the current UFS bandwidth occupancy into the frequency voting model. The frequency voting model can output the target frequency of the UFS and the frequency locking period corresponding to the target frequency.
[0254] S305 , after determining the target frequency of the UFS and the frequency locking period corresponding to the target frequency, the UFS boost module sends the target frequency and the frequency locking period corresponding to the target frequency to the UFS driver.
[0255] S306 : The UFS driver sets the frequency locking state to the locked state at the start of the frequency locking period, and adjusts the UFS frequency to the target frequency.
[0256] S307 : At the end of the frequency locking period, the UFS driver sets the frequency locking state to an unlocked state.
[0257] The start time of the frequency lock period is also the time when the frequency lock begins. The end time of the frequency lock period is also the time when the frequency lock ends.
[0258] After receiving the target frequency and the frequency lock period corresponding to the target frequency, the UFS driver sets the frequency lock state to locked at the start of the frequency lock period and adjusts the UFS frequency to the target frequency. At the end of the frequency lock period, the UFS driver sets the frequency lock state to unlocked.
[0259] The above example illustrates the case where the frequency lock status is stored in the UFS driver. The following example illustrates the case where the frequency lock status is stored in the DVFS driver. Figure 9-10 The figure is a schematic diagram of module interaction of another method for dynamically adjusting frequency.
[0260] Reference Figure 9 The process of "periodic frequency adjustment" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0261] like Figure 9 As shown, steps S401-S403 are the same as steps S201-S203, and steps S405-S407 are the same as steps S205-S207, which will not be repeated here.
[0262] S404: The DVFS driver reads the frequency lock status in the DVFS driver.
[0263] After determining that the current time meets the frequency modulation period, the DVFS driver can directly read the frequency lock status in the DVFS driver to determine whether the UFS frequency is locked based on the frequency lock status.
[0264] Reference Figure 10 The process of "frequency adjustment under scenario" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0265] like Figure 10 As shown, steps S501-S505 are the same as steps S301-S305 and are not described again here.
[0266] S506 : After determining the target frequency of the UFS and the frequency locking period corresponding to the target frequency, the UFS boost module sends the frequency locking period corresponding to the target frequency to the DVFS driver.
[0267] S507 : The UFS driver adjusts the UFS frequency within the frequency locking period to the target frequency.
[0268] After receiving the target frequency and the frequency locking period corresponding to the target frequency, the UFS driver can adjust the UFS frequency to the target frequency within the frequency locking period.
[0269] S508 : The DVFS driver sets the frequency lock state to the locked state at the beginning of the frequency lock period, and sets the frequency lock state to the unlocked state at the end of the frequency lock period.
[0270] The above two specific examples illustrate how the frequency lock status is stored in the UFS driver and the DVFS driver, respectively. In practice, the frequency lock status can also be stored in the UFS boost module. Figure 11-12 The figure is a schematic diagram of module interaction of another method for dynamically adjusting frequency.
[0271] Reference Figure 11 The process of "periodic frequency adjustment" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0272] like Figure 11 As shown, steps S601-S603 are the same as steps S201-S203, and steps S605-S607 are the same as steps S205-S207, which will not be repeated here.
[0273] S604: The DVFS driver reads the frequency lock status in the UFS boost module.
[0274] After determining that the current frequency modulation period is met, the DVFS driver can read the frequency lock status from the UFS boost module to determine whether the UFS frequency is locked based on the frequency lock status.
[0275] Reference Figure 12 The process of "frequency adjustment under scenario" in the dynamic frequency adjustment provided in the embodiment of the present application specifically includes:
[0276] like Figure 12 As shown, steps S701-S705 are the same as steps S301-S305 and are not described again here.
[0277] S706 : The UFS driver adjusts the UFS frequency within the frequency locking period to the target frequency.
[0278] After receiving the target frequency and the frequency locking period corresponding to the target frequency, the UFS driver can adjust the UFS frequency to the target frequency within the frequency locking period.
[0279] S707 : The UFS boost module sets the frequency lock state to a locked state at the beginning of the frequency lock period, and sets the frequency lock state to an unlocked state at the end of the frequency lock period.
[0280] The frequency adjustment and adjustment period in the dynamic frequency adjustment method provided in the embodiment of the present application are described in detail below. Figures 13a-13b : is a schematic diagram showing an exemplary timing relationship of frequency adjustment and adjustment period, wherein the horizontal axis is time T and the vertical axis is UFS frequency point F.
[0281] Figure 13a The embodiment exemplifies the timing relationship between frequency adjustment and adjustment period when an electronic device adjusts the frequency of a UFS based on the DVFS dynamic frequency adjustment method.
[0282] Reference Figure 13a At time t1 (i.e. the start time of the ith frequency modulation cycle), the electronic device adjusts the frequency of UFS to F i , and maintain the frequency F in the i-th frequency modulation cycle i run.
[0283] Assuming that at time a, the electronic device's demand for data throughput in the UFS storage device increases instantaneously, then based on the DVFS dynamic frequency adjustment method, the electronic device can calculate the UFS frequency F at time t2 based on the window period load corresponding to time t2. i+1 , so as to adjust the UFS frequency to F at time t2 i+1 , thus maintaining the frequency F in the i+1th FM cycle i+1 run.
[0284] At time t3, the electronic device calculates the UFS frequency F based on the window load corresponding to time t3. i+2 , so as to adjust the UFS frequency to F at time t3 i+2 , and maintain the frequency F in the i+2th FM cycle i+2 run.
[0285] Figure 13b The embodiment exemplifies the timing relationship between frequency adjustment and adjustment period when an electronic device adjusts the frequency of a UFS based on the dynamic frequency adjustment method provided in the embodiment of the present application.
[0286] Reference Figure 13b At time t1 (i.e. the start time of the ith frequency modulation cycle), the electronic device adjusts the frequency of UFS to F i , and maintain the frequency F in the i-th frequency modulation cycle i run.
[0287] Assuming that at time a, the electronic device's demand for data throughput in the UFS storage device increases instantaneously, then based on the dynamic frequency adjustment method provided in the embodiment of the present application, the electronic device can calculate the UFS frequency F at time a based on the scene requirements, current load, and UFS bandwidth occupancy. i+1 And frequency F i+1 The corresponding frequency locking period (from time a to time t3) is to adjust the UFS frequency to F at time a. i+1 , thus maintaining the frequency F from time a to time t3 i+1 run.
[0288] Based on the dynamic frequency adjustment method provided in the embodiment of the present application, the electronic device determines that the frequency lock state is in the locked state at time t2 (that is, the start time of the i+1th frequency modulation cycle). Then, the electronic device does not adjust the frequency of the UFS at time t2 and waits for the arrival of time t3 (that is, the start time of the i+2th frequency modulation cycle).
[0289] At time t3, the electronic device determines that the frequency point lock state is unlocked, and then calculates the UFS frequency point F according to the window period load corresponding to time t3. i+2 , so as to adjust the UFS frequency to F at time t3 i+2 , and maintain the frequency F in the i+2th FM cycle i+2 run.
[0290] This embodiment further provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the dynamic frequency adjustment method in the above-mentioned embodiment.
[0291] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the dynamic frequency adjustment method in the above-mentioned embodiment.
[0292] 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 to enable the chip to execute the dynamic frequency adjustment method in the above-mentioned method embodiments.
[0293] Among them, the electronic devices (such as mobile phones, etc.), computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0294] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0295] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0296] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for dynamic frequency adjustment, characterized in that: The method comprises: Listen for current events corresponding to user operations; When the scene corresponding to the current event is a target scene, determining a first frequency point of the target device; The frequency of the target device is adjusted according to the first frequency point.
2. The method according to claim 1, characterized in that After determining the first frequency point of the target device, the method further includes: Determining a lockout period corresponding to the first frequency point; According to the locking period, a target state of the target device is determined; wherein the target state is a locking state of the frequency of the target device.
3. The method according to claim 2, characterized in that The method further comprises: When the preset period is satisfied at the current moment, obtaining the target state; When the target state is a first value, obtaining a first load corresponding to the current moment; Calculating a second frequency point of the target device according to the first load; The frequency of the target device is adjusted according to the second frequency point.
4. The method according to claim 3, characterized in that After obtaining the target state, the method further includes: When the target state is the second value, the process returns to executing the process of obtaining the target state when the preset period is satisfied at the current moment.
5. The method according to claim 1, wherein The determining the first frequency point of the target device includes: Determining target requirements corresponding to the current event; According to the target requirement, a first frequency point of the target device is determined.
6. The method according to claim 1, characterized in that The determining the first frequency point of the target device further includes: Determining a target demand corresponding to the current event, a bandwidth occupancy corresponding to the target device, and a second load; Determine a first frequency point of the target device according to the target demand, the bandwidth occupancy, and the second load.
7. The method according to claim 1, 5 or 6, characterized in that The determining the first frequency point of the target device includes: Voting on the frequency of the target device; A first frequency point of the target device is determined according to the first voting result.
8. The method according to claim 2, characterized in that The determining the lock period corresponding to the first frequency point includes: Determining target requirements corresponding to the current event; Determine a lockout period corresponding to the first frequency point according to the target demand.
9. The method according to claim 2, characterized in that The determining of the lock period corresponding to the first frequency point further includes: Determining a target demand corresponding to the current event, a bandwidth occupancy corresponding to the target device, and a second load; Determine a lock period corresponding to the first frequency point according to the target demand, the bandwidth occupancy, and the second load.
10. The method according to claim 2, 8 or 9, characterized in that The determining the lock period corresponding to the first frequency point includes: Voting on a frequency lock period for the target device; A lockout period corresponding to the first frequency point is determined according to the second voting result.
11. The method according to claim 10, characterized in that The determining, based on the second voting result, a lockout period corresponding to the first frequency point further includes: Determining the target period in which the end time of the lock-up period falls, and the end time of the target period; Calculating the difference between the end time of the target period and the end time of the lock period; When the difference is smaller than the period length of the preset period, the end time of the locking period is updated to the end time of the target period.
12. The method according to claim 2, characterized in that Determining the target state of the target device according to the lock period includes: At the start of the lock period, setting the value of the target state to a second value; At the end of the locking period, the value of the target state is set to a first value.
13. The method according to claim 1, wherein The target device is a UFS storage device.
14. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the dynamic frequency adjustment method according to any one of claims 1 to 13.
15. A computer-readable storage medium comprising a computer program, characterized in that When the computer program is executed on an electronic device, the electronic device is enabled to perform the method for dynamically adjusting frequency according to any one of claims 1 to 13.