Cache resource adjustment method and apparatus, and electronic device and readable storage medium

By obtaining and adjusting the cache resources related to the running status of the application process in real time, the problem of lag in the operation of electronic devices is solved, and the reasonable allocation of storage resources and the improvement of fluency are achieved.

WO2024222606A1PCT designated stage expired Publication Date: 2024-10-31VIVO MOBILE COMM CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/089020
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2024-04-22
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

In the existing technology, electronic devices are prone to improper allocation of cache resources during operation, resulting in lags in operation.

Method used

By obtaining the running status of the application process in real time, determining its corresponding running level, and adjusting cache resources according to the cache parameter information associated with different levels, flexible allocation of storage resources is achieved.

Benefits of technology

It improves the running smoothness of electronic devices, ensures that application processes maintain high performance during periods of high resource demand, and avoids taking up too many storage resources when resource demand is low, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024089020_31102024_PF_FP_ABST
    Figure CN2024089020_31102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a cache resource adjustment method and apparatus, and an electronic device and a readable storage medium. The cache resource adjustment method comprises: acquiring a running state of an application process; when the running state of the application process changes, determining, according to the current running state of the application process, a first running level corresponding to the application process, wherein different running levels are associated with different cache parameter information; and adjusting the current cache resource of the application process according to cache parameter information associated with the first running level.
Need to check novelty before this filing date? Find Prior Art

Description

Cache resource adjustment method, device, electronic device and readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202310478010.5 filed in China on April 27, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present application belongs to the technical field of storage resource management, and specifically relates to a cache resource adjustment method, device, electronic device and readable storage medium. Background Art

[0004] With the continuous upgrading and development of operating systems installed in electronic devices, electronic devices are able to provide more and more application functions, bringing convenience to users of electronic devices.

[0005] When a user uses an electronic device, the operating system needs to establish one or more application processes. Each application process has pre-set cache parameters. The operating system can obtain the cache parameters and corresponding storage resources from the electronic device's storage resources as cache resources for the application process, which are used to store the cache. However, the method of providing cache resources to application processes in related technologies can easily cause the electronic device to lag.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide a cache resource adjustment method, device, electronic device, and readable storage medium, which can improve the operating fluency of electronic devices.

[0008] In a first aspect, an embodiment of the present application provides a cache resource adjustment method, the method comprising:

[0009] Get the running status of the application process;

[0010] In the case where the running state of the application process changes, determining a first running level corresponding to the application process according to the current running state of the application process, wherein different running levels are associated with different cache parameter information;

[0011] Adjust the current cache resources of the application process according to the cache parameter information associated with the first operating level.

[0012] In a second aspect, an embodiment of the present application provides a device for adjusting cache resources, the device comprising:

[0013] The acquisition module is used to obtain the running status of the application process;

[0014] a processing module, configured to determine, when the running state of the application process changes, a first running level corresponding to the application process according to the current running state of the application process, wherein different running levels are associated with different cache parameter information;

[0015] The adjustment module is used to adjust the current cache resources of the application process according to the cache parameter information associated with the first operating level.

[0016] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0018] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.

[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.

[0020] In an embodiment of the present application, by obtaining the running status of an application process, it is possible to understand in real time whether the running status of the application process in the electronic device has changed. If the running status of the application process has changed, the first running level corresponding to the changed running status of the application process can be promptly determined. Because different running levels are associated with different cache parameters, the current cache resources of the application process can then be adjusted based on the cache parameters associated with the first running level. In this way, during the operation of the application process, by analyzing the running status of the application process, the cache resources provided to the application process can be flexibly adjusted, thereby achieving a reasonable allocation of storage resources in the electronic device and effectively improving the operational smoothness of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is a flow chart of a cache resource adjustment method provided in an embodiment of the present application;

[0022] FIG2 is a schematic structural diagram of a video shooting device provided in an embodiment of the present application;

[0023] FIG3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0024] FIG4 is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0026] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0027] With the continuous upgrading and development of operating systems installed in electronic devices, electronic devices are able to provide more and more application functions, bringing convenience to users of electronic devices.

[0028] When a user uses an electronic device, the operating system needs to establish one or more application processes. Each application process has corresponding cache parameters. The operating system can obtain the cache parameters and the corresponding storage resources from the electronic device's storage resources as cache resources for the application process, which are used to store the cache. However, the method of providing cache resources to application processes in related technologies can easily cause the electronic device to lag.

[0029] In response to the problems existing in the related art, the embodiments of the present application provide a cache resource adjustment method, device, electronic device and readable storage medium, which can reasonably adjust cache parameters and improve the operating smoothness of electronic devices.

[0030] The cache resource adjustment method, device, electronic device, and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0031] The following first introduces the cache resource adjustment method provided by the embodiment of the present application in conjunction with Figure 1. The execution subject of the cache resource adjustment method can be an electronic device configured with an operating system or a virtual machine configured with an operating system. Among them, the operating system can be, for example, the Android operating system, the iOS operating system, etc., the electronic device can be, for example, a mobile phone, a tablet computer, a laptop computer, a PDA, or an ultra-mobile personal computer (UMPC), etc., and the non-mobile electronic device can be, for example, a server, a network attached storage (NAS), or a personal computer (PC), etc.

[0032] FIG1 is a flow chart of a cache resource adjustment method provided by an embodiment of the present application. Referring to FIG1 , the cache resource adjustment method may include steps 110 to 130 .

[0033] Step 110: Obtain the running status of the application process.

[0034] Step 120 : When the running state of the application process changes, determine the first running level corresponding to the application process according to the changed running state of the application process.

[0035] Different operating levels are associated with different cache parameter information.

[0036] Step 130: Adjust the cache resources of the application process according to the cache parameter information associated with the first operating level.

[0037] The above steps are described in detail below.

[0038] First, regarding step 110, the application process can be a resident process or a non-resident process in the operating system. A resident process, such as the init process, is typically essential for normal operation. A non-resident process can be an application process launched in response to a user's application (APP), such as a browser, audio player, social networking, or online shopping application.

[0039] System developers can pre-set application process cache parameters. When a process starts, cache resources are provided to the application process based on the pre-set cache parameters. Resident processes are typically essential for normal operation. Optionally, to prevent resident process errors, cache parameters can be set to be immutable. While non-resident processes are running, the operating system can detect the operating status of the non-resident system and adjust the cache resource information for the application process based on that status.

[0040] Exemplarily, the running status can be determined based on the output information generated by the application process, wherein the output information generated by the application process can enable the user to perceive that the application is running. Exemplarily, the output information may include at least one of sound information, display information, vibration information, and temperature information, wherein different output information may correspond to different running statuses, and different output information may also correspond to the same running status.

[0041] Because the user can perceive that the application is running when the application process generates output information, the application process can be said to be in a visible state during the process of generating output information. In other words, the visible state of an application process during operation means that the user can perceive that the application is running. An application process can also be in an invisible state, which means that the user cannot perceive that the application is running. For example, a user can actively terminate an application. In this case, the application process corresponding to the application is in a stopped state. After the application process is terminated, the user cannot perceive that the application is running. In this case, the running level can be adjusted to the lowest running level.

[0042] In some embodiments, the operating system can determine the running state of an application process based on a detection point in the call path of the application's corresponding running data. For example, a detection point can be added to the call path of the running data corresponding to each visible state. The operating system can determine the running state of the application process based on the call status of the detection path. If the detection path is called, the running state of the application process changes.

[0043] Regarding the above step 120 , the running level corresponding to the running state can be pre-set according to the output information corresponding to each running state, and the number of running levels of the application process can be pre-set to one or more.

[0044] Taking the application process corresponding to an audio playback application as an example, the output information of the audio playback application during operation includes displaying the application interface of the audio playback application, playing audio data, switching audio data, pausing audio data, etc. Specifically, the operation level corresponding to displaying the application interface and playing audio data simultaneously can be set to the first level, the operation level corresponding to playing audio data can be set to the second level, switching audio data can be set to the third level, and pausing audio data can be set to the third level, where the first level is the highest operation level, and the second and third levels are the lower operation levels in turn.

[0045] In some embodiments, different operating levels are associated with different cache parameter information. Specifically, the cache parameter may include at least one of cache space, cache clearing cycle, and cache clearing ratio, and the cache parameter information is the size of the cache parameter.

[0046] In one optional example, different operating levels may correspond to different cache sizes, different operating levels may correspond to different cache purge periods, and different operating levels may correspond to different cache purge ratios. In another optional example, corresponding to the same level, only one of the cache size, cache purge period, and cache purge ratio parameters may be adjusted, or any two of the cache size, cache purge period, and cache purge ratio parameters may be adjusted simultaneously, or all three parameters may be adjusted simultaneously.

[0047] Based on the embodiments of the present application, cache parameters for adjusting cache resources provided to an application process can be conveniently determined during the operation of the application process, so as to flexibly adjust the cache resources provided to the application process during the life cycle of the application process.

[0048] When the operating system detects a change in the running state of an application process, it can determine the running level corresponding to the current application process based on the running state of the current application process, namely, the first running level. Since different running levels are associated with different cache parameters, the cache parameters associated with the first running level can then be used as a basis for adjusting the cache resources of the application process.

[0049] As a specific example, one or more application processes can run simultaneously in an operating system. Optionally, to facilitate the allocation of cache resources for the application processes, a memory allocator can be set for each application process, and the cache resources of the application process can be managed by the memory allocator. For example, instructions related to clearing the cache, such as the cache clearing period and the cache clearing quantity, can be sent to the memory allocator. Instructions for adjusting cache space can also be sent to the memory allocator, so that the memory allocator can apply for or release cache resources from the kernel.

[0050] In some embodiments, when the cache parameters include cache space, the size of the cache space is proportional to the operating level; or, when the cache parameters include a cache clearing cycle, the size of the cache clearing cycle is proportional to the operating level; or, when the cache parameters include a cache clearing ratio, the size of the cache clearing ratio is inversely proportional to the operating level.

[0051] Specifically, the larger the cache space corresponding to an application process, the more cache resources the application process can use. For example, when the application corresponding to the application process switches to the foreground, the application process's operating level increases. At this time, by increasing the cache space, the application process can use more cache resources, which can ensure the application process's peak foreground performance. If the application corresponding to the application process switches to the background, the application process's operating level decreases. At this time, by reducing the cache space, the operating system can reduce the application process's occupation of storage resources in the electronic device, thereby avoiding wasting storage resources.

[0052] The cache cleanup period is the period at which the memory allocator periodically cleans existing cache, also known as the maximum cache lifespan of cache generated by an application process. Retaining cache for an application process can improve its performance to a certain extent. Within a certain range, the more cache a process retains, the greater the performance improvement. As the application process's operating level increases, increasing the cache period and the cache retention time can effectively improve peak performance. As the application process's operating level decreases, decreasing the cache period allows for more timely cleanup of cache generated by the application process.

[0053] The cache purge ratio refers to the percentage of the application's existing cache that is cleared. Because retaining an application's cache can improve its performance to a certain extent, as the application's operating level increases, the cache purge ratio can be reduced to preserve as much of the application's cache as possible, thereby improving peak performance. As the application's operating level decreases, increasing the cache purge ratio can effectively clear the application's cache and reduce cache resource usage.

[0054] Based on the embodiments of the present application, by combining the operating level corresponding to the operating state of the application process, cache parameters can be adjusted during the lifecycle of the application process, thereby flexibly adjusting the cache resources provided to the application process. In particular, during periods when the application process has a high demand for cache resources, the application process's operating speed can be guaranteed, while ensuring the application process's operating speed will not cause excessive cache resources to be continuously occupied when the application process's demand for cache resources is low.

[0055] Regarding step 130, the cache parameter information associated with the first operating level is specifically the size of the cache parameter. The operating system can adjust the current cache resources of the application process according to the parameters included in the cache parameter associated with the first operating level.

[0056] Specifically, if the cache parameters associated with the first operating level include cache space, the cache space of the application process can be adjusted to the size of the cache space included in the cache parameter information associated with the first operating level. If the cache parameters associated with the first operating level include a cache clearing period, during the subsequent operation of the application process, the cache generated by the application process can be cleared according to the cache clearing period included in the cache parameter information associated with the first operating level. If the cache parameters associated with the first operating level include a cache clearing ratio, during the subsequent operation of the application process, part of the cache generated by the application process can be cleared according to the cache clearing ratio included in the cache parameter information associated with the first operating level.

[0057] In some embodiments, the current cache resources of the application process are adjusted according to the cache parameter information associated with the first running level, which may also include the following steps: obtaining the second running level corresponding to the application process before the running status changes; when the first running level and the second running level are different, the cache resources of the application process are adjusted according to the cache parameter information associated with the first running level.

[0058] Since the application process is in different running states, it can correspond to different running levels respectively, and can also correspond to different running levels respectively. Therefore, after obtaining the change in the running state, by comparing and analyzing whether the first running level of the running state after the change and the second running level of the running state before the change are at the same level, if they are at different levels, it can be determined that the cache resources of the application process need to be adjusted, and then the cache resources of the application process can be adjusted according to the cache parameter information associated with the first running level; if they are at the same level, it can be determined that the cache resources of the application process do not need to be adjusted.

[0059] Optionally, if the cache resources of an application process need to be adjusted, cache parameter information associated with the second operating level can be obtained; target cache parameter information in the cache parameter information associated with the first operating level can be determined, where the target cache parameter information differs from the cache parameter information associated with the second operating level; and the cache resources of the application process can be adjusted to the cache resources corresponding to the target cache parameter information. In this way, by comparing and analyzing the cache parameters associated with the first operating level and the cache parameters associated with the second operating level, the target parameters that need to be adjusted can be determined, effectively improving the efficiency of cache resource adjustment.

[0060] It is understandable that when the cache parameters associated with the first operating level and the cache parameters associated with the second operating level are the same, the cache resources of the current application process may not be adjusted.

[0061] In the embodiments of the present application, by detecting the running status of an application process, it is possible to understand in real time whether the running status of the application process in the electronic device has changed. If the running status of the application process has changed, the first running level corresponding to the current running status of the application process can be promptly determined. Since different running levels are associated with different cache parameters, the current cache resources of the application process can then be adjusted based on the cache parameters associated with the first running level.

[0062] In some embodiments, the first running level and the second running level may be running levels in the same life cycle of the application process.

[0063] Because the cache resources required for an application process can be adjusted based on its operating state during its lifecycle, this allows for flexible adjustment of the cache resources provided to the application process. Specifically, this ensures the application's operating speed during periods of high cache resource demand, while also preventing excessive cache resource usage during periods of low cache resource demand. This effectively improves the smoothness of electronic devices and enhances the user experience.

[0064] The cache resource adjustment method provided in the embodiment of the present application can also be executed by a cache resource adjustment device. In the embodiment of the present application, the cache resource adjustment device is used as an example to illustrate the cache resource adjustment method provided in the embodiment of the present application.

[0065] FIG2 is a schematic diagram of the structure of a cache resource adjustment device provided by an embodiment of the present application. As shown in FIG2 , the cache resource adjustment device includes an acquisition module 210 , a processing module 220 and an adjustment module 230 .

[0066] The acquisition module 210 is used to obtain the running status of the application process;

[0067] The processing module 220 is configured to determine a first operating level corresponding to the application process according to the current operating state of the application process when the operating state of the application process changes, wherein different operating levels are associated with different cache parameter information;

[0068] The adjustment module 230 is configured to adjust the current cache resources of the application process according to the cache parameter information associated with the first operating level.

[0069] According to an embodiment of the present application, by detecting the running status of an application process, it is possible to understand in real time whether the running status of an application process in an electronic device has changed, and in the event that the running status of an application process has changed, it is possible to promptly determine the first running level corresponding to the running status of the current application process. Since different running levels are associated with different cache parameters, the current cache resources of the application process can then be adjusted based on the cache parameters associated with the first running level. In this way, during the running of the application process, by analyzing the running status of the application process, the cache resources provided to the application process can be flexibly adjusted, thereby achieving a reasonable allocation of storage resources in the electronic device and effectively improving the running smoothness of the electronic device.

[0070] In some embodiments, the cache parameter includes at least one of a cache space, a cache clearing period, and a cache clearing ratio, and the cache parameter information is the size of the cache parameter.

[0071] Based on the embodiments of the present application, cache parameters for adjusting cache resources provided to an application process can be conveniently determined, so as to flexibly adjust the cache resources provided to the application process.

[0072] In some embodiments, when the cache parameters include cache space, the size of the cache space is proportional to the operating level; or, when the cache parameters include a cache clearing cycle, the size of the cache clearing cycle is proportional to the operating level; or, when the cache parameters include a cache clearing ratio, the size of the cache clearing ratio is inversely proportional to the operating level.

[0073] Based on the embodiments of the present application, when the running level of the corresponding application process is increased, by increasing the cache space, the application process can use more cache resources, which can ensure the foreground peak performance of the application process. When the running level of the corresponding application process is reduced, by reducing the cache space, the application process's occupation of storage resources in the electronic device can be reduced, avoiding waste of storage resources. In addition, when the running level of the application process is increased, by increasing the cache cycle and increasing the cache retention time, the peak performance of the application process can be effectively improved. When the running level of the application process is reduced, by reducing the cache cycle, the cache generated by the application process can be cleared in time. In addition, when the running level of the application process is increased, the cache clearing ratio can be reduced, so as to retain as much of the existing cache of the application process as possible to improve the peak performance of the application process. When the running level of the application process is reduced, by increasing the cache clearing ratio, the cache generated by the application process can be effectively cleared, reducing the occupation of cache resources.

[0074] In some embodiments, the acquisition module 210 is further configured to acquire the second running level corresponding to the application process before the running state changes;

[0075] The adjustment module 230 is further configured to adjust cache resources of the application process according to cache parameter information associated with the first running level when the first running level is different from the second running level.

[0076] Based on the embodiments of the present application, the cache parameters of the application process can be adjusted on time and on demand. In this way, the application process can always be configured with higher cache resources during its life cycle, which can effectively improve the fluency of the electronic device and enhance the user experience of the electronic device.

[0077] In some embodiments, the first running level and the second running level are running levels in the same life cycle of the application process.

[0078] According to the embodiments of the present application, since the required cache resources provided to an application process can be adjusted based on the application process's running state during the application process's lifecycle, the cache resources provided to the application process can be flexibly adjusted. This allows the application process to always be configured with a high level of cache resources during its lifecycle, effectively improving the smoothness of the electronic device and enhancing the user experience of the electronic device.

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

[0080] The cache resource adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0081] The cache resource adjustment device provided in the embodiment of the present application can implement each process implemented by the cache resource adjustment method embodiment provided in the embodiment of the present application. To avoid repetition, they will not be described here.

[0082] Optionally, as shown in Figure 3, an embodiment of the present application also provides an electronic device 300, including a processor 301 and a memory 302, and the memory 302 stores a program or instruction that can be run on the processor 301. When the program or instruction is executed by the processor 301, the various steps of the above-mentioned cache resource adjustment method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0083] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0084] FIG4 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0085] The electronic device 400 includes but is not limited to components such as a radio frequency unit 401 , a network module 402 , an audio output unit 403 , an input unit 404 , a sensor 405 , a display unit 406 , a user input unit 407 , an interface unit 408 , a memory 409 , and a processor 410 .

[0086] Those skilled in the art will appreciate that the electronic device 400 may further include a power source (e.g., a battery) to power various components. The power source may be logically connected to the processor 410 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG4 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.

[0087] Processor 410, used to obtain the running status of the application process;

[0088] Processor 410, configured to determine, when the running state of the application process changes, a first running level corresponding to the application process according to the current running state of the application process, wherein different running levels are associated with different cache parameter information;

[0089] The processor 410 is configured to adjust the current cache resources of the application process according to the cache parameter information associated with the first operating level.

[0090] According to an embodiment of the present application, by detecting the running status of an application process, it is possible to understand in real time whether the running status of an application process in an electronic device has changed, and in the event that the running status of an application process has changed, it is possible to promptly determine the first running level corresponding to the running status of the current application process. Since different running levels are associated with different cache parameters, the current cache resources of the application process can then be adjusted based on the cache parameters associated with the first running level. In this way, during the running of the application process, by analyzing the running status of the application process, the cache resources provided to the application process can be flexibly adjusted, thereby achieving a reasonable allocation of storage resources in the electronic device and effectively improving the running smoothness of the electronic device.

[0091] In some embodiments, the cache parameter includes at least one of a cache space, a cache clearing period, and a cache clearing ratio, and the cache parameter information is the size of the cache parameter.

[0092] Based on the embodiments of the present application, cache parameters for adjusting cache resources provided to an application process can be conveniently determined, so as to flexibly adjust the cache resources provided to the application process.

[0093] In some embodiments, when the cache parameters include cache space, the size of the cache space is proportional to the operating level; or, when the cache parameters include a cache clearing cycle, the size of the cache clearing cycle is proportional to the operating level; or, when the cache parameters include a cache clearing ratio, the size of the cache clearing ratio is inversely proportional to the operating level.

[0094] Based on the embodiments of the present application, when the running level of the corresponding application process is increased, by increasing the cache space, the application process can use more cache resources, which can ensure the foreground peak performance of the application process. When the running level of the corresponding application process is reduced, by reducing the cache space, the application process's occupation of storage resources in the electronic device can be reduced, avoiding waste of storage resources. In addition, when the running level of the application process is increased, by increasing the cache cycle and increasing the cache retention time, the peak performance of the application process can be effectively improved. When the running level of the application process is reduced, by reducing the cache cycle, the cache generated by the application process can be cleared in time. In addition, when the running level of the application process is increased, the cache clearing ratio can be reduced, so as to retain as much of the existing cache of the application process as possible to improve the peak performance of the application process. When the running level of the application process is reduced, by increasing the cache clearing ratio, the cache generated by the application process can be effectively cleared, reducing the occupation of cache resources.

[0095] In some embodiments, the processor 410 is further configured to obtain a second running level corresponding to the application process before the running state changes;

[0096] The processor 410 is further configured to adjust cache resources of the application process according to cache parameter information associated with the first operating level when the first operating level is different from the second operating level.

[0097] Based on the embodiments of the present application, the cache parameters of the application process can be adjusted on time and on demand. In this way, the application process can always be configured with higher cache resources during its life cycle, which can effectively improve the fluency of the electronic device and enhance the user experience of the electronic device.

[0098] In some embodiments, the first running level and the second running level are running levels in the same life cycle of the application process.

[0099] According to the embodiments of the present application, since the required cache resources provided to an application process can be adjusted based on the application process's running state during the application process's lifecycle, the cache resources provided to the application process can be flexibly adjusted. This allows the application process to always be configured with a high level of cache resources during its lifecycle, effectively improving the smoothness of the electronic device and enhancing the user experience of the electronic device.

[0100] It should be understood that in an embodiment of the present application, the input unit 404 may include a graphics processing unit (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 407 includes a touch panel 4071 and at least one of other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.

[0101] The memory 409 can be used to store software programs and various data. The memory 409 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 409 may include a volatile memory or a non-volatile memory, or the memory 409 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a 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 RAM bus random access memory (DRRAM). The memory 409 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0102] Processor 410 may include one or more processing units. Optionally, processor 410 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 410.

[0103] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned cache resource adjustment method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

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

[0105] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned cache resource adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0106] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0107] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned cache resource adjustment method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0108] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course 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 the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0110] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A cache resource adjustment method, the method comprising: Get the running status of the application process; In the case where the running state of the application process changes, determining a first running level corresponding to the application process according to the changed running state of the application process, wherein different running levels are associated with different cache parameter information; Adjust cache resources of the application process according to the cache parameter information associated with the first operating level.

2. The method according to claim 1, wherein: The cache parameter includes at least one of a cache space, a cache clearing cycle, and a cache clearing ratio, and the cache parameter information is the size of the cache parameter.

3. The method according to claim 2, wherein: In the case where the cache parameter includes a cache space, the size of the cache space is proportional to the level of the operation level; or, In the case where the cache parameter includes a cache clearing cycle, the size of the cache clearing cycle is proportional to the level of the operation level; or, In the case where the cache parameter includes a cache clearing ratio, the size of the cache clearing ratio is inversely proportional to the operating level.

4. The method according to claim 1, wherein: The step of adjusting the current cache resource of the application process according to the cache parameter information associated with the first operating level includes: Obtaining a second running level corresponding to the application process before the running state changes; When the first running level is different from the second running level, the cache resource of the application process is adjusted according to the cache parameter information associated with the first running level.

5. The method according to claim 1, wherein: The first running level and the second running level are running levels in the same life cycle of the application process.

6. A cache resource adjustment device, the device comprising: The acquisition module is used to obtain the running status of the application process; A processing module is used to, when the running state of the application process changes, determining a first running level corresponding to the application process according to the running state of the application process after the application process is executed, wherein different running levels are associated with different cache parameter information; The adjustment module is used to adjust the cache resources of the application process according to the cache parameter information associated with the first operating level.

7. The device according to claim 6, wherein: The cache parameter includes at least one of a cache space, a cache clearing cycle, and a cache clearing ratio, and the cache parameter information is the size of the cache parameter.

8. The device according to claim 7, wherein: In the case where the cache parameter includes a cache space, the size of the cache space is proportional to the level of the operation level; or, In the case where the cache parameter includes a cache clearing cycle, the size of the cache clearing cycle is proportional to the level of the operation level; or, In the case where the cache parameter includes a cache clearing ratio, the size of the cache clearing ratio is inversely proportional to the operating level.

9. The device according to claim 6, wherein: The acquisition module is further used to acquire the second running level corresponding to the application process before the running state changes; The adjustment module is further configured to adjust cache resources of the application process according to cache parameter information associated with the first running level when the first running level is different from the second running level.

10. The device according to claim 6, wherein: The first running level and the second running level are running levels in the same life cycle of the application process.

11. An electronic device comprising a processor and a memory, wherein the memory stores processes or instructions that can be executed on the processor, and when the processes or instructions are executed by the processor, the steps of the cache resource adjustment method according to any one of claims 1 to 5 are implemented.

12. A readable storage medium storing a process or an instruction, wherein the process or the instruction, when executed by a processor, implements the steps of the cache resource adjustment method according to any one of claims 1 to 5.

13. An electronic device, configured to implement the cache resource adjustment method according to any one of claims 1-5.

14. A chip comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run a program or instruction to implement the cache resource adjustment method according to any one of claims 1 to 5.

15. A computer program product, wherein when instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the cache resource adjustment method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Process management method and device, storage medium and electronic equipment

    CN107479954A

  • Cache processing method and device, storage medium, processor and computing equipment

    CN110955512A

  • Process management method and device, storage medium and electronic equipment

    CN111008079A

  • Process management method and device, computing equipment and storage medium

    CN111352710A

  • System cache processing method and device, computer equipment and storage medium

    CN114328292A