CN109783402A - A kind of method of dynamic adjustment caching hot spot data - Google Patents
A kind of method of dynamic adjustment caching hot spot data Download PDFInfo
- Publication number
- CN109783402A CN109783402A CN201811617920.2A CN201811617920A CN109783402A CN 109783402 A CN109783402 A CN 109783402A CN 201811617920 A CN201811617920 A CN 201811617920A CN 109783402 A CN109783402 A CN 109783402A
- Authority
- CN
- China
- Prior art keywords
- data
- caching
- hot spot
- cached
- temperature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000004364 calculation method Methods 0.000 claims abstract description 7
- 230000008569 process Effects 0.000 claims description 7
- 238000003032 molecular docking Methods 0.000 claims description 3
- 230000000717 retained effect Effects 0.000 claims description 2
- 230000001568 sexual effect Effects 0.000 claims 1
- 230000005484 gravity Effects 0.000 abstract 1
- 230000006870 function Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000007547 defect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The present invention relates to a kind of method that dynamic adjusts caching hot spot data, the present invention is adjusted the calculation method of hot spot data temperature by dynamic, precisely eliminates data cached calculation method, more accurately eliminate data cached, the high hot spot data of reserve value;Hot spot data specific gravity in caching is promoted, the cache hit rate of hot spot data is increased.
Description
Technical field
The present invention relates to a kind of methods of adjustment caching hot spot data, adjust and cache more specifically to a kind of dynamic
The method of hot spot data.
Background technique
In program function process, a large amount of data can be related to, if all data objects are all looked into function
It askes and calculates, can undoubtedly greatly promote the response time of program, cause entire function execution efficiency low, it is therefore desirable in program
In establish caching mechanism, the data object that may be used is cached.But caching mechanism also has several key point needs to examine
Consider: program running space be it is conditional, therefore spatial cache be also it is conditional, spatial cache should be according to program running space
Memory situation distributes reasonable space size;Since spatial cache is limited, the data object of caching is also limited, works as data object
Number needs reasonable mechanism close to when caching the upper limit to eliminate data object, it is ensured that the object left is all commonly used
Object (i.e. hot spot data).
F IFO is a kind of simple regulator algorithm, thinks that the data entered at first should be at first during the adjustment
It is eliminated, causes data cached hit rate low.Since FIFO algorithm does not account for data cached actual use situation,
The hot spot data retained in caching is not can guarantee yet.
Using lru algorithm carry out it is data cached eliminate, in the case where considering data cached history usage record, to most
The nearly few data of access times carry out superseded, reservation hot spot data that can be relatively good, but LRU emphasis consider it is data cached
Access account of the history, and have ignored data cached access times situation, in the case where the access of high concurrent system, be easy to lead
The very low data object of a large amount of newest accessed, access times in being full of in cause caching.
Summary of the invention
The technical problem to be solved in the present invention is that for the defects in the prior art, providing a kind of dynamic adjustment caching
The method of hot spot data.
The technical solution adopted by the present invention to solve the technical problems is: constructing a kind of dynamic adjustment caching hot spot data
Method, dynamic adjust the calculation method of hot spot data temperature, precisely eliminate data cached calculation method, promote data cached life
Middle rate.
In the method that dynamic of the present invention adjusts caching hot spot data, the dynamic adjustment caching hot spot data
Method and step are as follows:
S1 sets an access times threshold value M, is defined in systems when access times cannot greater than the data cached of threshold value
It is removed.
S2 sets one and caches superseded data amount check N every time, for that data cached ought reach the upper limit, needs to carry out data and washes in a pan
When eliminating, once eliminate how many a data cached.
S3 is searched in the buffer first when there is new data to be accessed, if energy cache hit, by the access of object
Number adds 1, and the data docking in caching is moved to stack top;If being unable to cache hit, by inquiry and calculates, generate
Data object is pressed into stack top by data object, and setting access count is 1.
Other data objects are to pressing one under stack in S4 caching.
If S5 caching does not arrive largest buffered number, data cached adjustment process terminates;If caching reaches largest buffered number,
Trigger cache cleaner process.
S6 cache cleaner program is found using least N number of data cached object is counted, is being looked into from the upward variable in stack bottom
During looking for, if the access times of Finding Object are greater than M, which is not belonging to eliminate data, and to the access meter of the object
Number subtracts 1.
The method for implementing a kind of dynamic adjustment caching hot spot data of the invention, has the advantages that the present invention more
Accurately eliminate data cached, the high hot spot data of reserve value;Promote data cached hit rate, it is ensured that caching can be promoted really
Program operational efficiency.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is data cached stacking flow chart of the invention
Fig. 2 is data cached superseded flow chart of the invention
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
As shown in Figure 1, the method and step of the dynamic adjustment caching hot spot data are as follows: S1 sets an access times threshold value
M, definition cannot be removed when access times are greater than the data cached of threshold value in systems.
S2 sets one and caches superseded data amount check N every time, for that data cached ought reach the upper limit, needs to carry out data and washes in a pan
When eliminating, once eliminate N number of data cached.
S3 is searched in the buffer first when there is new data to be accessed, if energy cache hit, by the access of object
Number adds 1, and the data docking in caching is moved to stack top;If being unable to cache hit, by inquiry and calculates, generate
Data object is pressed into stack top by data object, and setting access count is 1.
Other data objects are to pressing one under stack in S4 caching.
If S5 caching does not arrive largest buffered number, data cached adjustment process terminates;If caching reaches largest buffered number,
Trigger cache cleaner process.
S6 cache cleaner program is found using least N number of data cached object is counted, is being looked into from the upward variable in stack bottom
During looking for, if the access times of Finding Object are greater than M, which is not belonging to eliminate data, and to the access meter of the object
Number subtracts 1.
The calculation method of the dynamic adjustment hot spot data temperature calculates data by the access times of data in caching
Temperature, but if data for a long time at stack bottom, then the temperature of the data is gradually reduced, to realize the dynamic tune of data temperature
It is whole.On the basis of dynamic adjusting data temperature, the minimum data of not accessing for a long time, temperature are eliminated.Both it protected as far as possible
The data and the data least often accessed superseded as far as possible for staying access times most, realize that data cached competition is eliminated and are claimed
Precisely to eliminate data cached calculation method.
Although being disclosed by above embodiments to the present invention, scope of protection of the present invention is not limited thereto,
Under conditions of without departing from present inventive concept, deformation, the replacement etc. done to above each component will fall into right of the invention
In claimed range.
Claims (2)
1. a kind of method of dynamic adjustment caching hot spot data, which is characterized in that the side of the dynamic adjustment caching hot spot data
Method step are as follows:
S1 sets an access times threshold value M, and definition cannot be moved when access times are greater than the data cached of threshold value in systems
It removes;
S2 sets one and caches superseded data amount check N every time, for that data cached ought reach the upper limit, needs to carry out data and eliminates
When, one time sexual selection is N number of data cached;
S3 is searched in the buffer first when there is new data to be accessed, if energy cache hit, by the access times of object
Add 1, and the data docking in caching is moved to stack top;If being unable to cache hit, by inquiry and calculates, generate data
Data object is pressed into stack top by object, and setting access count is 1;
Other data objects are to pressing one under stack in S4 caching;
If S5 caching does not arrive largest buffered number, data cached adjustment process terminates;If caching reaches largest buffered number, trigger
Cache cleaner process;
S6 cache cleaner program is found using least N number of data cached object is counted, was being searched from the upward variable in stack bottom
Cheng Zhong, if the access times of Finding Object are greater than M, which is not belonging to eliminate data, and subtracts to the access count of the object
1。
2. the method for dynamic adjustment caching hot spot data according to claim 1, which is characterized in that the dynamic adjustment heat
The calculation method of point data temperature calculates the temperature of data by the access times of data in caching, but if data are for a long time
At stack bottom, then the temperature of the data is gradually reduced, to realize the dynamic adjustment of data temperature;In dynamic adjusting data temperature
On the basis of, the minimum data of not accessing for a long time, temperature are eliminated;Not only retained the most data of access times as far as possible but also
The data least often accessed are eliminated as far as possible, are realized that data cached competition is eliminated to be referred to as and are precisely eliminated data cached calculating
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811617920.2A CN109783402A (en) | 2018-12-28 | 2018-12-28 | A kind of method of dynamic adjustment caching hot spot data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811617920.2A CN109783402A (en) | 2018-12-28 | 2018-12-28 | A kind of method of dynamic adjustment caching hot spot data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783402A true CN109783402A (en) | 2019-05-21 |
Family
ID=66498774
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811617920.2A Pending CN109783402A (en) | 2018-12-28 | 2018-12-28 | A kind of method of dynamic adjustment caching hot spot data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783402A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905129A (en) * | 2021-05-06 | 2021-06-04 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120317338A1 (en) * | 2011-06-09 | 2012-12-13 | Beijing Fastweb Technology Inc. | Solid-State Disk Caching the Top-K Hard-Disk Blocks Selected as a Function of Access Frequency and a Logarithmic System Time |
CN103593304A (en) * | 2012-08-14 | 2014-02-19 | 吉林师范大学 | Quantization method for efficiently using caches on basis of parallel device model |
CN106897030A (en) * | 2017-02-28 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of data cached management method and device |
CN107463509A (en) * | 2016-06-05 | 2017-12-12 | 华为技术有限公司 | Buffer memory management method, cache controller and computer system |
CN107577618A (en) * | 2017-09-13 | 2018-01-12 | 武大吉奥信息技术有限公司 | A kind of balanced caching in three roads eliminates method and device |
-
2018
- 2018-12-28 CN CN201811617920.2A patent/CN109783402A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120317338A1 (en) * | 2011-06-09 | 2012-12-13 | Beijing Fastweb Technology Inc. | Solid-State Disk Caching the Top-K Hard-Disk Blocks Selected as a Function of Access Frequency and a Logarithmic System Time |
CN103593304A (en) * | 2012-08-14 | 2014-02-19 | 吉林师范大学 | Quantization method for efficiently using caches on basis of parallel device model |
CN107463509A (en) * | 2016-06-05 | 2017-12-12 | 华为技术有限公司 | Buffer memory management method, cache controller and computer system |
CN106897030A (en) * | 2017-02-28 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of data cached management method and device |
CN107577618A (en) * | 2017-09-13 | 2018-01-12 | 武大吉奥信息技术有限公司 | A kind of balanced caching in three roads eliminates method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905129A (en) * | 2021-05-06 | 2021-06-04 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
CN112905129B (en) * | 2021-05-06 | 2021-08-13 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9501420B2 (en) | Cache optimization technique for large working data sets | |
CN108763110B (en) | Data caching method and device | |
CN104834675B (en) | Query performance optimization method based on user behavior analysis | |
US10270876B2 (en) | Probability based caching and eviction | |
US8447948B1 (en) | Dynamic selective cache compression | |
US20160371014A1 (en) | Ordering Memory Commands in a Computer System | |
US20160335177A1 (en) | Cache Management Method and Apparatus | |
CN107247675B (en) | A kind of caching selection method and system based on classification prediction | |
TW201432451A (en) | Method to throttle rate of data caching for improved I/O performance | |
CN109144895B (en) | Data storage method and device | |
CN104657286A (en) | Hierarchical storage method and device | |
TWI533146B (en) | Virtual resource adjusting method, device and computer readable storage medium for storing thereof | |
CN106648456A (en) | Dynamic save file access method based on use page view and prediction mechanism | |
CN109413694B (en) | Small cell caching method and device based on content popularity prediction | |
CN109783402A (en) | A kind of method of dynamic adjustment caching hot spot data | |
CN108459972B (en) | Efficient cache management design method for multi-channel solid state disk | |
CN113094392A (en) | Data caching method and device | |
US10841394B2 (en) | Server for caching session information set and method of controlling cache of session information set | |
CN115640313A (en) | Intelligent query plan cache size management | |
US8250302B2 (en) | Cache management using sampled values assigned to a request | |
CN110008190B (en) | Periodic small file cache replacement method | |
Zhang et al. | L-qoco: learning to optimize cache capacity overloading in storage systems | |
KR20110115759A (en) | Buffer cache managing method using ssd(solid state disk) extension buffer and apparatus for using ssd(solid state disk) as extension buffer | |
CN102097128A (en) | Self-adaptive buffer area replacement method based on flash memory | |
CN114153760B (en) | Method, system and storage medium for eliminating healthy value storage cache based on weight |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190521 |
|
RJ01 | Rejection of invention patent application after publication |