File acquisition method, device, terminal equipment and storage medium
By implementing the file acquisition method in the terminal device, and by cacheing and deleting associated soft reference files, the problem of excessive memory usage by terminal devices when acquiring files is solved, and the technical effect of low memory usage is achieved.
Patent Information
- Application Number
- CN202011219926.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-04
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2040-11-04
AI Technical Summary
When obtaining files, existing terminal devices have technical problems such as excessive memory usage, resulting in poor system operation.
A file acquisition method is proposed, by receiving file acquisition instructions, obtaining the first type of file from the memory of the terminal device, ensuring that the file meets the preset conditions and the memory usage is less than the threshold. The method includes cached files associated with soft references in memory and deleting them when memory usage exceeds the standard to free up memory space.
By effectively controlling the space occupied by files in memory, reducing the memory usage rate of terminal devices, solving the problem of excessive memory usage, and achieving the technical effect of terminal devices having low memory usage when acquiring files.
Smart Images

Figure CN112346865B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of file processing, and in particular to a file acquisition method, device, terminal equipment and storage medium. Background Art
[0002] In the daily use of terminal devices (such as smart screens), it is often necessary to obtain files such as pictures or videos in a certain application. Therefore, a large number of browsing files need to be stored in the memory of the terminal device to achieve fast file acquisition. However, the memory space is limited, and excessive usage will cause problems such as unsmooth operation of the system.
[0003] Therefore, when existing terminal devices obtain files, there is a technical problem that the system memory is occupied too much. Summary of the invention
[0004] The main purpose of the present invention is to provide a file acquisition method, device, terminal device and storage medium, aiming to solve the technical problem of excessive memory usage in existing terminal devices in the prior art.
[0005] To achieve the above object, the present invention provides a file acquisition method for a terminal device; the method comprises the following steps:
[0006] Receive file acquisition instructions;
[0007] Based on the file acquisition instruction, a first type of file is acquired from the memory of the terminal device; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meets a first preset condition, and the memory usage of the terminal device is less than a memory threshold.
[0008] Optionally, the first type of file in the memory is a file with an associated soft reference; the file with an associated soft reference indicates that the file can be deleted when the memory usage of the terminal device is greater than the memory threshold and the file does not meet the first preset condition.
[0009] Optionally, a second type of file is also stored in the memory of the terminal device, and the second type of file in the memory is associated with a weak reference; the file associated with the weak reference indicates that the file can be deleted after the terminal device runs for a preset time interval.
[0010] Optionally, a third type of file is further stored in the memory of the terminal device, and the third type of file in the memory is associated with a strong reference; a file associated with a strong reference indicates that the file cannot be deleted.
[0011] Optionally, the step of acquiring a first type of file from the memory of the terminal device includes:
[0012] Based on the file acquisition instruction, checking whether there is a file of the first type in the memory of the terminal device;
[0013] If not, obtaining a first type of file from the local storage of the terminal device, and caching the first type of file in the memory;
[0014] If so, a first type of file is obtained from the memory of the terminal device.
[0015] Optionally, the memory of the terminal device includes a cache sequence, and the first type of file is cached in the cache sequence; if so, the step of obtaining the first type of file from the memory of the terminal device includes:
[0016] If so, a first type of file that meets a second preset condition is obtained from the cache sequence.
[0017] Optionally, the step of acquiring the first type of file that meets the second preset condition from the cache sequence includes:
[0018] Acquire the first type file at the front end of the cache sequence; wherein the front end of the cache sequence includes the first type file with the highest acquisition rate.
[0019] In addition, to achieve the above-mentioned purpose, the present invention also proposes a file acquisition device for a terminal device, the device comprising:
[0020] A receiving module, used for receiving a file acquisition instruction;
[0021] An acquisition module is used to acquire a first type of file from the memory of the terminal device based on the file acquisition instruction; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meet a first preset condition, and the memory usage of the terminal device is less than a memory threshold.
[0022] In addition, to achieve the above-mentioned purpose, the present invention also proposes a terminal device, which comprises: a memory, a processor, and a file acquisition program stored in the memory and executable on the processor, wherein the file acquisition program is configured to implement the steps of the file acquisition method as described in any one of the above items.
[0023] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a file acquisition program is stored, and when the file acquisition program is executed by a processor, the steps of the file acquisition method as described in any one of the above items are implemented.
[0024] The technical solution of the present invention adopts a file acquisition method for a terminal device; the method comprises the following steps: receiving a file acquisition instruction; based on the file acquisition instruction, acquiring a first type of file from the memory of the terminal device; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meet a first preset condition, and the memory usage rate of the terminal device is less than a memory threshold. Since the first type of files stored in the memory for acquisition meet the first preset condition, by setting the first preset condition, it can be ensured that the space occupied by the memory is effectively controlled so that the memory usage rate of the terminal device is less than the memory threshold, thus solving the technical problem of excessive memory occupation and achieving the technical effect of low memory occupation when the terminal device acquires files. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of the structure of a terminal device in a hardware operating environment involved in an embodiment of the present invention;
[0027] Figure 2 This is a flow chart of a first embodiment of a method for acquiring a file according to the present invention;
[0028] Figure 3 It is a structural block diagram of the first embodiment of the file acquisition device of the present invention.
[0029] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] Reference Figure 1 , Figure 1 A schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiment of the present invention.
[0032] The terminal device can be a user equipment (UE) such as a mobile phone, a smart phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a mobile station (MS), etc., as well as a smart TV, a smart large-screen refrigerator, a smart large-screen air conditioner, etc. The terminal device may be called a user terminal, a portable terminal, a desktop terminal, etc.
[0033] Typically, the terminal device includes: at least one processor 301, a memory 302, and a file acquisition program stored in the memory and executable on the processor, wherein the file acquisition program is configured to implement the steps of the file acquisition method as described above.
[0034] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. The processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process the relevant file acquisition method operations, so that the file acquisition method model can be trained and learned autonomously to improve efficiency and accuracy.
[0035] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 801 to implement the file acquisition method provided in the method embodiment of the present application.
[0036] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.
[0037] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0038] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0039] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on the surface or above the surface of the display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 305 can be one, the front panel of the electronic device; in other embodiments, the display screen 305 can be at least two, respectively arranged on different surfaces of the electronic device or in a folding design; in some further embodiments, the display screen 305 can be a flexible display screen, arranged on a curved surface or a folding surface of the electronic device. Even, the display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.
[0040] The power supply 306 is used to power various components in the electronic device. The power supply 306 can be AC power, DC power, a disposable battery, or a rechargeable battery. When the power supply 306 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology. Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the file acquisition device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0041] In addition, an embodiment of the present invention further proposes a storage medium, on which a file acquisition program is stored, and when the file acquisition program is executed by a processor, the steps of the file acquisition method described above are implemented. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed to be executed on a terminal device, or on multiple terminal devices located at one location, or on multiple terminal devices distributed at multiple locations and interconnected by a communication network.
[0042] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0043] Based on the above hardware structure, an embodiment of the file acquisition method of the present invention is proposed.
[0044] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a method for acquiring a file according to the present invention, which is used in a terminal device; the method comprises the following steps:
[0045] Step S11: receiving a file acquisition instruction.
[0046] It should be noted that the file acquisition instruction can be a file acquisition instruction input by the user to the file acquisition program through the input module on the terminal device, or it can be a file acquisition instruction sent by other mobile devices connected to the terminal device (for example, a remote control or a smart phone, etc.), wherein the input module can be a voice input module or a keyboard input module, and there is no limitation here.
[0047] It can be understood that, for a file acquisition instruction, the file acquisition instruction may include acquiring a first type of file, and may also include acquiring a second type of file and a third type of file. In this case, the first type of file, the second type of file and the third type of file need to be acquired respectively, and the acquisition method refers to the first type of file acquisition method described below, that is, first determine whether it exists in the memory, and if so, directly acquire it; if not, acquire it in the local storage.
[0048] Step S12: Based on the file acquisition instruction, a first type of file is acquired from the memory of the terminal device; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meets a first preset condition, and the memory usage of the terminal device is less than a memory threshold.
[0049] It should be noted that the memory threshold can be set by the user according to his own needs to prevent the memory usage from being too high. Preferably, the memory threshold is 75%. The user can set the memory threshold to other values according to his own needs.
[0050] When receiving a file acquisition instruction, in order to quickly acquire the file, a part of the files to be acquired in the file acquisition instruction (a plurality of first type files), that is, a part of the first type files are stored in the memory, and the other part is only stored in the local storage (not in the memory), so that the terminal device can quickly acquire the first type of files stored in the memory. At this time, the memory usage rate of the terminal device is low, lower than the memory threshold, and meets the first preset condition. The memory threshold can be a value set by the user according to his own needs. Preferably, the memory threshold is 60%.
[0051] Among them, the first type of file can be a video, an original picture or a thumbnail, etc., and the file that meets the first preset condition can be that the file occupies less memory and has a higher usage rate. Among them, the small memory occupancy can be limited by the file occupying less than the file threshold, and the high usage rate can be limited by the number of acquisitions exceeding the preset number. The specific file threshold and preset number can be set by the user according to his own needs and are no longer restricted here.
[0052] Furthermore, the first type of file in the memory is a file associated with a soft reference; a file associated with a soft reference indicates that the file can be deleted when the memory usage of the terminal device is greater than the memory threshold and the file does not meet the first preset condition. As the terminal device runs, there will be more and more cached files in the memory, and there may also be more and more first type files. At this time, it is necessary to delete some of the first type of files according to the memory usage, that is, associate the first type of files with soft references so that the first type of files associated with soft references can be deleted to free up memory space and reduce the memory usage to not exceed the memory threshold.
[0053] For example, when file A is associated with a soft reference and is stored in memory, when the memory usage is greater than the memory threshold and the file does not meet the first preset condition, file A will be deleted to ensure that the memory usage does not exceed the memory threshold and the memory usage is low.
[0054] In specific applications, picture files can be associated as soft references, and video files with playback records can also be associated as soft references. Preferably, when a video file has a playback record, the thumbnail corresponding to the video file is associated as a soft reference, that is, the first type of file includes picture files, videos with playback records, and thumbnails corresponding to videos with playback records, etc.
[0055] It is understandable that when images and videos are cached in memory, they can be thumbnails corresponding to the cached files to save memory space. The thumbnails can be preview thumbnails of images, cover screenshots of videos, or thumbnails of a certain video frame of a video.
[0056] Furthermore, a second type of file is also stored in the memory of the terminal device, and the second type of file in the memory is associated with a weak reference; the file associated with the weak reference indicates that the file can be deleted after the terminal device runs for a preset time interval.
[0057] The terminal device scans the memory at a preset time interval, and when a second type of file associated with a soft reference is scanned, at this time, regardless of whether the specific value of the memory usage rate exceeds the memory threshold, the associated weakly referenced file cached in the memory needs to be deleted. The preset time interval can be a time interval set by the user according to demand, and the present invention does not limit it.
[0058] Specifically, the second type of file may be a video file for which no playback record exists, or may be a thumbnail corresponding to a video file for which no playback record exists.
[0059] In one embodiment, the thumbnails corresponding to video files, picture files and text files can be thumbnails generated by the terminal device itself; when the file is a picture file, the thumbnail can be a thumbnail of the picture file; when the file is a video file, the thumbnail can be the cover of the video file or a certain video frame; when the file is a text file, the thumbnail can be a summary of the text on the home page of the text file, etc.
[0060] Furthermore, a third type of file is stored in the memory of the terminal device, and the third type of file in the memory is associated with a strong reference; a file associated with a strong reference indicates that the file cannot be deleted.
[0061] Usually, text files occupy less space, and most of them are necessary files for system operation and cannot be cleaned up. Associating them with strong references will not cause the memory usage to be too high, that is, the memory usage rate will not exceed the memory threshold.
[0062] Furthermore, the step of obtaining a first type of file from the memory of the terminal device based on the file acquisition instruction includes: based on the file acquisition instruction, checking whether the first type of file exists in the memory of the terminal device; if not, obtaining the first type of file from the local memory of the terminal device and caching the first type of file in the memory; if so, obtaining the first type of file from the memory of the terminal device.
[0063] It should be noted that when it is necessary to obtain the first type of file, it does not necessarily mean that the file is cached in the memory. Only part of the first type of file may be stored in the memory. Therefore, it is necessary to determine whether the first type of file exists in the memory. If so, it is directly obtained in the memory. If not, it is necessary to obtain the first type of file in the local memory and cache the first type of file obtained from the local memory into the memory, so that the first type of file can be quickly obtained in the memory when the file is obtained next time.
[0064] It is understandable that when acquiring the first type of file, the local storage and the memory may be traversed to acquire the first type of file, that is, a portion of the first type of file may be acquired in the memory, and another portion of the first type of file may be acquired in the local storage. Similarly, when the file acquisition instruction also includes acquiring the second type of file and the third type of file, it is necessary to traverse the memory and the preset storage to acquire the second type of file and the third type of file, respectively.
[0065] Furthermore, the memory of the terminal device includes a cache sequence, in which the first type of file is cached; if so, the step of obtaining the first type of file from the memory of the terminal device includes: if so, obtaining the first type of file that meets the second preset condition from the cache sequence.
[0066] It should be noted that the cache sequence can be an arrangement sequence of files, and the cache sequence can include first type files, second type files, and third type files, etc. The files in the cache sequence have an arrangement order, which can be an order from high to low in terms of the number of file acquisitions, or an order from low to high in terms of the number of file acquisitions, or an order from high to low in terms of file size, etc. The present invention does not impose any limitation on this.
[0067] Among them, the second preset condition can be a condition set by the user according to his own needs. For example, when the arrangement order of files in the cache sequence is from high to low order of file acquisition times, the second preset condition can be the N first type files at the front end of the cache sequence; when the arrangement order of files in the cache sequence is from high to low order of file acquisition size, the second preset condition can be the N first type files at the end of the cache sequence, etc.
[0068] Furthermore, the step of obtaining the first type of file that meets the second preset condition from the cache sequence includes: obtaining the first type of file at the front end of the cache sequence; wherein the front end of the cache sequence includes the first type of file with the highest acquisition rate. In this embodiment, the arrangement order of the files in the cache sequence is from high to low order of the number of file acquisitions. The file with the highest acquisition rate is the first type of file with the most acquisitions. At this time, the user satisfaction of the first type of file obtained is high and it is more in line with the user's request to obtain the file. It can be understood that the acquisition rate of a file is the ratio of the number of times the file is acquired to the total number of times the file is acquired. At the same time, the total number of times the file is acquired is a constant. If the file acquisition rate of a file is the largest, then the file has the largest number of file acquisitions.
[0069] The technical solution of this embodiment adopts a file acquisition method for a terminal device, the method comprising the following steps: receiving a file acquisition instruction; based on the file acquisition instruction, acquiring a first type of file from the memory of the terminal device; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meet a first preset condition, and the memory usage rate of the terminal device is less than a memory threshold. Since the first type of files stored in the memory for acquisition meet the first preset condition, by setting the first preset condition, it can be ensured that the space occupied by the memory is effectively controlled so that the memory usage rate of the terminal device is less than the memory threshold, thus solving the technical problem of excessive memory occupation and achieving the technical effect of low memory occupation when the terminal device acquires files.
[0070] Reference Figure 3 , Figure 3 This is a structural block diagram of a first embodiment of a file acquisition device of the present invention, which is used in a terminal device. The device includes:
[0071] A receiving module 10, used for receiving a file acquisition instruction;
[0072] The acquisition module 20 is used to acquire a first type of file from the memory of the terminal device based on the file acquisition instruction; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meet a first preset condition, and the memory usage of the terminal device is less than a memory threshold.
[0073] The above descriptions are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.
Claims
1. A file acquisition method, characterized in that: For terminal equipment; the method comprises the following steps: Receive file acquisition instructions; Based on the file acquisition instruction, a first type of file is acquired from the memory of the terminal device; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files meet a first preset condition, and the memory usage rate of the terminal device is less than a memory threshold; the first type of files include picture files, videos with playback records, and thumbnails corresponding to videos with playback records, and the files meet the first preset condition in that the files occupy a small amount of memory and have a high usage rate, the small amount of memory occupation indicates that the space occupied by the files is less than the file threshold, and the high usage rate indicates that the number of file acquisitions exceeds a preset number; The first type of file in the memory is a file associated with a soft reference; the file associated with a soft reference indicates that when the memory usage of the terminal device is greater than the memory threshold and the file does not meet the first preset condition, the file can be deleted; The terminal device also stores a second type of file in the memory, and the second type of file in the memory is associated with a weak reference; the file associated with the weak reference indicates that the file can be deleted after the terminal device runs for a preset time interval; wherein the files associated with the weak reference need to be deleted after the preset time interval; the second type of file includes a video file for which there is no playback record or a thumbnail corresponding to the video file for which there is no playback record; The terminal device also stores a third type of file in its memory. The third type of file in the memory is associated with a strong reference. A file associated with a strong reference indicates that the file cannot be deleted. The third type of file includes a text file.
2. The file acquisition method according to claim 1, characterized in that: The step of acquiring a first type of file from the memory of the terminal device based on the file acquisition instruction includes: Based on the file acquisition instruction, checking whether there is a file of the first type in the memory of the terminal device; If not, obtaining a first type of file from the local storage of the terminal device, and caching the first type of file in the memory; If so, a first type of file is obtained from the memory of the terminal device.
3. The file acquisition method according to claim 2, characterized in that: The memory of the terminal device includes a cache sequence, and the first type of file is cached in the cache sequence; If so, the step of obtaining the first type of file from the memory of the terminal device includes: If so, a first type of file that meets a second preset condition is obtained from the cache sequence.
4. The file acquisition method according to claim 3, characterized in that: The step of acquiring the first type of file that meets the second preset condition from the cache sequence includes: Acquire the first type file at the front end of the cache sequence; wherein the front end of the cache sequence includes the first type file with the highest acquisition rate.
5. A file acquisition device, characterized in that: For terminal equipment, the device comprises: A receiving module, used for receiving a file acquisition instruction; an acquisition module, configured to acquire a first type of file from the memory of the terminal device based on the file acquisition instruction; wherein at least a plurality of first type of files are stored in the memory of the terminal device, the first type of files satisfy a first preset condition, and the memory usage rate of the terminal device is less than a memory threshold; the first type of files include image files, videos with playback records, and thumbnails corresponding to videos with playback records, and the files satisfying the first preset condition are that the files occupy a small amount of memory and have a high usage rate, the small amount of memory occupation indicates that the space occupied by the files is less than the file threshold, and the high usage rate indicates that the number of file acquisitions exceeds a preset number; The first type of file in the memory is a file associated with a soft reference; the file associated with a soft reference indicates that when the memory usage of the terminal device is greater than the memory threshold and the file does not meet the first preset condition, the file can be deleted; The terminal device also stores a second type of file in the memory, and the second type of file in the memory is associated with a weak reference; the file associated with the weak reference indicates that the file can be deleted after the terminal device runs for a preset time interval; wherein the files associated with the weak reference need to be deleted after the preset time interval; the second type of file includes a video file for which there is no playback record or a thumbnail corresponding to the video file for which there is no playback record; The terminal device also stores a third type of file in its memory. The third type of file in the memory is associated with a strong reference. A file associated with a strong reference indicates that the file cannot be deleted. The third type of file includes a text file.
6. A terminal device, characterized in that: The terminal device comprises: a memory, a processor, and a file acquisition program stored in the memory and executable on the processor, wherein the file acquisition program is configured to implement the steps of the file acquisition method according to any one of claims 1 to 4.
7. A storage medium, characterized in that: The storage medium stores a file acquisition program, and when the file acquisition program is executed by the processor, the steps of the file acquisition method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
File reading method and device, electronic equipment and storage medium
CN110807010A