Data caching method

A technology for caching data and data, which is applied in the direction of electrical digital data processing, memory system, memory address/allocation/relocation, etc., and can solve the problems that cannot be used for storage, waste memory, and cannot be used to store large data, etc.

Active Publication Date: 2012-05-02
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Although the sum of these small memory spaces is greater than a certain value, it cannot be used to store this value, or even larger data smaller than this value, so it will waste memory

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0018] Further description will be made below in conjunction with the accompanying drawings.

[0019] Such as figure 1 Shown is a flow chart of a method for caching data in an embodiment. The method includes the following steps:

[0020] S10: Divide a transitional memory block from the memory. The transitional memory block is a storage area divided from the memory for temporary storage of cached data. The method for caching data in this embodiment is used to cache small data, that is, to cache data with a size of 1 byte to 8000 bytes, and the transitional memory block must be able to store at least the length of the maximum data that may be stored, that is, it needs to be greater than Or equal to 8000 bytes.

[0021] S20: Determine whether the remaining space of the transitional memory block is sufficient to store cached data. If the remaining space is sufficient, go to step S30, otherwise go to step S40.

[0022] S30: Store the cached data into the transitional memory b...

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: marking off a transitional memory block from a memory; judging whether free space of the transitional memory block is large enough to store cached data, if so, storing the cached data into the transitional memory block; otherwise, compressing data in the transitional memory block, then storing the compressed data into a caching area, and emptying the data in the transitional memory block. In the method above, because small cached data are stored in the transitional memory block firstly, then, the small cached data are stored in the caching area as a whole, so that the small cached data can be merged into large data for accessing. By using the method disclosed by the invention, memory fragments caused when small data are stored and deleted frequently in the memory are eliminated; in addition, through carrying out compression on cached data, the space of the memory can be better used further.

Description

【Technical field】 [0001] The present invention relates to caching technology, in particular to a method for caching data. 【Background technique】 [0002] In computer technology, caching technology is usually used. For example, the intermediate results of calculations are not processed in time, so they must be temporarily stored. [0003] The traditional general-purpose caching technology uses some strategies to delete data that may not be used again when the memory is insufficient, such as the least recently used strategy, which eliminates the data that has been least used in the most recent period. The memory is generally allocated continuously at the beginning. When storing small data, if the memory is insufficient, some small data will be eliminated. After the small data is eliminated, the memory space it occupied before is released. After multiple storage and deletion operations, there will be many discontinuous small memory spaces in the memory, that is, memory fragme...

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): G06F12/08G06F12/0871G06F12/0873
Inventor 朱正平沈妍
Owner TENCENT TECH (SHENZHEN) 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