CN115994032A - Cache management method, device, electronic equipment and medium - Google Patents

Cache management method, device, electronic equipment and medium Download PDF

Info

Publication number
CN115994032A
CN115994032A CN202310078069.5A CN202310078069A CN115994032A CN 115994032 A CN115994032 A CN 115994032A CN 202310078069 A CN202310078069 A CN 202310078069A CN 115994032 A CN115994032 A CN 115994032A
Authority
CN
China
Prior art keywords
resource data
memory
target
application program
target application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310078069.5A
Other languages
Chinese (zh)
Inventor
葛开
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310078069.5A priority Critical patent/CN115994032A/en
Publication of CN115994032A publication Critical patent/CN115994032A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a cache management method, a cache management device, electronic equipment and a medium, and belongs to the field of data processing. The cache management method comprises the following steps: determining a first process of the target application program under the condition of running the target application program; caching target resource data corresponding to the first process into a memory, and performing lock protection on the target resource data; and after the first process is finished, releasing the target resource data cached in the memory.

Description

Cache management method, device, electronic equipment and medium
Technical Field
The application belongs to the field of data processing, and particularly relates to a cache management method, a device, electronic equipment and a medium.
Background
In the related art, when the electronic device runs a certain application program and needs the corresponding resource data, the electronic device needs to access all the resources in the memory first, and when the resources needed by the application program are not found in the memory, the electronic device also needs to access the disk again and cache the resources needed by the application program into the memory.
However, after the electronic device is powered off, the resource data in the memory will be cleared, if the electronic device runs an application program again and needs the corresponding resource data, it is necessary to revisit the disk resource and acquire the resource cache needed by the program to the memory for processing, so that the time for caching the resource data by the electronic device is longer, and therefore the efficiency of running the application program by the electronic device is reduced.
Disclosure of Invention
The embodiment of the application aims to provide a resource caching method, a device, electronic equipment and a medium, which can solve the problem of reducing the efficiency of running an application program of the electronic equipment.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a cache management method, where the method includes: determining a first process of the target application program under the condition of running the target application program; caching target resource data corresponding to the first process into a memory, and performing lock protection on the target resource data; and under the condition that the operation of the first process is finished, releasing the target resource data cached in the memory.
In a second aspect, an embodiment of the present application provides a cache management apparatus, including: the device comprises a determining module, a processing module and a releasing module, wherein: the determining module is used for determining a first process of the target application program under the condition of running the target application program; the processing module is used for caching target resource data corresponding to the first row of processes into the memory and performing lock protection on the target resource data; and the releasing module is used for releasing the target resource data cached in the memory after the operation of the first process is finished.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method as in the first aspect.
In a fifth aspect, embodiments of the present application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to execute programs or instructions to implement a method as in the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement a method as in the first aspect.
In the embodiment of the application, under the condition that the target application is operated, the electronic device determines a first process of the target application, then caches target resource data corresponding to the first process into the memory, and locks and protects the target resource data, so that the target resource data cached in the memory is released under the condition that the operation of the first process is finished. According to the scheme, the electronic equipment can lock and protect the target resource data required by the first process of the running target application program in the memory in advance, so that the time consumption of caching the resource data by the electronic equipment is shortened, and the efficiency of running the application program by the electronic equipment can be improved.
Drawings
FIG. 1 is a schematic flow chart of a cache management method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a cache management method according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a cache management device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5 is a schematic hardware diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the objects identified by "first," "second," etc. are generally of a type and do not limit the number of objects, for example, the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The following embodiments are provided by way of specific embodiments and application scenarios thereof with reference to the accompanying drawings. The cache management method, the device, the electronic equipment and the medium are described in detail.
In the related art, generally, when an electronic device runs an application program a, a central processing unit (Central Processing Unit, CPU) needs to access a memory first, and read a resource a required by the application program a from the memory, if there is no resource a in the memory, access a disk, read the resource a from the disk, and then cache the resource a to the memory, and process data of the resource a in the memory. According to the scheme, under the condition that the running application program needs the corresponding resources, the corresponding resources are read from the disk and cached to the memory, so that the time for caching the resource data by the electronic equipment is long, and the efficiency of running the application program by the electronic equipment is reduced.
In the cache management method, the device, the electronic equipment and the medium provided by the embodiment of the application, the electronic equipment can determine the first process of the target application under the condition of running the target application, then cache the target resource data corresponding to the first process into the memory, and lock the target resource data for protection, so that the target resource data cached in the memory is released under the condition that the running of the first process is finished. According to the scheme, the electronic equipment can lock and protect the target resource data required by the first process of the running target application program in the memory in advance, so that the time consumption of caching the resource data by the electronic equipment is shortened, and the efficiency of running the application program by the electronic equipment can be improved.
The execution body of the cache management method provided in this embodiment may be a cache management device, and the cache management device may be an electronic device, or may be a control module or a processing module in the electronic device. The technical solutions provided in the embodiments of the present application are described below by taking an electronic device as an example.
The embodiment of the application provides a cache management method, as shown in fig. 1, the cache management method may include the following steps 201 to 203:
step 201: the electronic device determines a first process of the target application program under the condition of running the target application program.
Illustratively, the target application is used to indicate the application currently running.
Illustratively, the first process is used to indicate that the target application is about to run a process that has not yet been run.
It should be noted that, the electronic device may determine the first process to be executed by the target application according to the time period of the currently executed target application.
Optionally, in the embodiment of the present application, before the step 201, the cache management method provided in the embodiment of the present application may include the following steps 301 and 302:
step 301: the electronic device dumps system resources required by the target application into at least one dump file.
Wherein each dump file stores at least one resource data.
Illustratively, the foregoing "dumping the system resource into at least one dump file" may be understood as saving the system resource from the dynamic data that is easy to lose to the static data that is difficult to lose before determining the first process of the target application program. And, dump file is favorable to the electronic equipment to read it and analyze.
Specifically, the at least one resource data may be at least one of: file resource data, thread resource data, memory resource data, etc.
Step 302: and the electronic equipment performs statistical classification on the resource data in at least one dump file to obtain a resource data packet corresponding to each operation period in the target application program.
Wherein each run period corresponds to at least one run process.
Illustratively, the above-mentioned operation period is used for indicating that the operation process of the target application program is divided into at least one operation period according to the time attribute.
Illustratively, the "statistical classification" described above may include: and carrying out statistical classification according to the attribute of the resource data and carrying out statistical classification according to the attribute of the time.
It should be noted that, the electronic device may first perform statistical classification on the resource data in the dump file according to the attribute of the resource data, and divide the resource data into a file resource, a memory resource, a thread resource, and the like. And then, on the basis, carrying out statistics classification on the classified various resources according to the operation time periods, namely integrating various resources such as file resources, memory resources or thread resources used in each operation time period in the target application program into a resource data packet.
Therefore, the electronic device can dump the system resources required by the operation of the target application program into at least one dump file before determining the first process of the target application program, and statistically classify the at least one dump file to obtain the resource data packet corresponding to each operation period, that is, the electronic device dumps the system resources into the dump file, so that the system resources are convenient to analyze and read, and the resource data required by each operation period in the application program can be rapidly determined, so that the efficiency of the electronic device for operating the application program can be improved.
Alternatively, in the embodiment of the present application, the above step 302 may be specifically implemented by the following steps 302a and 302b:
step 302a: the electronic device extracts the first resource data from the at least one dump file.
The first resource data is used for indicating resource data required by the electronic device to run the target application program.
Step 302b: the electronic equipment performs statistical classification on the first resource data to obtain resource data packets corresponding to each operation period in the target application program.
Wherein the resource data packet includes at least one of: file resources, memory resources and thread resources; the file resource is a first file required by the first process, the memory resource is the amount and type of memory required by the first process, and the thread resource is the number of threads required by the first process.
It should be noted that, the file resource in the resource data packet is a core file or a necessary file required by the electronic device to run the first process.
The first file is used to indicate a core file or a necessary file.
Step 202: and the electronic equipment caches the target resource data corresponding to the first process into the memory, and locks and protects the target resource data.
The target resource data is illustratively used to indicate resource data required by the electronic device to run the first process.
By way of example, the above-mentioned "lock protection of target resource data in memory" may be understood that the electronic device uses memory lock to lock target resource data in memory in advance, so as to prevent the system from automatically clearing target resource data out of memory before the first process is finished running.
Step 203: and under the condition that the operation of the first process is finished, the electronic equipment releases the target resource data cached in the memory.
By way of example, the above-described "in the case where the first process is ended" can be understood as the electronic device after using the target resource data.
For example, taking application a as a target application, assume that the electronic device runs application a in response to a user operation on an application icon corresponding to application a. Under the condition of operating the application program A, the electronic device determines the process A (namely the first process) to be operated by the application program A, then caches the resource data A corresponding to the process A into the memory in advance, and locks and protects the resource data A in the memory. And after the first process is finished, clearing the resource data A cached in the memory in advance.
In this embodiment of the present application, the electronic device may determine, under the condition that the target application is running, a first process of the target application, then cache, to the memory, target resource data corresponding to the first process, and lock-protect the target resource data, so that, under the condition that the first process is running, the target resource data cached in the memory is released. According to the scheme, the electronic equipment can lock and protect the target resource data required by the first process of the running target application program in the memory in advance, so that the time consumption of caching the resource data by the electronic equipment is shortened, and the efficiency of running the application program by the electronic equipment can be improved.
Optionally, in the embodiment of the present application, before the step 202, the cache management method provided in the embodiment of the present application may include the following step 401:
step 401: and the electronic equipment takes the resource data packet corresponding to the operation period to which the first process belongs as target resource data.
It should be noted that, the electronic device may determine the resource data packet according to the time period corresponding to the operation process to which the first process belongs, that is, according to the operation period to which the first process belongs.
Taking the target application program as an example of the program B, the electronic device may divide the operation period of the program B into T1 and T2 … … TN, where each operation period may correspond to at least one operation process, where in the case that the operation period of the process B, that is, the operation period to which the first process belongs is the T2 period, the electronic device may use the resource data packet corresponding to the T2 period as the resource data B required for the operation process B, that is, the target resource data.
Illustratively, the resource data packet may include: file resources, memory resources, thread resources, etc.
Specifically, the file resource may be a core file or a necessary file required for running the first process, the memory resource may be an amount and a type of memory required for running the first process, and the thread resource may be a number of threads required for running the first process.
Therefore, the electronic device can take the resource data packet corresponding to the running period to which the first process belongs as the target resource data before caching the target resource data corresponding to the first process into the memory. That is, the electronic device can determine the target resource data according to the time sequence of the process operation, so that the accuracy of determining the target resource data by the electronic device can be improved, and the efficiency of processing the data by the electronic device is improved.
Optionally, in the embodiment of the present application, after the step 201, the cache management method provided in the embodiment of the present application may include the following steps 501 and 502:
step 501: and the electronic equipment dumps the system resource corresponding to the first process into at least one dump file.
Illustratively, at least one resource data is stored in each dump file described above.
Illustratively, the system resources are used to indicate dynamic, loss-prone data required to run the first process.
The dump file is used for indicating static and easy-to-save data corresponding to the system resource.
After determining the first process, the electronic device dumps the system resources required by the first process into a dump file, so as to be convenient for reading and analyzing the system resources required by the first process.
Illustratively, the at least one resource data may be at least one of: file resources, thread resources, memory resources, etc.
Step 502: and carrying out statistical classification on the resource data in at least one dump file to obtain target resource data corresponding to the first process.
Illustratively, the "statistical classification" described above may include: and carrying out statistical classification according to the attribute of the resource data and carrying out statistical classification according to the attribute of the time.
Illustratively, the above-mentioned statistical classification according to the attribute of the resource data may divide the resource data into: file resources, memory resources, thread resources, etc.
Illustratively, the above-mentioned statistical classification according to the time attribute may divide the resource data into the T1 period resource data, the T2 period resource data … TN period resource data.
It should be noted that, the electronic device may first perform statistical classification on the resource data in the dump file according to the attribute of the resource data, and divide the resource data into a file resource, a memory resource, a thread resource, and the like. And then, on the basis, carrying out statistics classification on the classified various resources according to the time attribute, namely determining various resources such as file resources, memory resources or thread resources required by running the first process as target resource data.
Illustratively, the target resource data is used to indicate resource data required to run the first process.
Therefore, after the first process of the target application program is determined, the electronic device can dump the system resource required by the first process into at least one dump file, and perform statistical classification on the at least one dump file to obtain target resource data, that is, the electronic device dumps the resource data corresponding to the first process into the dump file, so that the resource data is convenient to read and analyze, and the resource data required by the first process can be determined quickly, so that the efficiency of the electronic device for operating the first process can be improved.
The cache management method provided in the embodiment of the present application will be described in the following by way of example:
for example, as shown in fig. 2, the cache management provided in the present application may include the following steps S1 to S7:
step S1: the user operates the application and the system notifies the resource manager.
Step S2: the resource manager intercepts the program running condition through hook.
Step S3: and judging whether the program is dumped, if yes, executing the step S5, otherwise, executing the step S4.
Step S4: the resource manager moves the program to the IO simulator for operation and dumps the system resources into static data (i.e., the dump file). Firstly, carrying out primary classification, namely counting the used file resources, thread resources, memory resources and the like of a program, transmitting the counted file resources, thread resources, memory resources and the like to a resource manager for secondary classification, wherein the secondary classification is time dimension classification, taking the file resources as an example, the running period of the whole program is divided into T0, T1 and T2 … … TN, files used in the stage of T0-T1 are integrated into a pre-cache package, N-1 pre-cache packages are integrated in total, and other resources are equivalent.
Step S5: and the resource manager reads the data in the cache packet according to the time sequence and locks the resource data related to the program operation.
Step S6: the resource manager switches the background schedule and the program starts to execute synchronously.
Step S7: and (5) after the program execution is completed, notifying the resource manager to release the cache resource.
According to the cache management method provided by the embodiment of the application, the execution main body can be a cache management device. In this embodiment, a cache management device executes a cache management method as an example, and the cache management device provided in this embodiment of the present application is described.
An embodiment of the present application provides a cache management apparatus, as shown in fig. 3, the cache management apparatus 400 includes: a determination module 401, a processing module 402, and a release module 403, wherein: the determining module 401 is configured to determine, in a case where the target application is running, a first process of the target application; the processing module 402 is configured to cache target resource data corresponding to the first process into a memory, and lock-protect the target resource data; the releasing module 403 is configured to release the target resource data cached in the memory when the operation of the first process is finished.
Optionally, in an embodiment of the present application, the foregoing apparatus further includes: the dump module is used for dumping system resources required by the target application program into at least one dump file before determining a first process corresponding to the target application program, and at least one resource data is stored in each dump file; the processing module 402 is further configured to statistically classify resource data in at least one dump file to obtain a resource data packet corresponding to each operation period in the target application program; wherein each operation period corresponds to at least one operation process.
Optionally, in this embodiment of the present application, the processing module 402 is further configured to, before caching, in the memory, the target resource data corresponding to the first process, use, as the target resource data, a resource data packet corresponding to an operation period to which the first process belongs.
Optionally, in the embodiment of the present application, the processing module 402 is specifically configured to extract the first resource data from at least one dump file; the processing module 402 is further configured to statistically classify the first resource data to obtain a resource data packet corresponding to each operation period in the target application program; wherein the resource data includes at least one of: file resources, memory resources and thread resources; the file resource is a first file required by the first process, the memory resource is the amount and type of memory required by the first process, and the thread resource is the number of threads required by the first process.
Optionally, in this embodiment of the present application, the dump module is further configured to dump, after determining a first process corresponding to the target application, a system resource corresponding to the first process into at least one dump file, where each dump file stores at least one resource data; the processing module 402 is further configured to statistically classify the resource data in the at least one dump file to obtain target resource data corresponding to the first process.
In the cache management device provided by the embodiment of the application, under the condition that the target application is operated, the cache management device determines the first process of the target application, then caches the target resource data corresponding to the first process into the memory, and locks and protects the target resource data, so that the target resource data cached in the memory is released under the condition that the operation of the first process is finished. According to the scheme, the target resource data required by the first process of the running target application program can be locked and protected in the memory in advance by the cache management, so that the time consumption of the cache management for caching the resource data is shortened, and the efficiency of the cache management for running the application program can be improved.
The cache management device in the embodiment of the application may be an electronic device, or may be a component in the electronic device, for example, an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The cache management 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 embodiments of the present application.
The buffer management device provided in the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to fig. 2, and in order to avoid repetition, a detailed description is omitted here.
Optionally, as shown in fig. 4, the embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, where a program or an instruction capable of running on the processor 601 is stored in the memory 602, and the program or the instruction implements each step of the above embodiment of the cache management method when executed by the processor 601, and the steps can achieve the same technical effects, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 5 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 100 includes, but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
Those skilled in the art will appreciate that the electronic device 100 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 110 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 5 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 110 is configured to determine a first process of the target application program under the condition of running the target application program, cache target resource data corresponding to the first process into the memory, and lock-protect the target resource data, thereby releasing the target resource data cached in the memory after the running of the first process is completed.
Optionally, in this embodiment of the present application, before determining the first process of the target application, the processor 110 is further configured to dump the system resources required by the target application into at least one dump file, store at least one resource data in each dump file, and statistically classify the resource data in at least one dump file to obtain a resource data packet corresponding to each operation period in the target application; wherein each operation period corresponds to at least one operation process.
Optionally, in an embodiment of the present application, the foregoing processor 110 is further configured to: before caching the target resource data corresponding to the first process into the memory, taking the resource data packet corresponding to the running period of the first process as the target resource data.
Optionally, in this embodiment of the present application, the processor 110 is specifically configured to extract all the first resource data from at least one dump file, and statistically classify the first resource data to obtain a resource data packet corresponding to each operation period in the target application. Wherein the resource data packet includes at least one of: file resources, memory resources and thread resources; the file resource is a first file required by the first process, the memory resource is the amount and type of memory required by the first process, and the thread resource is the number of threads required by the first process.
Optionally, in this embodiment of the present application, the processor 110 is further configured to dump, after determining a first process corresponding to the target application, a system resource corresponding to the first process into at least one dump file, where each dump file stores at least one resource data; and carrying out statistical classification on the resource data in at least one dump file to obtain target resource data corresponding to the first process.
In the electronic device provided in the embodiment of the present application, the electronic device may determine, when the target application is running, a first process of the target application, then cache target resource data corresponding to the first process to a memory, and lock-protect the target resource data, so that, when the running of the first process is finished, the target resource data cached in the memory is released. According to the scheme, the electronic equipment can lock and protect the target resource data required by the first process of the running target application program in the memory in advance, so that the time consumption of caching the resource data by the electronic equipment is shortened, and the efficiency of running the application program by the electronic equipment can be improved.
It should be appreciated that in embodiments of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 may include two parts of a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 109 may include volatile memory or nonvolatile memory, or the memory 109 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 109 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above embodiment of the cache management method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used for running a program or an instruction, so as to implement each process of the above embodiment of the cache management method, and achieve the same technical effect, so that repetition is avoided, and no redundant description is provided here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
The embodiments of the present application provide a computer program product, which is stored in a storage medium, and the program product is executed by at least one processor to implement the respective processes of the embodiments of the cache management method, and achieve the same technical effects, and are not described herein again for avoiding repetition.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (10)

1. A method for cache management, the method comprising:
determining a first process of a target application program under the condition of running the target application program;
caching target resource data corresponding to the first process into a memory, and performing lock protection on the target resource data;
and under the condition that the operation of the first process is finished, releasing the target resource data cached in the memory.
2. The method of claim 1, wherein prior to the determining the target application first process, the method further comprises:
dumping system resources required by the target application program into at least one dump file, wherein at least one resource data is stored in each dump file;
carrying out statistical classification on the resource data in the at least one dump file to obtain a resource data packet corresponding to each operation period in the target application program;
wherein each of the operation periods corresponds to at least one operation process.
3. The method of claim 2, wherein before caching the target resource data corresponding to the first process into the memory, the method further comprises:
and taking the resource data packet corresponding to the running period to which the first process belongs as the target resource data.
4. The method of claim 2, wherein the statistically classifying the resource data in the at least one dump file to obtain the resource data packet corresponding to each operating period in the target application program includes:
extracting first resource data from the at least one dump file;
carrying out statistical classification on the first resource data to obtain a resource data packet corresponding to each operation period in the target application program;
wherein the resource data packet includes at least one of: file resources, memory resources and thread resources; the file resource is a first file required by the first process, the memory resource is the amount and type of memory required by the first process, and the thread resource is the number of threads required by the first process.
5. The method of claim 1, wherein after the determining the first process corresponding to the target application, the method further comprises:
dumping the system resources corresponding to the first process into at least one dump file, wherein at least one resource data is stored in each dump file;
and carrying out statistical classification on the resource data in the at least one dump file to obtain target resource data corresponding to the first process.
6. A cache management apparatus, the apparatus comprising: the device comprises a determining module, a processing module and a releasing module, wherein:
the determining module is used for determining a first process of the target application program under the condition of running the target application program;
the processing module is used for caching the target resource data corresponding to the first process into a memory and performing lock protection on the target resource data;
the releasing module is configured to release the target resource data cached in the memory when the operation of the first process is finished.
7. The apparatus of claim 6, wherein the apparatus further comprises: the dump module is configured to dump the data,
the dump module is used for dumping the system resources required by the target application program into at least one dump file before the first process of the target application program is determined, and at least one resource data is stored in each dump file;
the processing module is further configured to statistically classify the resource data in the at least one dump file to obtain a resource data packet corresponding to each operation period in the target application program;
wherein each of the operation periods corresponds to at least one operation process.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the processing module is further configured to, before caching, in the memory, the target resource data corresponding to the first process, use a resource data packet corresponding to an operation period to which the first process belongs as the target resource data.
9. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the cache management method of any of claims 1-5.
10. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the steps of the cache management method according to any one of claims 1-5.
CN202310078069.5A 2023-01-16 2023-01-16 Cache management method, device, electronic equipment and medium Pending CN115994032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310078069.5A CN115994032A (en) 2023-01-16 2023-01-16 Cache management method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310078069.5A CN115994032A (en) 2023-01-16 2023-01-16 Cache management method, device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN115994032A true CN115994032A (en) 2023-04-21

Family

ID=85991804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310078069.5A Pending CN115994032A (en) 2023-01-16 2023-01-16 Cache management method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115994032A (en)

Similar Documents

Publication Publication Date Title
CN109918141A (en) Thread execution method, device, terminal and storage medium
WO2019137252A1 (en) Memory processing method, electronic device, and computer-readable storage medium
CN113448735A (en) Memory leak processing method and device and electronic equipment
CN111858112B (en) Method, client and server for detecting memory leakage
US20240152439A1 (en) Detection Method and Electronic Device
CN115955557A (en) Kadun analysis method and device thereof
CN116489271A (en) Advertisement processing method and device
CN115994032A (en) Cache management method, device, electronic equipment and medium
CN114385368A (en) Method and device for flashing pre-written log
CN114070892A (en) Data transmission method and device
CN111090627B (en) Log storage method and device based on pooling, computer equipment and storage medium
CN112732542A (en) Information processing method, information processing device and terminal equipment
CN112732568B (en) System log acquisition method and device, storage medium and terminal
CN116302541A (en) Resource performance adjusting method and device
CN116954911A (en) Memory processing method, memory processing device, electronic equipment and readable storage medium
CN113328998B (en) Image data transmission method and electronic equipment
CN117311967A (en) Memory processing method and device and electronic equipment
CN116955215A (en) Garbage recycling method and device and electronic equipment
CN116795538A (en) Compiling process management method and device and electronic equipment
CN116680083A (en) Memory processing method, device, equipment and storage medium
CN116954925A (en) Memory release method and device, electronic equipment and medium
CN116661697A (en) Memory processing method and device, electronic equipment and storage medium
CN116841833A (en) Memory leakage detection method and device, electronic equipment and readable storage medium
CN116991605A (en) Process processing method, device, electronic equipment and readable storage medium
CN116069634A (en) Buried point detection method, buried point detection device, electronic equipment and storage medium

Legal Events

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