Method and apparatus for caching data

A technology for caching data and stored data, applied in the computer field, it can solve the problems that the performance cannot meet the system requirements, the storage space is not considered, and the memory overflows.

Active Publication Date: 2018-03-02
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF12 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] For the above existing storage solutions, relational databases can reach thousands of requests per second, and Redis can reach tens of thousands of requests per second. In some specific cases, the performance can no longer meet the system requirements, and the system needs to be buffered again. storage
HashMap and other data storage methods can be used as a good cache tool because they are stored in local memory with high efficiency. However, because the storage space is not considered in their design, long-term use will cause errors such as memory overflow.

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
  • Method and apparatus for caching data
  • Method and apparatus for caching data
  • Method and apparatus for caching data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0028] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

[0029] figure 1 is a schematic diagram of main steps of a method for caching data according to an embodiment of the present invention.

[0030] According to the method for caching data in the embodiment of the present invention, the first storage area and the second storage area are preset, and the maximum amount of data that can be stored in the first storage area and th...

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 present invention discloses a method and apparatus for caching data, and relates to the technical field of computers. One specific embodiment of the method comprises presetting a first storage area and a second storage area, and the maximum stored data size of each of the first storage area and the second storage area is a preset upper limit value. The method comprises the steps of (1) storingto-be-cached data into the first storage area; (2) exchanging the stored data in the first storage area and the stored data in the second storage area after the stored data size of the first storagearea reaches the upper limit value; and (3) after exchange is executed, executing the step one if the current stored data size of the first storage area does not reach the upper limit value; otherwise, emptying the current stored data in the first storage area, and executing the step one. According to the embodiments, the cache hit ratio can be increased, storage overflow can be prevented, application risk can be reduced, the total cached data size can be controlled, hot spot data can be cached, and computation complexity is low.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a method and device for caching data, electronic equipment, and a computer-readable medium. Background technique [0002] With the continuous development of information technology, the number of Internet users has increased rapidly, and the acquisition of various information has shown an explosive trend. Traditional databases are inefficient and slow, and how to store information for high-speed access has become a problem that needs to be solved. Existing NoSQL (non-relational database) technologies such as Redis (a memory-based key-value storage system) and MongoDB (distributed document storage database) require a large number of network interactions, and performance is limited by factors such as network bandwidth. influences. [0003] Existing data storage solutions usually use relational databases, or use NoSQL such as Redis to store data, or use HashMap (a data st...

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): G06F3/06
CPCG06F3/0613G06F3/0614G06F3/0647G06F3/0656
Inventor 刘业辉王彦明袁建军雷强
Owner BEIJING JINGDONG SHANGKE INFORMATION 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