Data caching method

A data cache and data technology, applied in the direction of electrical digital data processing, special data processing applications, digital data information retrieval, etc., can solve the problems of processor repetitive calculation, memory space waste, inaccessibility, etc., to optimize speed and increase capacity , to achieve the effect of long-term storage

Pending Publication Date: 2022-03-25
四川启睿克科技有限公司
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The self-level two caching method will allow the system to perform LruCache and DiskLruCache caching at the same time, resulting in waste of memory space and repeated operations of the processor
However, LruCache's own caching mechanism has limited requirements on the memory capacity. When the cached part of the memory is exceeded, it will be eliminated and deleted. This deletion is mandatory, which will cause the system to be unable to access the cached data again and throw an exception.

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
  • Data caching method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0022] Such as figure 1 As shown, a data caching method includes:

[0023] 1) When developing an Android application, integrate this method in the framework, and initialize various parameters. Including but not limited to providing context for this method, enabling debug to print logs, and setting storage data conversion methods (this method supports caching a variety of commonly used data including ordinary strings, JsonObject, JsonArray, Bitmap, Drawable, serialized java objects and byte data, etc.), set the memory cache size, set the path cache space size in the file cache, set the value cache space size in the file cache, and set the storage folder name of the file cache. The preset cache space size is the size of the cache space that the sizeOf() function needs to process.

[0024] 2) Write cache operation, call the put() function of this method, cache the key corresponding to the data to be cached in the memory space and store it in path, and store the corresponding va...

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 data caching method, which comprises the following steps: based on a LruCache storage mechanism, carrying out encapsulation processing on storage contents and elimination and deletion operations, deleting eliminated data from a memory caching space, and transferring the eliminated data into a file caching space; according to the invention, on the basis of the characteristics of lightweight storage and rapid reading, long-time storage of cached data is realized.

Description

technical field [0001] The invention relates to the technical field of data caching, in particular to a data caching method. Background technique [0002] Data caching is an essential and frequently used function in Android application development, especially in the era of the Internet of Things, where a large number of network data requests are an important part of daily development. The request of the cloud interface and the loading of the data cache determine the user's experience of the entire APP, so the reasonable use of the cache is extremely important for the data processing of the network request. [0003] At present, the general cache solution processing mechanism of the Android native system usually uses LruCache and DiskLruCache to cache the network request data at the second level. For this, most of them are self-used and self-encapsulated, requiring frequent coding work. The self-level two caching method will allow the system to perform LruCache and DiskLruCac...

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): G06F16/2455G06F3/06
CPCG06F16/24552G06F3/061G06F3/0608G06F3/0643G06F3/0652
Inventor 谢彰
Owner 四川启睿克科技有限公司
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