Hotspot data caching method based on Redis

The invention discloses a hotspot data caching method based on Redis. The hotspot data caching method comprises the following steps: step 1, acquiring all data query requests from a client within unit time; counting the occurrence frequency of each data query request in the period of time, and sorti...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: LI FANGJIN
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The invention discloses a hotspot data caching method based on Redis. The hotspot data caching method comprises the following steps: step 1, acquiring all data query requests from a client within unit time; counting the occurrence frequency of each data query request in the period of time, and sorting all the data query requests according to the frequency from high to low; 2, taking N data query requests which are ranked first N, and querying data records corresponding to the N data query requests in a database; storing the N queried data records in a Redis cache. According to the invention, a large amount of hotspot data can be quickly stored in the Redis cache. 本发明公开了基于Redis的热点数据缓存方法,包括以下步骤:步骤一、获取单位时间内的所有来自客户端的数据查询请求;对该段时间内每个数据查询请求出现的频次进行统计,并按频次由高到低对所有的数据查询请求进行排序;步骤二、取排序前N的N个数据查询请求,在数据库中查询该N个数据查询请求对应的数据记录;查询到的N条数据记录存储至Redis缓存中。本发明其能够快速的在Redis缓存中存储大量的热点数据。