File cache method and device

A file cache and file storage technology, applied in the computer field, can solve problems such as OOM exception, insufficient memory, GC cannot complete recycling, etc., to speed up the loading speed and avoid the effect of OOM

Inactive Publication Date: 2015-05-27
QINGDAO HISENSE MOBILE COMM TECH CO LTD
View PDF4 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Generally speaking, GC manages memory reasonably, and developers don't need to care too much about the timing of memory release. However, when the memory usage of the application is relatively high, or the memory is always referenced due to code problems, and the GC cannot complete the recovery, memory will be generated. Insufficient situation
For Bitmap (bitmap), its data is allocated on the native (original, inherent) heap. When multiple Bitmaps are opened at the same time or continuously, the native heap will not be enough, and an OOM exception will occur.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • File cache method and device
  • File cache method and device
  • File cache method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] Embodiments of the present invention provide a file caching method and device. For downloaded files, they are stored in both the primary cache and the file cache, which is convenient for subsequent file loading and reduces the number of primary and secondary caches. The cache pressure of the cache improves the loading speed of pictures and other files, and reduces the occurrence of insufficient memory.

[0042] Such as figure 1 As shown, the file caching method provided by the embodiment of the present invention includes:

[0043] Step S101, when it is determined that a file needs to be loaded, and it is determined that the file needs to be downloaded from the network, download the file;

[0044] Step S102, after downloading the file, back up and store the downloaded file in the file cache and the first-level cache.

[0045] Since the downloaded files are backed up and stored in the file cache and the first-level cache at the same time, when the file is loaded again, ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a file cache method and device, and relates to computer technology. A downloaded file is stored in a primary cache and a file cache and conveniently used in subsequent loading, cache pressure of the primary cache and a secondary cache is reduced, the loading speed of files such as pictures is increased, and memory deficiency is decreased.

Description

technical field [0001] The invention relates to computer technology, in particular to a file caching method and device. Background technique [0002] In the design and development of Android network-related applications, it may often be encountered that pictures stored on the network are downloaded and displayed. This requires displaying dozens of pictures or even hundreds of pictures on one interface, which is limited to the size of the mobile phone screen. In the design, ListView (a class provided by the Android system, which mainly implements list controls) or GridView (a class provided by the Android system, which mainly implements grid controls) controls are used to control the batch download and display of pictures, that is, It is usually said that the number of pictures that need to be displayed at one time is a relatively definite number, usually not too large. If the number is relatively large, when a lot of pictures are loaded in ListView or GridView, it is easy t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/9574G06F16/172
Inventor 王磊
Owner QINGDAO HISENSE MOBILE COMM TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products