CN113111014B - Method, device, equipment and storage medium for cleaning non-hot data in cache - Google Patents
Method, device, equipment and storage medium for cleaning non-hot data in cache Download PDFInfo
- Publication number
- CN113111014B CN113111014B CN202110372309.3A CN202110372309A CN113111014B CN 113111014 B CN113111014 B CN 113111014B CN 202110372309 A CN202110372309 A CN 202110372309A CN 113111014 B CN113111014 B CN 113111014B
- Authority
- CN
- China
- Prior art keywords
- data
- cache
- cleaning
- time
- execution
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0891—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本发明公开了缓存中非热点数据的清理方法、装置、设备及存储介质,缓存中非热点数据的清理方法,包括:步骤一,将缓存数据分区;步骤二,设定执行频率HZ和每次执行时间限制TIME;步骤三,根据步骤二设定的执行频率HZ和每次执行时间限制TIME随机抽取所述步骤一分区内的数据进行非热点数据的清理。采用定时清理的策略清理存储系统缓存非热点数据,并通过设定频率和最大执行时间保证了对cpu和存储空间的友好,通过数据块分区和随机选取数据块的方式,保证了数据块清理的效率和在整个缓存空间的平滑性。The invention discloses a cleaning method, device, equipment and storage medium for non-hot data in the cache. The cleaning method for the non-hot data in the cache includes: step 1, partitioning the cache data; step 2, setting the execution frequency HZ and each time Execution time limit TIME; step 3, according to the execution frequency HZ set in step 2 and each execution time limit TIME, randomly extract the data in the partition of the step 1 to clean up non-hot data. The strategy of regular cleaning is used to clean the non-hot data in the storage system cache, and the friendliness to the cpu and storage space is ensured by setting the frequency and the maximum execution time, and the data block cleaning is ensured through data block partitioning and random selection of data blocks. efficiency and smoothness across the cache space.
Description
技术领域technical field
本发明涉及缓存数据的清理技术领域,尤其涉及一种缓存中非热点数据的清理方法、装置、设备及存储介质。The present invention relates to the technical field of clearing cached data, in particular to a method, device, device and storage medium for clearing non-hot data in a cache.
背景技术Background technique
在存储系统中存储介质多种多样,其读写性能也有较大差距,为了提高整体系统的访问性能,往往会使用高性能的设备做为低性能设备的缓存设备。同时由于高新能设备的成本问题,往往缓存设备的容量比较小,因此往往需要对缓存数据进行热度统计,对非热点数据使用一定的策略进行清理。一般来讲主要有三种不同的清理策略,立即清理、惰性清理和定时清理。There are many kinds of storage media in the storage system, and their read and write performance also has a large gap. In order to improve the access performance of the overall system, high-performance devices are often used as cache devices for low-performance devices. At the same time, due to the cost of high-tech equipment, the capacity of cache equipment is often relatively small. Therefore, it is often necessary to conduct heat statistics on cache data and use certain strategies to clean up non-hot data. Generally speaking, there are three different cleaning strategies, immediate cleanup, lazy cleanup, and scheduled cleanup.
立即清理即在设置数据热度的时候,创建一个回调条件,当热度降低到阈值时,由处理逻辑自动进行数据清理。这种方案对cpu不太友好,会占用大量cpu时间。Immediate cleaning is to create a callback condition when setting the data temperature. When the temperature drops to the threshold, the processing logic will automatically clean the data. This solution is not very cpu-friendly and will take up a lot of cpu time.
惰性清理指的是数据过期了不予处理,直到下次访问到这部分数据的时候如果发现数据冷却则进行数据清理。这种方案对存储不太友好,会占用大量存储空间。Lazy cleanup means that the data will not be processed if it expires, until the next access to this part of the data, if the data is found to be cold, the data will be cleaned up. This solution is not very friendly to storage and will take up a lot of storage space.
定时清理是每隔一段时间对数据进行检查,清理冷却数据。这样会减少清理对cpu和存储空间的影响。但是如果执行的太频繁或者执行的时间太长,定期清理策略又会退化成立即清理策略,这样会消耗大量cpu的时间。如果执行的太少,或者执行的时间太短,定时清理策略又会退化成惰性清理策略,出现浪费存储空间的情况。Scheduled cleaning is to check the data at regular intervals and clean and cool down the data. This will reduce the impact of cleaning on cpu and storage space. However, if it is executed too frequently or for too long, the regular cleaning strategy will degenerate into an immediate cleaning strategy, which will consume a lot of cpu time. If it is executed too little, or the execution time is too short, the scheduled cleanup strategy will degenerate into an inert cleanup strategy, resulting in a waste of storage space.
发明内容Contents of the invention
本发明的目的就是为了解决上述问题,提供一种缓存中非热点数据的清理方法、装置、设备及存储介质。通过数据块分区和随机选取数据块的方式定时清理,保证了数据块清理的效率和在整个缓存空间的平滑性。The object of the present invention is to solve the above problems, and provide a method, device, equipment and storage medium for cleaning non-hot data in the cache. Regular cleaning through data block partitioning and random selection of data blocks ensures the efficiency of data block cleaning and the smoothness of the entire cache space.
为了实现上述目的,本发明采用如下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
缓存中非热点数据的清理方法,包括:Methods for cleaning non-hot data in the cache, including:
步骤一,将缓存数据分区;Step 1, partition the cached data;
步骤二,设定执行频率HZ和每次执行时间限制TIME;Step 2, set the execution frequency HZ and each execution time limit TIME;
步骤三,根据步骤二设定的执行频率HZ和每次执行时间限制TIME随机抽取所述步骤一分区内的数据进行非热点数据的清理。Step 3: According to the execution frequency HZ set in step 2 and the execution time limit TIME for each execution, randomly extract the data in the partition of the step 1 to clean up the non-hot data.
所述步骤一中,将缓存数据分区,并将分区内的数据分为多个数据块。In the first step, the cached data is partitioned, and the data in the partition is divided into multiple data blocks.
所述每次执行时间限制TIME=10000*可以接受的每次最大检测的数据块个数/HZ,执行频率与每次执行时间限制成反比关系。这样可以保证每次淘汰不会阻塞过多请求。The time limit for each execution TIME=10000*the maximum acceptable number of data blocks detected each time/HZ, and the execution frequency is inversely proportional to the time limit for each execution. This ensures that each elimination will not block too many requests.
所述步骤三中,按照设定的执行频率HZ每次检查一个分区,每个分区随机抽取设定个的数据块进行检查,如果热度过期就清理掉;如果清理完成或者到达最长执行时间就结束。In said step 3, check one partition each time according to the set execution frequency HZ, each partition randomly selects a set data block for inspection, and cleans up if the heat is overdue; if the cleaning is completed or reaches the longest execution time, then Finish.
所述步骤三中,如果本次清理的分区内随机的设定个数的数据块中有大于设定值的数据块需要清理,那么下个清理周期继续清理本次的分区内的数据块。In the step 3, if there are data blocks larger than the set value among the randomly set number of data blocks in the partition to be cleaned this time, then the next cleaning cycle will continue to clean up the data blocks in the partition this time.
每个数据块最多连续检查3次。Each data block is checked up to 3 times in a row.
一种缓存中非热点数据的清理装置,包括:A device for cleaning non-hot data in a cache, comprising:
数据区域划分模块,用于将缓存数据分区;The data area division module is used to partition the cache data;
限制设定模块,用于设定执行频率HZ和每次执行时间限制TIME;Limit setting module, used to set the execution frequency HZ and each execution time limit TIME;
非热点数据清理模块,用于根据设定的执行频率HZ和每次执行时间限制TIME随机抽取分区内的数据进行非热点数据的清理。The non-hot data cleaning module is used to randomly extract the data in the partition according to the set execution frequency HZ and each execution time limit TIME to clean the non-hot data.
一种设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现所述缓存中非热点数据的清理方法的步骤。A device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method for clearing non-hot data in the cache when executing the computer program.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现所述缓存中非热点数据的清理方法的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for cleaning non-hot data in the cache are implemented.
本发明的有益效果:Beneficial effects of the present invention:
本发明采用定时清理的策略清理存储系统缓存非热点数据,并通过设定频率和最大执行时间保证了对cpu和存储空间的友好,通过数据块分区和随机选取数据块的方式,保证了数据块清理的效率和在整个缓存空间的平滑性。The present invention adopts the strategy of timing cleaning to clean up non-hot data in the cache of the storage system, and ensures friendliness to the cpu and storage space by setting the frequency and the maximum execution time, and ensures the data block by partitioning the data block and randomly selecting the data block Cleanup efficiency and smoothness across the cache space.
通过每隔一段时间执行一次清理操作,并通过限制清理操作执行的时长和频率,来减少删除操作对cpu的影响和对存储空间的浪费。By performing a cleaning operation at regular intervals, and by limiting the duration and frequency of cleaning operations, the impact of deletion operations on the CPU and the waste of storage space are reduced.
具体实施方式detailed description
下面结合实施例对本发明作进一步说明。The present invention will be further described below in conjunction with embodiment.
缓存中非热点数据的清理方法,包括:Methods for cleaning non-hot data in the cache, including:
(1)设定执行频率HZ。(1) Set the execution frequency HZ.
(2)通过公式:每次执行时间限制TIME=10000*可以接受的每次最大检测的数据块个数/HZ得到每次执行时间限制TIME,执行频率与每次执行时间限制成反比关系,这样可以保证每次淘汰不会阻塞过多请求。(2) Through the formula: each execution time limit TIME=10000*acceptable maximum number of detected data blocks/HZ to obtain each execution time limit TIME, the execution frequency is inversely proportional to each execution time limit, like this It can be guaranteed that each elimination will not block too many requests.
(3)将缓存数据分区比如分0-9十个区。(3) Divide the cached data into ten areas from 0 to 9, for example.
(4)根据执行频率按时进行数据块检查。(4) Check the data block on time according to the execution frequency.
(5)每次检查一个分区,每个分区随机抽取20个数据块进行检查,如果热度过期就清理掉。如果清理完成或者到达最长执行时间就结束。(5) Check one partition at a time, randomly select 20 data blocks from each partition for inspection, and clean up if the heat is overdue. If the cleanup is complete or the maximum execution time is reached, it will end.
(6)如果本次清理区域随机20个中有大于15个(可以配置其他值)需要清理那么下个清理周期继续清理这个数据块,每个数据块最多连续检查3次。其余情况检查下个数据块。(6) If more than 15 out of 20 random areas in this cleanup area (other values can be configured) need to be cleaned up, then the next cleanup cycle will continue to clean up this data block, and each data block will be checked up to 3 times in a row. In other cases check the next data block.
本发明在存储系统缓存管理中,使用数据分区按区域随机抽取数据检测的定频率定时长按时清理策略,完成缓存空间管理,降低资源消耗。In the cache management of the storage system, the present invention uses a fixed-frequency, fixed-time, long-term, and on-time cleaning strategy of randomly extracting data by area for data partitioning to complete cache space management and reduce resource consumption.
一种缓存中非热点数据的清理装置,包括:A device for cleaning non-hot data in a cache, comprising:
数据区域划分模块,用于将缓存数据分区;The data area division module is used to partition the cache data;
限制设定模块,用于设定执行频率HZ和每次执行时间限制TIME;Limit setting module, used to set the execution frequency HZ and each execution time limit TIME;
非热点数据清理模块,用于根据设定的执行频率HZ和每次执行时间限制TIME随机抽取分区内的数据进行非热点数据的清理。The non-hot data cleaning module is used to randomly extract the data in the partition according to the set execution frequency HZ and each execution time limit TIME to clean the non-hot data.
使用一种通过对缓存数据分区随机抽取清理并设定频率和最大执行时间的定时清理策略清理存储系统中缓存设备中非热点数据的方案,可以提高清理数据的效率并有效的利用CPU性能和缓存空间。Using a timing cleaning strategy to clean up non-hot data in the cache device in the storage system by randomly extracting and cleaning the cache data partition and setting the frequency and maximum execution time can improve the efficiency of cleaning data and effectively utilize CPU performance and cache space.
一种设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现所述缓存中非热点数据的清理方法的步骤。A device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method for clearing non-hot data in the cache when executing the computer program.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现缓存中非热点数据的清理方法的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for clearing non-hot data in the cache are realized.
上述虽然对本发明的具体实施方式进行了描述,但并非对本发明保护范围的限制,所属领域技术人员应该明白,在本发明的技术方案的基础上,本领域技术人员不需要付出创造性劳动即可做出的各种修改或变形仍在本发明的保护范围以内。Although the specific implementation of the present invention has been described above, it is not a limitation to the protection scope of the present invention. Those skilled in the art should understand that on the basis of the technical solution of the present invention, those skilled in the art can do it without creative work. Various modifications or deformations are still within the protection scope of the present invention.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110372309.3A CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device, equipment and storage medium for cleaning non-hot data in cache |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110372309.3A CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device, equipment and storage medium for cleaning non-hot data in cache |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113111014A CN113111014A (en) | 2021-07-13 |
| CN113111014B true CN113111014B (en) | 2023-01-06 |
Family
ID=76714301
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110372309.3A Active CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device, equipment and storage medium for cleaning non-hot data in cache |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113111014B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5875464A (en) * | 1991-12-10 | 1999-02-23 | International Business Machines Corporation | Computer system with private and shared partitions in cache |
| JP2016157278A (en) * | 2015-02-25 | 2016-09-01 | Necエンジニアリング株式会社 | Cache memory, access method in cache memory and program for accessing cache memory |
| CN109977129A (en) * | 2019-03-28 | 2019-07-05 | 中国联合网络通信集团有限公司 | Multi-stage data caching method and equipment |
Family Cites Families (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4183400B2 (en) * | 2001-06-27 | 2008-11-19 | 株式会社日立製作所 | Database system, database management method and program |
| US20100262687A1 (en) * | 2009-04-10 | 2010-10-14 | International Business Machines Corporation | Dynamic data partitioning for hot spot active data and other data |
| JP5999645B2 (en) * | 2009-09-08 | 2016-10-05 | ロンギチュード エンタープライズ フラッシュ エスエイアールエル | Apparatus, system, and method for caching data on a solid state storage device |
| US9569134B2 (en) * | 2010-08-23 | 2017-02-14 | Quantum Corporation | Sequential access storage and data de-duplication |
| US8838897B2 (en) * | 2011-06-29 | 2014-09-16 | New Jersey Institute Of Technology | Replicating tag entries for reliability enhancement in cache tag arrays |
| US10108690B1 (en) * | 2013-06-06 | 2018-10-23 | Amazon Technologies, Inc. | Rolling subpartition management |
| CN105468473B (en) * | 2014-07-16 | 2019-03-01 | 北京奇虎科技有限公司 | Data migration method and data migration device |
| CN105302493B (en) * | 2015-11-19 | 2018-04-17 | 浪潮(北京)电子信息产业有限公司 | The swapping in and out control method and system that SSD is cached in a kind of mixing storage array |
| US10198461B2 (en) * | 2016-05-06 | 2019-02-05 | Masergy Communications, Inc. | Data storage system |
| CN106599113B (en) * | 2016-11-30 | 2019-12-10 | 武汉虹信通信技术有限责任公司 | Database reading and writing method for mass performance data of network management system |
| CN106604111A (en) * | 2016-12-16 | 2017-04-26 | 深圳市九洲电器有限公司 | Set-top box Flash data storage method and set-top box Flash data storage system |
| CN109857725A (en) * | 2019-02-20 | 2019-06-07 | 北京百度网讯科技有限公司 | Data base management method and device, server and computer-readable medium |
| CN110187836B (en) * | 2019-05-29 | 2022-09-02 | 北京奇艺世纪科技有限公司 | Data deleting method and device, computer and storage medium |
| CN112840334B (en) * | 2019-09-25 | 2024-06-11 | 华为云计算技术有限公司 | Method, device, management node and storage medium for managing data of partition table |
| CN111309251A (en) * | 2020-01-21 | 2020-06-19 | 青梧桐有限责任公司 | Data storage method, system, electronic device and readable storage medium |
| CN111858403B (en) * | 2020-07-17 | 2022-07-08 | 苏州浪潮智能科技有限公司 | Cache data heat management method and system based on probability-based access frequency count |
| CN112527786B (en) * | 2020-12-17 | 2024-07-05 | 平安银行股份有限公司 | Data table partition newly-adding method and device, computer equipment and storage medium |
-
2021
- 2021-04-07 CN CN202110372309.3A patent/CN113111014B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5875464A (en) * | 1991-12-10 | 1999-02-23 | International Business Machines Corporation | Computer system with private and shared partitions in cache |
| JP2016157278A (en) * | 2015-02-25 | 2016-09-01 | Necエンジニアリング株式会社 | Cache memory, access method in cache memory and program for accessing cache memory |
| CN109977129A (en) * | 2019-03-28 | 2019-07-05 | 中国联合网络通信集团有限公司 | Multi-stage data caching method and equipment |
Non-Patent Citations (3)
| Title |
|---|
| 8th International Conference on Integrated Power Electronics Systems>.2014, * |
| Marco DenkA.Efficient online-algorithm for the temperature cycle recording of an IGBT power module in a hybrid car during inverter operation.< CIPS 2014 * |
| 一种支持大页的层次化DRAM/NVM混合内存系统;陈吉等;《计算机研究与发展》;20180915(第09期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113111014A (en) | 2021-07-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| DE602005005035T2 (en) | METHOD FOR CARRYING OUT OPERATIONS WHICH ARE TO BE CARRIED OUT BY A COMPONENT WITH A THERMAL THRESHOLD, AND A PROCESSING SYSTEM USING A PROSCESSOR | |
| US9471495B2 (en) | Method and apparatus for constructing memory access model | |
| CN106951187B (en) | Method for realizing static wear balance of solid-state storage | |
| WO2016141735A1 (en) | Cache data determination method and device | |
| WO2017117734A1 (en) | Cache management method, cache controller and computer system | |
| TW201535366A (en) | Handling maximum activation count limit and target row refresh in ddr4 SDRAM | |
| CN103034538B (en) | Multi-level cache processing method of drive program in embedded type operation system | |
| US10198180B2 (en) | Method and apparatus for managing storage device | |
| CN108572799B (en) | Data page migration method of heterogeneous memory system of bidirectional hash chain table | |
| WO2018121242A1 (en) | Multiple buffer-based data elimination method and device | |
| JP2008505389A5 (en) | ||
| CN104346286A (en) | Data storage device and flash memory control method | |
| CN104460941A (en) | Method for reducing power consumption of main memory under full load operation | |
| CN113111014B (en) | Method, device, equipment and storage medium for cleaning non-hot data in cache | |
| CN111858031A (en) | A cluster distributed resource scheduling method, device, equipment and storage medium | |
| CN105808150B (en) | Solid state disk cache system for hybrid storage device | |
| CN109558093A (en) | A kind of mixing memory pages moving method for image processing type load | |
| CN114237501B (en) | Method for rapidly identifying cold data and computer readable storage medium | |
| CN106155923B (en) | Method and apparatus for memory sharing | |
| WO2016147279A1 (en) | Data management control program, data management control device, and data management control method | |
| TWI610163B (en) | Utilizing grouping to facilitate fast switching | |
| CN115202582A (en) | A data deletion method, device, electronic device and storage medium | |
| TWI865333B (en) | Computing platform system and graphics processing unit resource management method thereof | |
| CN106155938A (en) | Postpone cache replacement method and the device in PCM internal memory service life | |
| RU2805012C2 (en) | Method of data storage system management and data storage system |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |