Resource adjustment method and device

By acquiring performance metrics such as frame latency and frame interval of the camera application, and combining them with CPU and memory load status, the resource allocation strategy is dynamically adjusted, solving the stuttering or frame dropping problem caused by the "one-size-fits-all" approach in the camera application, and achieving more flexible and stable resource management.

CN121785787APending Publication Date: 2026-04-03VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In camera applications, existing technologies rely on static trigger conditions to regulate hardware resources, resulting in a "one-size-fits-all" approach that causes camera application previews to stutter or drop frames.

Method used

By acquiring performance metrics such as frame latency and frame interval in the preview processing flow of the camera application, as well as the load status of the CPU and memory, the resource allocation strategy can be dynamically adjusted to avoid a 'one-size-fits-all' approach and achieve flexible resource allocation.

Benefits of technology

It improves the flexibility of resource allocation strategies during camera applications, avoids preview stuttering or frame drops, and enhances system stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785787A_ABST
    Figure CN121785787A_ABST
Patent Text Reader

Abstract

The invention discloses a resource adjustment method and device, and belongs to the technical field of resource adjustment. The method comprises: obtaining performance indexes of a preview processing flow of a camera application and a load state of an electronic device, the performance indexes at least comprising a frame delay and a frame interval, the frame delay being the time of single-frame preview image data from sensor framing to preview image display, and the frame interval being the time of single-frame preview image data from sensor framing to preview image display; the frame interval refers to the display time interval of two continuous frames of preview images, and the load state comprises at least one of the current load of the central processing unit and the current available memory of the memory; according to the performance index and the load state, resources of the electronic equipment are adjusted, and the resources comprise at least one of the following items: the running frequency of a central processing unit and the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of resource adjustment technology, specifically relating to a resource adjustment method and apparatus. Background Technology

[0002] With the rapid development of mobile technology, people frequently use cameras to record daily life and work. Because camera applications continuously and heavily consume system hardware resources such as the Central Processing Unit (CPU) and memory when processing images, electronic devices may crash due to oversaturation of system hardware resources in complex scenarios where multiple background applications are running in parallel and the system load is heavy. In such situations, the overall stability and energy efficiency of the electronic device can be ensured by adjusting system hardware resources; for example, adjusting the CPU and memory usage can help maintain overall system stability and energy efficiency.

[0003] Currently, the regulation of system hardware resources largely relies on pre-set static triggering conditions. For example, CPU and memory regulation strategies are triggered when the temperature exceeds a certain threshold or the free memory falls below a certain threshold. For instance, when the temperature exceeds a certain threshold, the load of non-core image processing algorithms such as beauty filters or high-resolution modes in camera applications is turned off or reduced to increase the CPU's operating frequency. Or, when the free memory of an electronic device falls below a certain threshold, some application processes are closed to reclaim memory.

[0004] The above-mentioned control of system hardware resources adopts a "one-size-fits-all" approach. If the user is using the camera application, it will turn off or reduce non-core image processing algorithms such as beauty filters or high-resolution modes in the camera application, or close the camera application, which will cause problems such as preview lag or frame drops during use. Summary of the Invention

[0005] The purpose of this application is to provide a resource adjustment method and apparatus that can improve the flexibility of resource adjustment of electronic devices during camera application use, and avoid the problem of preview stuttering or frame dropping caused by the "one-size-fits-all" approach during camera application use.

[0006] In a first aspect, embodiments of this application provide a resource adjustment method, the method comprising: The system acquires performance metrics of the camera application's preview processing flow and the load status of the electronic device. The performance metrics include at least frame latency and frame interval. Frame latency is the time from the sensor outputting a single frame of preview image data to the display of the preview image. Frame interval refers to the display time interval between two consecutive preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. Based on the performance indicators and load status, the resource allocation strategy of the electronic device is adjusted, and the resource allocation strategy includes at least one of the following: the operating frequency of the central processing unit and the memory reclamation threshold.

[0007] Secondly, embodiments of this application provide a resource adjustment device, the device comprising: The acquisition module is used to acquire the performance indicators of the preview processing flow of the camera application and the load status of the electronic device. The performance indicators include at least frame delay and frame interval. The frame delay is the time from the sensor outputting a single frame of preview image data to the display of the preview image. The frame interval refers to the display time interval between two consecutive preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. An adjustment module is used to adjust the resource allocation strategy of the electronic device according to the performance indicators and the load status. The resource allocation strategy includes at least one of the following: the operating frequency of the central processing unit and the memory reclamation threshold.

[0008] Thirdly, embodiments of this application provide an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can run on the processor, and the programs or instructions, when executed by the processor, implement the method as described in the first aspect.

[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the method described in the first aspect.

[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0012] In this embodiment, the resource allocation strategy of the electronic device is adjusted based on the performance metrics of frame latency and frame interval during the preview processing flow of the camera application, as well as the load status of at least one of the central processing unit (CPU) and the currently available memory. Specifically, the resource allocation strategy is adjusted flexibly and in real-time based on the performance metrics used to characterize the preview processing flow of the camera application, such as the time interval between adjacent preview frames and the latency of a single preview frame, along with the load status of at least one of the CPU and the currently available memory. This is unlike a "one-size-fits-all" approach that adjusts the resource allocation strategy based on trigger conditions such as temperature and memory. The solution in this embodiment can dynamically adjust system hardware resources in real-time based on the preview processing flow and the real-time load status of the electronic device. This avoids the "one-size-fits-all" approach that shuts down some processing algorithms or the camera application itself during use, which could lead to preview stuttering or frame drops. The solution in this embodiment improves the flexibility of adjusting the resource allocation strategy of the electronic device during camera application use. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a resource adjustment method provided in some embodiments of this application; Figure 2 This is a flowchart illustrating a resource adjustment method provided in some embodiments of this application; Figure 3 This is a flowchart illustrating a resource adjustment method provided in some embodiments of this application; Figure 4 These are schematic diagrams illustrating the structure of a resource adjustment device according to some embodiments of this application; Figure 5 These are schematic diagrams illustrating the structure of an electronic device according to some embodiments of this application; Figure 6 These are schematic diagrams illustrating the hardware structure of an electronic device according to some embodiments of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or N objects. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0016] The terminology used in the embodiments of this invention will be explained below.

[0017] Interface: Refers to the graphical interactive layer seen by users through the screen of an electronic device. Also known as the "user interface (UI)," it is the medium through which applications or operating systems interact and exchange information with users, converting the internal form of information into a form acceptable to the user. The user interface is source code written in specific computer languages ​​such as Java and XML. This source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements displayed on the screen of an electronic device, such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and web widgets.

[0018] Application: A computer program developed to perform one or more specific tasks and running on an operating system. Applications run in user mode, can interact with the user, and have a visual user interface.

[0019] Photo preview interface: This is the real-time view that the user sees on the device screen before taking a photo. It is a visual interactive area that is rendered in real time after the image data captured by the camera sensor is processed. It can be a GUI, which can display visible interface elements such as buttons, navigation bars, and widgets.

[0020] As described in the background section, traditional solutions rely heavily on pre-set static trigger conditions when regulating system hardware resources, which presents several problems: 1. The system hardware resources are under heavy load, but the static trigger condition has not been met, so the control strategy cannot be executed, resulting in a decrease in the performance of electronic devices. For example, the preset static trigger condition is that the control strategy is triggered when the CPU load reaches 80%. If the CPU load is 78% at this time, the control strategy is not triggered, but the CPU load is still very high, which in turn affects the operation of other applications on the electronic device, and may cause other applications to lag.

[0021] Second, the system's hardware resource control strategy was triggered. However, some applications that were capable of running were restricted due to the control strategy. For example, the pre-set static trigger condition is that the control strategy is triggered when the CPU load reaches 80%. If the CPU load is currently 88%, the control strategy is triggered, turning off the beautification algorithm in the camera application. However, the beautification algorithm can actually run normally under the current load, but it is restricted from running because the control strategy turns it off.

[0022] Third, the control strategies for each hardware resource are triggered and run independently. If the triggering conditions of any strategy are met, the electronic device will not execute any control strategy, which may lead to performance degradation. For example, the CPU, memory, and camera function strategies run independently without information sharing. For instance, if the system triggers memory reclamation due to memory shortage, this will increase the CPU load, but the camera strategy will not be aware of this and will still run the high-load algorithm as originally planned, ultimately leading to a vicious cycle of performance degradation.

[0023] The above solution uses a "one-size-fits-all" approach to regulate system hardware resources, which results in insufficient flexibility in resource allocation and an inability to allocate hardware resources as needed, thus affecting the performance of electronic devices.

[0024] To address the aforementioned problems, this application provides a resource adjustment method and apparatus. By acquiring performance metrics such as frame latency and frame interval during the preview processing flow of a camera application, and the load status of at least one of the following: the current load of the central processing unit (CPU) and the current available memory, the method adjusts a resource allocation strategy in an electronic device, including at least one of the CPU's operating frequency and memory reclamation threshold. Specifically, it adjusts the resource allocation strategy based on performance metrics used to characterize the camera application's preview processing flow, such as the time interval between adjacent preview frames and the latency of a single preview frame, as well as the current load of the CPU and the current available memory. Instead of a "one-size-fits-all" approach that uses static trigger conditions unrelated to camera application usage, this solution allows for flexible and real-time adjustment of electronic device resource allocation strategies based on the preview processing flow and the real-time load status of the electronic device. This avoids the "one-size-fits-all" approach that shuts down some processing algorithms or the camera application itself during use, leading to preview stuttering or frame drops. This solution improves the flexibility of adjusting the electronic device's resource allocation strategy during camera application usage.

[0025] The technical solutions of this application can be applied to scenarios where the allocation strategy of system hardware resources such as CPU and memory of an electronic device is controlled when using a camera application. For example, when a user wants to take a photo using a camera application, after the user opens the camera application, the camera application executes a preview processing flow. During this process, the load status of the electronic device is monitored, and the resource allocation strategy of the electronic device is continuously controlled.

[0026] The resource adjustment method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0027] Figure 1 This is a flowchart illustrating a resource adjustment method provided in an embodiment of this application. The subject executing the resource adjustment method can be an electronic device, which can be, but is not limited to, a personal computer (PC), a smartphone, a tablet computer, or a personal digital assistant (PDA).

[0028] like Figure 1 As shown, the resource adjustment method provided in this application embodiment may include steps 110-120.

[0029] Step 110: Obtain the performance metrics of the camera application's preview processing flow and the load status of the electronic device.

[0030] The preview processing flow of the camera application can be the process by which the camera application processes the preview data when previewing the shooting scene. That is, the preview processing flow starts from acquiring the image data to be captured by the sensor in the camera and continues until the image data is processed to obtain the preview image.

[0031] The specific preview processing flow is as follows: When the camera application is open, the camera will continuously acquire RAW format image data and send this continuously acquired RAW format image data to the Image Signal Processor (ISP) for image processing such as de-mosaicing, white balance calibration, noise reduction, sharpening, and dynamic range optimization to obtain RGB format image data. The RGB format image data is then converted to YUV format image data, and then sent to the image data cache space for caching. The display module of the electronic device can retrieve the cached YUV format image data from the image data cache space in real time, render and display the YUV format image data in real time, so that the preview image can be displayed in real time in the photo preview interface.

[0032] It should be noted that the aforementioned image data cache space can be the memory of an electronic device or the video encoding buffer of an electronic device.

[0033] Performance metrics can include at least frame latency and frame interval. Frame latency refers to the time from when a single frame of preview image data is captured by the sensor to when the preview image is displayed. In other words, for a single frame of image data, the frame latency is the time from when the sensor acquires the RAW format image data until the RAW format image data is rendered and displayed as a preview image. For example, the time from when the first frame of preview image data is acquired to when preview image 1 is generated is the frame latency corresponding to the first frame of preview image data.

[0034] The frame interval mentioned above refers to the time interval between the display of two consecutive preview images. In other words, the frame interval is the interval between the generation and display of preview images from two adjacent frames of preview image data. For example, if the first frame of preview image data generates preview image 1 and the second frame of preview image data generates preview image 2, the time interval between the display of preview image 1 and the display of preview image 2 is the frame interval.

[0035] The load status of an electronic device can be information used to characterize the load situation of the electronic device. For example, the load status of an electronic device can be at least one of the current load of the central processing unit (CPU) and the current available memory of the memory. The current load of the CPU can refer to the current load status of the CPU. The current available memory can refer to the remaining available memory in the current electronic device.

[0036] In this embodiment, frame delay and frame interval are selected as the performance indicators for monitoring because: The core objective of monitoring is to detect whether the system stability of electronic devices is affected by sudden factors, leading to problems that are perceptible to the user. While the number of dropped frames is a key indicator, monitoring the frame interval can effectively capture frame drop issues. Changes in the frame interval directly reflect frame drops caused by latency or resource contention.

[0037] For the preprocessing stage in the preview pipeline, which precedes the acquisition of preview image data, while it might seem that directly monitoring the preprocessing stage would provide more information, the nature of the preview processing pipeline means that the processing of each frame of image data is performed in stages. When a performance bottleneck occurs in the current processing stage, its impact will be reflected in the postprocessing stages of the preceding frames. Therefore, observing frame latency can comprehensively reflect the overall performance of all tasks within this time period.

[0038] Frame latency monitoring provides precise timing for detecting system performance issues, while observing frame intervals helps identify dropped frames that, although not showing a significant change in processing time, still degrade user experience. Therefore, monitoring these two performance metrics allows for a comprehensive understanding of the dynamics affecting user-perceptible problems, enabling timely optimization measures.

[0039] Step 120: Adjust the resource allocation strategy of electronic devices based on performance indicators and load status.

[0040] The resource allocation strategy can be the allocation strategy for system hardware resources in an electronic device, including but not limited to: CPU, GPU, memory, disk, etc. When the system hardware resource is a CPU, the CPU allocation strategy can be the CPU's operating frequency; when the system hardware resource is memory, the memory allocation strategy can be the memory reclamation threshold.

[0041] In some embodiments of this application, when the current available memory reaches a certain threshold, the electronic device will perform memory reclamation, that is, clean up some information in the memory to increase the current available memory. When to perform memory reclamation and when to end memory reclamation is determined according to the preset reclamation threshold. Therefore, when managing memory, it is necessary to adjust the memory reclamation threshold in real time according to the load status of the electronic device and the performance indicators of the preview processing flow.

[0042] The following explanation uses the central processing unit and memory as examples of the aforementioned system hardware resources.

[0043] In some embodiments of this application, step 120 may specifically include: If the performance index is greater than or equal to the preset threshold, the current load is greater than the first load threshold, memory reclamation occurs, and the current available memory is greater than or equal to the first memory threshold, the first preset available memory threshold will be adjusted down to the first available memory threshold.

[0044] The preset thresholds can be pre-set thresholds for performance metrics, with corresponding preset thresholds for frame latency and frame interval. For example, the preset threshold for frame latency can be greater than or equal to 10 microseconds. Similarly, the preset threshold for frame interval can be greater than or equal to 20 microseconds. The specific preset thresholds for frame latency and frame interval can be set according to user needs and are not limited in this embodiment.

[0045] The first load threshold can be a pre-set load threshold for the current load. The value of the first load threshold can be greater than or equal to 90%, for example, the first load threshold can be 90%. The specific value of the first load threshold can be set by the user according to their needs, and is not limited in this embodiment.

[0046] The first memory threshold can be a pre-set threshold for the current available memory. The value of the first memory threshold can be greater than or equal to 200M. For example, the first memory threshold can be 200M. The specific value of the first memory threshold can be set by the user according to their needs. This application embodiment does not limit it.

[0047] The first preset available memory threshold can be a pre-set available memory threshold. Specifically, the first preset available memory threshold can be a pre-set memory threshold that triggers memory reclamation. That is, the first preset available memory threshold is the low value of the memory level. For example, if it is pre-set that memory reclamation can be triggered when the current available memory is lower than 260M, then the first preset available memory threshold is 260M.

[0048] It should be noted that when the available memory of an electronic device falls below the "low" level, an asynchronous fast memory reclamation strategy will be triggered until the available memory returns to the "high" level, which is a pre-set value at which memory reclamation will stop. When the available memory of the electronic device falls below the "min" level, slow reclamation will begin, at which point processes will be terminated.

[0049] The asynchronous recycling strategy described above does not perform process killing or function shutdown, but instead cleans up some information that can be safely released, such as cache files left by closed applications and unnecessary temporary data. For example, if a user is recording a video on an electronic device and the available memory is detected to be below the low value during the recording process, some cache files left after the instant messaging application is closed can be cleaned up.

[0050] The first available memory threshold can be a value obtained by adjusting the first preset available memory threshold downwards. This first available memory threshold can be less than the current available memory. For example, if the current available memory is 220M and the first preset available memory threshold is 260M, if memory reclamation occurs, it means that the current available memory is less than the first preset available memory threshold, triggering memory reclamation. In this case, the first preset available memory threshold can be lowered to a value less than the current available memory, such as 180M, thus skipping the execution of memory reclamation.

[0051] In some embodiments of this application, when the current load exceeds a first load threshold, memory reclamation occurs, and the currently available memory is greater than or equal to the first memory threshold, the first preset available memory threshold can be adjusted to the first available memory threshold. That is, when the current load exceeds the first load threshold, memory reclamation occurs, and the currently available memory is greater than or equal to the first memory threshold, the current load can be left unprocessed; instead, the first preset available memory threshold can be adjusted downwards to the first available memory threshold. This skips memory reclamation, reduces CPU load, and avoids CPU overload that could lead to the shutdown of some functions in the camera application.

[0052] Continuing with the example above, if a user is taking pictures with a camera, the first load threshold is 90%, the current load is 92%, the current available memory is 220MB, and the first preset available memory threshold is 260MB, then the current available memory is less than the first preset available memory threshold, triggering memory reclamation. In this case, instead of adjusting the CPU load, the memory level can be lowered to a value less than the current available memory, such as 180MB. This would skip memory reclamation and reduce the CPU load.

[0053] It should be noted that a performance indicator greater than or equal to a preset threshold can be at least one of frame delay and frame interval being greater than or equal to its corresponding preset threshold.

[0054] In the embodiments of this application, when the performance index is greater than or equal to a preset threshold, the CPU and memory can be adjusted based on the current load and the current available memory. This dynamic adjustment of the CPU and memory based on performance index, current load, and current available memory changes the "one-size-fits-all" control strategy of traditional solutions, improves the flexibility of resource allocation strategy adjustment for system hardware resources, and breaks down information silos between CPU, memory, and camera functions. For example, when the current load exceeds the first load threshold due to memory reclamation, and the current available memory exceeds the first memory threshold, "adjusting the memory level" will be prioritized to suppress reclamation, thereby reducing the CPU burden. This avoids camera stuttering indirectly caused by memory reclamation, demonstrating the synergistic effect of cross-resource management.

[0055] In some embodiments of this application, step 120 may further include: If the performance index is greater than or equal to a preset threshold, and at least one of the current load and the current available memory meets the preset conditions, obtain the current operating frequency of the central processing unit. Adjust the resource allocation strategy for electronic devices based on the current operating frequency; The preset conditions include: The current load is less than or equal to the first load threshold; or, The current load is greater than the first load threshold, memory reclamation is occurring, and the current available memory is less than the first memory threshold; or, The current load is greater than the first load threshold, and there is no memory reclamation.

[0056] The current operating frequency of the central processing unit mentioned above can be the current operating frequency of the CPU.

[0057] In some embodiments of this application, the current operating frequency of the CPU can be predicted by the CPU load under the current time window and the load of the previous time window according to the following formula (1), or it can be predicted by the CPU load under the current time window and the load of the historical time window before the current time window according to the following formula (2).

[0058] The above formula (1) is used to indicate a single processing core of the CPU. In the above formula (1), "current time window load" is the load of a single processing core in the CPU under the current time window, "task running time" is the time spent by the task running on the single processing core, "current time window" is the time of the current time window, the CPU coefficient is the coefficient of the single processing core, "current running frequency" is the current running frequency of the single processing core, and "maximum running frequency" is the maximum running frequency of the single processing core.

[0059] It should be noted that each processing core in a CPU has a corresponding coefficient, and the coefficient of a processing core is related to the processing power of that processing core.

[0060] In the above formula (2), This refers to the CPU load during historical time windows prior to the current time window. The previous time window of the current time window. It is a constant. This represents the CPU load during the current time window.

[0061] In some embodiments of this application, when the current load is less than or equal to a first load threshold, the operating frequency of the central processing unit and the memory reclamation threshold can be adjusted by obtaining the current operating frequency of the central processing unit.

[0062] In other words, if the current load is greater than the first load threshold, memory reclamation is occurring, and the current available memory is less than the first memory threshold (meaning that although memory reclamation has been triggered, the current available memory is not too small), the CPU's operating frequency and the memory reclamation threshold can be adjusted by obtaining the CPU's current operating frequency.

[0063] When the current load exceeds the first load threshold and there is no memory reclamation, that is, when the CPU load is too high but the available memory does not trigger memory reclamation, the CPU's operating frequency and memory reclamation threshold can be adjusted by obtaining the CPU's current operating frequency.

[0064] The specific details of how the resource allocation strategy of the electronic device is adjusted by obtaining the current operating frequency of the central processing unit will be described in more detail in the following embodiments.

[0065] In the embodiments of this application, when the performance index is greater than or equal to a preset threshold, and at least one of the current load and the current available memory meets the preset conditions, the resource allocation strategy of the electronic device can be adjusted by the current operating frequency of the central processing unit. This dynamic adjustment of the resource allocation strategy of the electronic device based on the current operating frequency of the central processing unit changes the "one-size-fits-all" control strategy in the traditional solution and improves the flexibility of resource allocation strategy adjustment.

[0066] In some embodiments of this application, adjusting the resource allocation strategy of the electronic device based on the current operating frequency may specifically include: If the current operating frequency is greater than or equal to the preset frequency threshold, the first application function in the camera application vehicle will be turned off according to the priority of each application function in the camera application vehicle. If the current operating frequency is lower than the preset frequency threshold, increase the current operating frequency.

[0067] The preset frequency threshold can be a pre-set threshold for the current operating frequency of the CPU. The value of the preset frequency threshold can be greater than or equal to 100MHz. For example, the preset frequency threshold can be 100MHz. The specific value of the preset frequency threshold can be set by the user according to their needs, and is not limited in this embodiment.

[0068] The first application function can be an application function in the camera application. This first application function can be an application function in the camera application with low priority and high load, such as the beauty function in the camera application.

[0069] In some embodiments of this application, when the current operating frequency is greater than or equal to a preset frequency threshold, the first application function in the camera application with low priority and high load can be turned off according to the priority of each application function in the camera application.

[0070] It should be noted that when shutting down application functions, applications with lower priority should be shut down first, and if the priorities are the same, applications with higher load should be shut down first.

[0071] Continuing with the example above, assuming the CPU's current operating frequency is 150MHz and the preset frequency threshold is 100MHz, the camera application includes beautification and filter functions. Users prioritize the beautification function, therefore, it has higher priority than the filter function. When the current load is less than or equal to the first load threshold; or when the current load is greater than the first load threshold, memory reclamation is occurring, and the currently available memory is less than the first memory threshold; or when the current load is greater than the first load threshold and memory reclamation is not occurring, and the CPU's current operating frequency is found to be 150MHz, which is greater than the preset frequency threshold, the filter function can be disabled to reduce CPU load.

[0072] In some embodiments of this application, the current operating frequency can be increased when the current operating frequency is less than a preset frequency threshold.

[0073] Continuing with the example above, let's take a CPU with a current operating frequency of 90MHz and a preset frequency threshold of 100MHz as an example. If the current load is less than or equal to the first load threshold; or, if the current load is greater than the first load threshold, memory reclamation is occurring, and the currently available memory is less than the first memory threshold; or, if the current load is greater than the first load threshold, and there is no memory reclamation, and the CPU's current operating frequency is found to be 90MHz, then the CPU's current operating frequency is below the preset frequency threshold. This indicates that the CPU's current operating frequency can be increased. Therefore, the CPU's current operating frequency can be increased without disabling any application functions.

[0074] In the embodiments of this application, when the current operating frequency is greater than or equal to a preset frequency threshold, the CPU load can be reduced from the source by disabling the first application function in the camera application, thus preventing CPU overload from affecting the use of the camera application. When the current operating frequency is less than the preset frequency threshold, the camera application can be run by simply increasing the frequency. In this way, even if the CPU load is too high, as long as the current operating frequency is less than the preset frequency threshold, the camera application can run smoothly simply by increasing the frequency, because no modification to any function configuration of the camera application is required, so it will not affect image quality.

[0075] As described above, when performance indicators are greater than or equal to a preset threshold, the resource allocation strategy of electronic devices can be adjusted according to a negative feedback control strategy. Here, the negative feedback control strategy means that if the current load is light, simply increasing the CPU's operating frequency is sufficient; if the load is heavy, it is determined whether memory reclamation can reduce the load. If so, the CPU's operating frequency is simply increased; if not, some application functions need to be disabled.

[0076] In some embodiments of this application, when performance indicators are less than a preset threshold, the system hardware resources of the electronic device can be adjusted according to a positive feedback control strategy. This positive feedback control strategy is the opposite of the negative feedback strategy; that is, when the current load is not under pressure, memory reclamation and restoration of closed application functions are increased, and if there is still spare memory, the frequency is reduced to optimize power consumption.

[0077] The positive feedback control strategy will be explained in detail below: Specifically, step 120 may include: If the performance index is less than the preset threshold, the current load is less than the first load threshold, and the current available memory is less than the second memory threshold, the first preset available memory threshold will be adjusted upward to the second available memory threshold, and the second preset available memory threshold will be adjusted upward to the third available memory threshold. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, the second application function is restored according to the priority of each application function in the camera application. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there is no recoverable application functionality in the electronic device, reduce the current operating frequency of the central processing unit.

[0078] The second memory threshold can be a pre-set threshold for the current available memory. The value of the second memory threshold can be less than or equal to 100M. For example, the value of the second memory threshold can be 100M. The specific value of the second memory threshold can be set by the user according to their needs. This application embodiment does not limit it.

[0079] It should be noted that the second memory threshold can be smaller than the first memory threshold mentioned above.

[0080] The second available memory threshold can be an upward adjustment of the first preset available memory threshold, and this second available memory threshold can be greater than the current available memory. For example, if the current available memory is 220M and the first preset available memory threshold is 150M, the current available memory is greater than the first preset available memory threshold, and memory reclamation has not been triggered. In this case, the first preset available memory threshold can be increased to a value greater than the current available memory, such as 260M, which will trigger memory reclamation and accelerate memory reclamation.

[0081] The second preset available memory threshold can be a pre-set available memory threshold. Specifically, the second preset available memory threshold can be a pre-set memory threshold for stopping memory reclamation. That is, the second preset available memory threshold is the memory water level high value. For example, if it is pre-set that memory reclamation can be stopped when the current available memory is higher than 400M, then the second preset available memory threshold is 400M.

[0082] The third available memory threshold can be the value obtained by adjusting the second preset available memory threshold upwards. For example, if the current available memory is 220M, the first preset available memory threshold is 150M, and the second preset available memory threshold is 400M, and the current available memory is greater than the first preset available memory threshold, memory reclamation is not triggered. In this case, the first preset available memory threshold can be increased to a value greater than the current available memory, such as 260M, and the second preset available memory threshold can also be increased. This will allow more memory to be reclaimed and accelerate memory reclamation.

[0083] The second application function can be a previously closed application function that needs to be restored. For example, if the beauty function in the camera application was previously turned off, then the second application function can be the beauty function.

[0084] In some embodiments of this application, when the current load is less than a first load threshold and the current available memory is less than a second memory threshold, the first preset available memory threshold can be adjusted upward to the second available memory threshold, and the second preset available memory threshold can be adjusted upward to the third available memory threshold. That is, when the current CPU load is light, memory reclamation can be increased to regulate memory.

[0085] If the current load is less than the first load threshold, the available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, the second application function will be restored according to the priority of each application function in the camera application. In other words, under light load conditions and with recoverable application functions available, the disabled second application function can be restored.

[0086] It should be noted that when restoring a second application function, applications with higher priority and lower load are restored first. That is, when restoring application functions, applications with higher priority are restored first, and if the priorities are the same, applications with lower load are restored first.

[0087] When the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are no recoverable application functions in the electronic device, the current operating frequency of the central processing unit can be reduced. In other words, when the load is light and there is still a margin, power consumption can be optimized by reducing the current operating frequency of the central processing unit.

[0088] In the embodiments of this application, when the performance index is less than a preset threshold, the central processing unit and memory can be adjusted by the current load and the current available memory. In this way, the central processing unit and memory can be dynamically adjusted by the performance index, the current load and the current available memory, which changes the "one-size-fits-all" control strategy in the traditional solution, improves the flexibility of system hardware resource adjustment, and breaks down the information silos between CPU, memory and camera functions.

[0089] To better understand the solutions of the embodiments of this application, the resource adjustment method provided by the embodiments of this application is described in detail below, specifically the process of executing a negative feedback strategy when the performance index is greater than or equal to a preset threshold.

[0090] refer to Figure 2 , Figure 2 A flowchart illustrating the resource adjustment method, such as... Figure 2 As shown, the resource adjustment method may include steps 21-29.

[0091] Step 21: Obtain the performance metrics of the camera application's preview processing flow and the load status of the electronic device.

[0092] Step 21 is the same as step 110 in the above embodiment, and will not be described again here.

[0093] Step 22: Determine whether the performance index is greater than or equal to the preset threshold. If not, return to step 21; if yes, proceed to step 23.

[0094] In step 22, if the performance index is less than a preset threshold, the performance index of the camera application preview process can be continuously monitored.

[0095] Step 23: Determine whether the current CPU load is greater than the first load threshold. If yes, proceed to step 24; otherwise, proceed to step 27.

[0096] Step 24: Determine if memory reclamation exists. If yes, proceed to step 25; otherwise, proceed to step 27.

[0097] Step 25: Determine whether the current available memory is greater than the first memory threshold. If yes, proceed to step 26; otherwise, proceed to step 27.

[0098] Step 26: Adjust the first preset available memory threshold downwards to the first available memory threshold.

[0099] Step 27: Determine whether the current operating frequency of the CPU is greater than or equal to the preset frequency threshold. If yes, proceed to step 28; otherwise, proceed to step 29.

[0100] Step 28: According to the priority of each application function in the camera application, turn off the first application function in the camera application.

[0101] Step 29: Increase the current operating frequency.

[0102] To better understand the solutions of the embodiments of this application, the resource adjustment method provided by the embodiments of this application is described in detail below, specifically the process of executing a positive feedback strategy when the performance index is less than a preset threshold.

[0103] refer to Figure 3 , Figure 3 A flowchart illustrating the resource adjustment method, such as... Figure 3 As shown, the resource adjustment method may include steps 31-38.

[0104] Step 31: Obtain the performance metrics of the camera application's preview processing flow and the load status of the electronic device.

[0105] Step 31 is the same as step 110 in the above embodiment, and will not be described again here.

[0106] Step 32: Determine whether the performance index is greater than or equal to the preset threshold. If not, return to step 31; if yes, proceed to step 33.

[0107] In step 32, if the performance index is less than a preset threshold, the performance index of the camera application preview process can be continuously monitored.

[0108] Step 33: Determine whether the current CPU load is greater than the first load threshold. If yes, return to step 31; otherwise, proceed to step 34.

[0109] Step 34: Determine whether the current available memory is greater than the second memory threshold. If yes, proceed to step 35; otherwise, proceed to step 36.

[0110] Step 35: Adjust the first preset available memory threshold upward to the second available memory threshold, and adjust the second preset available memory threshold upward to the third available memory threshold.

[0111] Step 36: Determine if there is a recoverable application function. If yes, proceed to step 37; otherwise, proceed to step 38.

[0112] Step 37: Restore the second application function according to the priority of each application function in the camera application.

[0113] Step 38: Reduce the current operating frequency of the CPU.

[0114] The resource adjustment method provided in this application can be executed by a resource adjustment device. This application uses the example of a resource adjustment device executing the resource adjustment method to illustrate the resource adjustment device provided in this application.

[0115] Figure 4 This is a schematic diagram illustrating the structure of a resource adjustment device according to an exemplary embodiment. Figure 4 As shown, the resource adjustment device 400 may include: The acquisition module 410 is used to acquire the performance indicators of the preview processing flow of the camera application and the load status of the electronic device. The performance indicators include at least frame delay and frame interval. The frame delay is the time from the sensor to the display of a single frame of preview image data. The frame interval refers to the display time interval between two consecutive frames of preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. The adjustment module 420 is used to adjust the resource allocation strategy of the electronic device according to the performance indicators and the load status.

[0116] In this embodiment, the resource allocation strategy of the electronic device is adjusted based on the performance metrics of frame latency and frame interval during the preview processing flow of the camera application, as well as the load status of at least one of the central processing unit (CPU) and the currently available memory. Specifically, the resource allocation strategy is adjusted flexibly and in real-time based on the performance metrics used to characterize the preview processing flow of the camera application, such as the time interval between adjacent preview frames and the latency of a single preview frame, and the load status of at least one of the CPU and the currently available memory. This is unlike a one-size-fits-all approach based on triggering conditions such as temperature and memory usage. The solution in this embodiment can dynamically adjust system hardware resources in real-time based on the preview processing flow and the real-time load status of the electronic device. This avoids the "one-size-fits-all" approach that shuts down some processing algorithms or the camera application itself during use, which could lead to preview stuttering or frame drops. The solution in this embodiment improves the flexibility of adjusting the resource allocation strategy of the electronic device during camera application use.

[0117] In some embodiments of this application, the adjustment module is specifically used for: If the performance index is greater than or equal to a preset threshold, the current load is greater than a first load threshold, memory reclamation occurs, and the current available memory is greater than or equal to a first memory threshold, the first preset available memory threshold is adjusted downward to the first available memory threshold, where the first available memory threshold is less than the current available memory. The first preset available memory threshold is a preset memory threshold that triggers memory reclamation.

[0118] In some embodiments of this application, the adjustment module is specifically used for: If the performance index is greater than or equal to a preset threshold, and at least one of the current load and the current available memory meets a preset condition, the current operating frequency of the central processing unit is obtained, and the central processing unit and the memory are adjusted according to the current operating frequency. The preset conditions include: The current load is less than or equal to the first load threshold; or, The current load is greater than the first load threshold, memory reclamation is occurring, and the current available memory is less than the first memory threshold; or, The current load is greater than the first load threshold, and there is no memory reclamation.

[0119] In some embodiments of this application, the adjustment module is specifically used for: If the current operating frequency is greater than or equal to a preset frequency threshold, the first application function in the camera application is turned off according to the priority of each application function in the camera application. If the current operating frequency is less than the preset frequency threshold, the current operating frequency is increased.

[0120] In some embodiments of this application, the adjustment module is specifically used for: If the performance index is less than a preset threshold, the current load is less than a first load threshold, and the current available memory is less than a second memory threshold, the first preset available memory threshold is adjusted upward to the second available memory threshold, and the second preset available memory threshold is adjusted upward to the third available memory threshold. The second available memory threshold is greater than the current available memory. The first preset available memory threshold is a preset memory threshold for triggering memory reclamation, and the second preset available memory threshold is a preset memory threshold for stopping memory reclamation. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, the second application function is restored according to the priority of each application function in the camera application. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there is no recoverable application function in the electronic device, the current operating frequency of the central processing unit shall be reduced.

[0121] The resource adjustment device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0122] The resource adjustment device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0123] The resource adjustment device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0124] Optionally, such as Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501 and a memory 502. The memory 502 stores a program or instructions that can run on the processor 501. When the program or instructions are executed by the processor 501, they implement the various steps of the above-described resource adjustment method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0125] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0126] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0127] The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.

[0128] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0129] The processor 610 is used to acquire performance metrics of the preview processing flow of the camera application and the load status of the electronic device. The performance metrics include at least frame latency and frame interval. The frame latency is the time from the sensor outputting a single frame of preview image data to the display of the preview image. The frame interval is the display time interval between two consecutive preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. Based on the performance metrics and the load status, the processor adjusts the resource allocation strategy of the electronic device. The resource allocation strategy includes at least one of the following: the operating frequency of the central processing unit and the memory reclamation threshold.

[0130] In this embodiment, the resource allocation strategy of the electronic device is adjusted based on the performance metrics of frame latency and frame interval during the preview processing flow of the camera application, as well as the load status of at least one of the central processing unit (CPU) and the currently available memory. Specifically, the resource allocation strategy is adjusted flexibly and in real-time based on the performance metrics used to characterize the preview processing flow of the camera application, such as the time interval between adjacent preview frames and the latency of a single preview frame, and the load status of at least one of the CPU and the currently available memory. This is unlike a one-size-fits-all approach based on triggering conditions such as temperature and memory usage. The solution in this embodiment can dynamically adjust system hardware resources in real-time based on the preview processing flow and the real-time load status of the electronic device. This avoids the "one-size-fits-all" approach that shuts down some processing algorithms or the camera application itself during use, which could lead to preview stuttering or frame drops. The solution in this embodiment improves the flexibility of adjusting the resource allocation strategy of the electronic device during camera application use.

[0131] Optionally, the processor 610 is configured to, when the performance index is greater than or equal to a preset threshold, the current load is greater than a first load threshold, memory reclamation occurs, and the current available memory is greater than or equal to a first memory threshold, adjust the first preset available memory threshold downward to a first available memory threshold, wherein the first available memory threshold is less than the current available memory, and the first preset available memory threshold is a preset memory threshold for triggering memory reclamation.

[0132] Optionally, the processor 610 is configured to, when the performance index is greater than or equal to a preset threshold and at least one of the current load and the currently available memory satisfies a preset condition, obtain the current operating frequency of the central processing unit and adjust the resource allocation strategy of the electronic device according to the current operating frequency; the preset condition includes: the current load is less than or equal to a first load threshold; or, the current load is greater than the first load threshold and memory reclamation occurs, and the currently available memory is less than the first memory threshold; or, the current load is greater than the first load threshold and memory reclamation does not occur.

[0133] Optionally, the processor 610 is configured to, when the current operating frequency is greater than or equal to a preset frequency threshold, close the first application function in the camera application according to the priority of each application function in the camera application; and when the current operating frequency is less than the preset frequency threshold, increase the current operating frequency.

[0134] Optionally, the processor 610 is configured to, when the performance index is less than a preset threshold, the current load is less than a first load threshold, and the current available memory is less than a second memory threshold, adjust the first preset available memory threshold upward to the second available memory threshold, and the second preset available memory threshold upward to the third available memory threshold, wherein the second available memory threshold is greater than the current available memory, the first preset available memory threshold is a preset memory threshold for triggering memory reclamation, and the second preset available memory threshold is a preset memory threshold for stopping memory reclamation; when the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, restore the second application function according to the priority of each application function in the camera application; when the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are no recoverable application functions in the electronic device, reduce the current operating frequency of the central processing unit.

[0135] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes image data of still images or videos obtained by an image capture device (such as a color camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0136] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0137] Processor 610 may include one or more processing units; optionally, processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.

[0138] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described resource adjustment method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0139] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0140] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above resource adjustment method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0141] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0142] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the resource adjustment method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0143] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0145] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A resource adjustment method, characterized in that, The method includes: The system acquires performance metrics of the camera application's preview processing flow and the load status of the electronic device. The performance metrics include at least frame latency and frame interval. Frame latency is the time from the sensor outputting a single frame of preview image data to the display of the preview image. Frame interval refers to the display time interval between two consecutive preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. Based on the performance indicators and the load status, the resource allocation strategy of the electronic device is adjusted, and the resource allocation strategy includes at least one of the following: the operating frequency of the central processing unit and the memory reclamation threshold.

2. The method according to claim 1, characterized in that, The adjustment of the resource allocation strategy for the electronic device based on the performance indicators and the load status includes: If the performance index is greater than or equal to a preset threshold, the current load is greater than a first load threshold, memory reclamation occurs, and the current available memory is greater than or equal to a first memory threshold, the first preset available memory threshold is adjusted downward to the first available memory threshold, where the first available memory threshold is less than the current available memory. The first preset available memory threshold is a preset memory threshold that triggers memory reclamation.

3. The method according to claim 1, characterized in that, The adjustment of the resource allocation strategy for the electronic device based on the performance indicators and the load status includes: If the performance index is greater than or equal to a preset threshold, and at least one of the current load and the current available memory meets a preset condition, the current operating frequency of the central processing unit is obtained. Adjust the resource allocation strategy of the electronic equipment according to the current operating frequency; The preset conditions include: The current load is less than or equal to the first load threshold; or, The current load is greater than the first load threshold, memory reclamation is occurring, and the current available memory is less than the first memory threshold; or, The current load is greater than the first load threshold, and there is no memory reclamation.

4. The method according to claim 3, characterized in that, The adjustment of the resource allocation strategy for electronic devices based on the current operating frequency includes: If the current operating frequency is greater than or equal to a preset frequency threshold, the first application function in the camera application is turned off according to the priority of each application function in the camera application. If the current operating frequency is less than the preset frequency threshold, the current operating frequency is increased.

5. The method according to claim 2, characterized in that, The adjustment of the resource allocation strategy for the electronic device based on the performance indicators and the load status includes: If the performance index is less than a preset threshold, the current load is less than a first load threshold, and the current available memory is less than a second memory threshold, the first preset available memory threshold is adjusted upward to the second available memory threshold, and the second preset available memory threshold is adjusted upward to the third available memory threshold. The second available memory threshold is greater than the current available memory. The first preset available memory threshold is a preset memory threshold for triggering memory reclamation, and the second preset available memory threshold is a preset memory threshold for stopping memory reclamation. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, the second application function is restored according to the priority of each application function in the camera application. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there is no recoverable application function in the electronic device, the current operating frequency of the central processing unit shall be reduced.

6. A resource adjustment device, characterized in that, The device includes: The acquisition module is used to acquire the performance indicators of the preview processing flow of the camera application and the load status of the electronic device. The performance indicators include at least frame delay and frame interval. The frame delay is the time from the sensor outputting a single frame of preview image data to the display of the preview image. The frame interval refers to the display time interval between two consecutive preview images. The load status includes at least one of the current load of the central processing unit and the current available memory of the memory. An adjustment module is used to adjust the resource allocation strategy of the electronic device according to the performance indicators and the load status. The resource allocation strategy includes at least one of the following: the operating frequency of the central processing unit and the memory reclamation threshold.

7. The apparatus according to claim 6, characterized in that, The adjustment module is specifically used for: If the performance index is greater than or equal to a preset threshold, the current load is greater than a first load threshold, memory reclamation occurs, and the current available memory is greater than or equal to a first memory threshold, the first preset available memory threshold is adjusted downward to the first available memory threshold, where the first available memory threshold is less than the current available memory. The first preset available memory threshold is a preset memory threshold that triggers memory reclamation.

8. The apparatus according to claim 6, characterized in that, The adjustment module is specifically used for: If the performance index is greater than or equal to a preset threshold, and at least one of the current load and the current available memory meets a preset condition, the current operating frequency of the central processing unit is obtained. Adjust the resource allocation strategy of the electronic equipment according to the current operating frequency; The preset conditions include: The current load is less than or equal to the first load threshold; or, The current load is greater than the first load threshold, memory reclamation is occurring, and the current available memory is less than the first memory threshold; or, The current load is greater than the first load threshold, and there is no memory reclamation.

9. The apparatus according to claim 8, characterized in that, The adjustment module is specifically used for: If the current operating frequency is greater than or equal to a preset frequency threshold, the first application function in the camera application is turned off according to the priority of each application function in the camera application. If the current operating frequency is less than the preset frequency threshold, the current operating frequency is increased.

10. The apparatus according to claim 7, characterized in that, The adjustment module is specifically used for: If the performance index is less than a preset threshold, the current load is less than a first load threshold, and the current available memory is less than a second memory threshold, the first preset available memory threshold is adjusted upward to the second available memory threshold, and the second preset available memory threshold is adjusted upward to the third available memory threshold. The second available memory threshold is greater than the current available memory. The first preset available memory threshold is a preset memory threshold for triggering memory reclamation, and the second preset available memory threshold is a preset memory threshold for stopping memory reclamation. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there are recoverable application functions in the electronic device, the second application function is restored according to the priority of each application function in the camera application. If the current load is less than the first load threshold, the current available memory is greater than or equal to the second memory threshold, and there is no recoverable application function in the electronic device, the current operating frequency of the central processing unit shall be reduced.