CN102521161A - Data caching method, device and server - Google Patents

Data caching method, device and server Download PDF

Info

Publication number
CN102521161A
CN102521161A CN2011103715498A CN201110371549A CN102521161A CN 102521161 A CN102521161 A CN 102521161A CN 2011103715498 A CN2011103715498 A CN 2011103715498A CN 201110371549 A CN201110371549 A CN 201110371549A CN 102521161 A CN102521161 A CN 102521161A
Authority
CN
China
Prior art keywords
data
disk
buffer memory
raw data
newly
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.)
Granted
Application number
CN2011103715498A
Other languages
Chinese (zh)
Other versions
CN102521161B (en
Inventor
王婷
方帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201110371549.8A priority Critical patent/CN102521161B/en
Publication of CN102521161A publication Critical patent/CN102521161A/en
Priority to PCT/CN2012/084951 priority patent/WO2013075627A1/en
Application granted granted Critical
Publication of CN102521161B publication Critical patent/CN102521161B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data caching method, device and server which can improve the hit ratio of the cache and improve the operating speed of the system. The data caching method comprises the following steps of: judging whether raw data in a disk of new data in the cache are in the same mapping group with raw data in the disk of data to be replaced in the cache, wherein the mapping group is one or multiple storage groups corresponding to one storage group in the cache; if the raw data in the disk of the new data in the cache are not in the same mapping with the raw data in the disk of the data to be replaced in the cache, migrating the raw data in the disk of the new data in the cache to the same mapping group of the disk with the raw data in the disk of the data to be replaced in the cache; and writing the new data in the cache into a storage position in the cache of the data to be replaced in the cache. The method, the device and the server provided by the invention are applied to the field of data cache.

Description

A kind of caching method of data, device and server
Technical field
The present invention relates to the metadata cache field, relate in particular to a kind of caching method, device and server of data.
Background technology
I/O between disk and internal memory (Input/Output, input and output) speed is an important bottleneck of system performance always.In order to improve the speed of system, a lot of systems add level cache between internal memory and disk, be used to deposit the instruction and data that CPU need move in the recent period, can improve the access speed of CPU to disk at present.
The continuous mapped mode of main employing group between disk and the buffer memory is that unit management is data cached with the group in the prior art.The storage space of disk and buffer memory all is divided into the identical group of size; Usually the storage space of disk is more a lot of greatly than the storage space of buffer memory; The data of a plurality of storage sets will correspondence be cached to same storage sets in the buffer memory in the disk, mapping group like this be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.
State in realization in the process of the continuous mapping of buffer memory group, buffer memory is that unit management is data cached with the group.Newly advancing data in the buffer memory will store in the buffer memory; The raw data of data in the buffer memory that is replaced in disk must with buffer memory in newly advance the raw data of data in disk and be positioned at same mapping group; Data in the buffer memory that is replaced like this possibly be the data of focus comparatively in the whole buffer memory, and can not replace non-hot spot data or the coldest data that are positioned at other storage sets in the whole buffer memory.And these non-hot spot datas or the coldest data occupancy spatial cache can not make other hot spot data be stored in the buffer memory, thereby can influence the hit rate of buffer memory, reduce the operating rate of system.
Summary of the invention
Embodiments of the invention provide a kind of caching method, device and server of data, have improved the hit rate of buffer memory and the speed of system's operation.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of caching method of data comprises:
Judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets;
Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk newly advancing the raw data of data in disk in the said buffer memory;
Write and treat the memory location of replacement data in said buffer memory in the said buffer memory newly advancing data in the said buffer memory.
A kind of buffer storage of data comprises:
First judging unit; Judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets;
The disk migration units; Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, be used for that said buffer memory is newly advanced the raw data of data in disk and move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk;
The buffer memory writing unit is used for that said buffer memory is newly advanced data and writes and treat the memory location of replacement data in said buffer memory in the said buffer memory.
A kind of server comprises the buffer storage of above-mentioned data.
The embodiment of the invention provides a kind of caching method, device and server of data, and to link to each other that the pattern of mapping carries out with the group be the buffer memory that unit carries out data to the employing group between disk and the buffer memory.Through will with buffer memory in treat that the raw data of replacement data in disk belongs to and newly advance the raw data of data in disk in the buffer memory of different mappings group and move to and treat in the buffer memory in the identical disk mapping group of the raw data of replacement data in disk that what target was arranged treats the memory location of replacement data in buffer memory with newly advancing data storage in the buffer memory in buffer memory.The more effective data that are of little use in the buffer memory of getting rid of of ability like the coldest data or non-hot spot data, make hot spot data can not be replaced out buffer memory, thereby can improve the hit rate of buffer memory like this, improve the operating rate of system.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of the caching method of the data that Fig. 1 provides for the embodiment of the invention one;
The structural representation of the buffer storage of the data that Fig. 2 provides for the embodiment of the invention one;
The schematic flow sheet of the caching method of the data that Fig. 3 provides for the embodiment of the invention two;
The structural representation of the buffer storage of the data that Fig. 4 provides for the embodiment of the invention three;
Fig. 5 is link to each other with the buffer memory employing group synoptic diagram of mode of mapping of disk;
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Embodiment one
The embodiment of the invention provides a kind of caching method of data, and is as shown in Figure 1, comprising:
S101, judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.
If newly advance in the said buffer memory in the raw data of data in disk and the said buffer memory and treat that the raw data of replacement data in disk is not arranged in the data of the same mapping group of disk, execution S102 step; If newly advance in the buffer memory in the raw data of data in disk and the buffer memory and treat that the raw data of replacement data in disk is arranged in the data of the same mapping group of disk, execution S103 step.
S102, move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk newly advancing the raw data of data in disk in the said buffer memory.
S103, write and treat the memory location of replacement data in said buffer memory in the said buffer memory newly advancing data in the said buffer memory.
Treat in the concrete buffer memory replacement data can through to data in buffer according to adding up by the access time with by access frequency, obtain the coldest data or non-hot spot data as said replacement data.
The embodiment of the invention also provides a kind of buffer storage of data, and is as shown in Figure 2, comprising: first judging unit 21, disk migration units 22 and buffer memory writing unit 23.
First judging unit 21; Be used for judging buffer memory newly advances in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.
The disk migration units; Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, be used for that said buffer memory is newly advanced the raw data of data in disk and move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk.
Buffer memory writing unit 23 is used for that said buffer memory is newly advanced data and writes and treat the memory location of replacement data in said buffer memory in the said buffer memory.
A kind of server comprises the buffer storage of above-mentioned data.
The embodiment of the invention provides a kind of caching method, device and server of data, and to link to each other that the pattern of mapping carries out with the group be the buffer memory that unit carries out data to the employing group between disk and the buffer memory.Through will with buffer memory in treat that the raw data of replacement data in disk belongs to and newly advance the raw data of data in disk in the buffer memory of different mappings group and move to and treat in the buffer memory in the identical disk mapping group of the raw data of replacement data in disk that what target was arranged treats the memory location of replacement data in buffer memory with newly advancing data storage in the buffer memory in buffer memory.The more effective data that are of little use in the buffer memory of getting rid of of ability like the coldest data or non-hot spot data, make hot spot data can not be replaced out buffer memory, thereby can improve the hit rate of buffer memory like this, improve the operating rate of system.
Embodiment two,
The embodiment of the invention provides a kind of caching method of data, and is as shown in Figure 3, comprising:
S301, judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.
If newly advance in the said buffer memory in raw data and the said buffer memory of data in disk and treat that the raw data of replacement data in disk is not arranged in the data of the same mapping group of disk, then carries out the S302 step; As if treating that the raw data of replacement data in disk is positioned at the data of same mapping group, then carries out the S305 step in the raw data in disk of newly advancing data in the said buffer memory and the said buffer memory.
S302, judge and treat in the said buffer memory whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full.
If it is full to treat that the raw data of replacement data in disk is arranged in the storage space of mapping group of disk in the said buffer memory, then carry out S303; If treat in the said buffer memory raw data of replacement data in disk be arranged in disk the mapping group storage space less than, then carry out S304.
Newly enter the memory location of treating the raw data of replacement data in disk in raw data and the buffer memory of data in disk in S303, the cache exchanging.
Newly advancing the raw data of data in disk in S304, the said buffer memory moves to and treats in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk.
S305, write and treat the memory location of replacement data in said buffer memory in the said buffer memory newly advancing data in the said buffer memory.
Wherein, treat in the said buffer memory replacement data can through to data in buffer according to adding up by the access time with by access frequency, obtain the coldest data or non-hot spot data as said replacement data.
Further; Can also in cache exchanging, newly advance treat the memory location of the raw data of replacement data in disk in raw data and the buffer memory of data in disk after; Treat the exchanges data memory location that the raw data of replacement data in disk is related with newly advancing in the buffer memory in the related not data cached and buffer memory of the raw data of data in disk; Newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous, it is continuous to treat in the said buffer memory to treat in data that the raw data of replacement data in disk is related and the buffer memory that the raw data of replacement data in disk is positioned at the data and the physical storage address of the same storage sets of disk.
Further; After can also in said buffer memory, newly advancing the original data storage of data in disk and treating the clear position of the mapping group under the raw data of replacement data in disk in the said buffer memory; Do not store related data cached of the raw data in disk of newly advancing data in the buffer memory into treat the mapping group under the raw data of replacement data in disk in the buffer memory clear position, newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous.
Above-mentioned buffer memory can adopt non-volatile storage medium, like the high-speed cache medium of SSD (solid state disk, solid state hard disc), PCM (phase-change memory, phase transition storage).
Below our detailed process of data in magnetic disk caching method that the embodiment of the invention is provided be elaborated.
I/O speed between disk and internal memory is an important bottleneck of system performance always, between disk and internal memory, adds level cache, can effectively improve I/O speed.
Employing group between disk and the disk buffering pattern that links to each other is that unit management is data cached with the group.As shown in Figure 5; The storage space of disk and buffer memory is divided into onesize storage sets; Suppose to have in the buffer memory N storage sets; The M blocks of data is arranged in each storage sets,, in disk, have a plurality of storage sets can be mapped to the same storage sets of buffer memory like this because the storage space of disk is more a lot of greatly than the storage space of buffer memory.Exemplary, 3 storage sets being arranged by the same storage sets of correspondence mappings among Fig. 5 in the disk respectively to buffer memory, these 3 storage sets are called the mapping group of disk.As the mapping group c1 that to scheme A1c1, A2c1, three storage sets of A3c1 be disk, the data among this mapping group c1 can only be mapped in the C1 storage sets of buffer memory.Supposing the system uses certain blocks of data m1 among a certain storage sets A3cN among the mapping group cN, is used the back at m1 data m1 is revised.Amended data content becomes m1A3, and m1A3 will be stored in the buffer memory as newly advancing data in the buffer memory.And the raw data m1 of m1A3 in disk belongs to the data among the mapping group cN.Like this storage space of buffer memory CN storage sets less than situation under, newly advance the clear position that data m1A3 just can directly store the CN storage sets of buffer memory in the buffer memory.
And under the full situation of the storage space of buffer memory C1 storage sets; In order to improve cache hit rate; The travelling speed of raising system; Buffer memory can count the coldest data or non-hot spot data as treating replacement data in the buffer memory according to being stored in time that the data in the buffer memory are visited and the frequency of being visited, and has being written to of target to treat the memory location of replacement data in buffer memory in the buffer memory with newly advancing data in the buffer memory.
Disposal system can judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory like this, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.As if treating that the raw data of replacement data in disk is arranged in the same mapping group of disk in the raw data in disk of newly advancing data in the buffer memory and the buffer memory; Mode according to the continuous mapping of group; For SSD buffer memory medium; Need earlier in buffer memory directly this is treated that replacement data wipes, write and treat the memory location of replacement data newly advancing data in the buffer memory then at buffer memory.
Treat that the raw data of replacement data in disk is not arranged in the data of the same mapping group of disk if disposal system is judged newly to advance in the buffer memory in raw data and the buffer memory of data in disk, disposal system is further judged and is treated in the buffer memory whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full.
If treat that the storage space that the raw data of replacement data in disk is arranged in the mapping group of disk is taken in the buffer memory, disposal system treats that with newly advancing in the buffer memory in raw data and the buffer memory of data in disk the raw data of replacement data in disk exchanges the memory location each other so.
Further; Disposal system can also be treated the exchanges data memory location that the raw data of replacement data in disk is related with newly advancing in the buffer memory in the related not data cached and buffer memory of the raw data of data in disk, advances newly in the said buffer memory that the raw data in disk of newly advancing data in the not data cached and buffer memory of the raw data association of data in disk is positioned at the same storage sets of disk and physical storage address is continuous.Treat in the said buffer memory to treat that the raw data of replacement data in disk is positioned at the same storage sets of disk and physical storage address is continuous in data that the raw data of replacement data in disk is related and the buffer memory.In need be, newly advance related not data cached of the raw data of data in disk then when storing buffer memory into, directly store in the buffer memory buffer memory.Can effectively upgrade the data in the buffer memory so that disposal system is carried out buffer memory to the data in the disk more fast like this.
Be arranged under the situation that the storage space of the mapping group of disk also do not taken if treat the raw data of replacement data in disk in the buffer memory, disposal system is moved to and is treated in the buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk newly advancing the raw data of data in disk in the buffer memory so.Further; Disposal system can also treat in the buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk with newly advancing related not data cached the moving to of the raw data of data in disk in the buffer memory, newly advances in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous.Can effectively upgrade the data in the buffer memory so that disposal system is carried out buffer memory to the data in the disk more fast like this.
Concrete; Newly advance in the buffer memory and treat the related data of the raw data of replacement data in disk in related data of the raw data of data in disk or the buffer memory; Here said association can be to belong to identical file or the more approaching data of attribute; The concrete different piece like an audio-video document is the first of video file like data, with the data of this data association then can be the other part of this video file.
In with buffer memory, newly advance the raw data of data in disk move to treat in the identical disk mapping group of the raw data of replacement data in disk in the buffer memory after; Disposal system also need be revised the filec descriptor that newly advances data in the buffer memory, specifically comprises: revise the mapping relations of newly advancing data and disk in the buffer memory.Further according to the mapping relations of newly advancing data and disk in the amended buffer memory, system upgrades automatically newly advances the storage sets of data in buffer memory in the buffer memory.Disposal system detects in the I/O request queue whether the operation of newly advancing data in pair buffer memory is arranged then; If have newly advancing the operation of data in this buffer memory in the I/O request queue; Need revise the filec descriptor that newly advances data in the I/O request queue in this buffer memory simultaneously, specifically comprise: revise the mapping relations of newly advancing data and disk in the buffer memory.
To link to each other that the pattern of mapping carries out with the group be the buffer memory that unit carries out data to the employing group between the data cache method that the embodiment of the invention provides, disk and buffer memory.For the coldest data or the non-hot spot data in the effective replacement buffer memory, at first judge newly to advance in the buffer memory in raw data and the buffer memory of data in disk and treat whether the raw data of replacement data in disk is positioned at same mapping group.In buffer memory, newly advance in raw data and the buffer memory of data in disk and treat that the raw data of replacement data in disk is positioned under the situation of different mappings group; Treat the mapping group of the raw data of replacement data in disk in the buffer memory with newly advancing the original data storage of data in disk in the buffer memory; Can replace the coldest or non-hot spot data in the buffer memory like this; Thereby can improve the hit rate of buffer memory, improve the operating rate of system.
Embodiment three,
The embodiment of the invention provides a kind of buffer storage of data, and is as shown in Figure 4, comprising: statistic unit 41, first judging unit 42, disk migration units 43, buffer memory writing unit 44.
Wherein, statistic unit 41 is used for the data based of said buffer memory added up by the access time with by access frequency, obtains the coldest data or non-hot spot data as treating replacement data in the said buffer memory.
First judging unit 42; Be used for judging buffer memory newly advances in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.
Disk migration units 43; Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, be used for that said buffer memory is newly advanced the raw data of data in disk and move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk.
Disk migration units 43 specifically comprises second judgment sub-unit 431, recon unit 432 and storing sub-units 433.
Second judgment sub-unit 431 is used for judging that said buffer memory treats whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full.
Recon unit 432; If it is full to treat that the raw data of replacement data in disk is arranged in the storage space of mapping group of disk in the said buffer memory, is used for cache exchanging and newly enters the memory location of treating the raw data of replacement data in disk in raw data and the buffer memory of data in disk.
Storing sub-units 433; If treat in the said buffer memory raw data of replacement data in disk be arranged in disk the mapping group storage space less than, be used for said buffer memory and newly advance the raw data of data in disk and move to and treat in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk.
Buffer memory writing unit 44 is used for that said buffer memory is newly advanced data and writes and treat the memory location of replacement data in said buffer memory in the said buffer memory.
Further; Recon unit 432 also is used for buffer memory is newly advanced in the related not data cached and buffer memory of the raw data of data in disk to treat the exchanges data memory location that the raw data of replacement data in disk is related; Newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous, treat in the said buffer memory to treat that the raw data of replacement data in disk is positioned at the same storage sets of disk and physical storage address is continuous in data that the raw data of replacement data in disk is related and the buffer memory.
Further; Storing sub-units 433 also is used for buffer memory is newly advanced the clear position that related not data cached of the raw data of data in disk moved to the mapping group under the raw data of replacement data in disk, advances newly in the said buffer memory that the raw data in disk of newly advancing data in the related not data cached and buffer memory of the raw data in disk of data is positioned at the same storage sets of disk and physical storage address is continuous.
Above-mentioned buffer memory can adopt non-volatile storage medium, like the high-speed cache medium of SSD, PCM.
Below we are elaborated to the concrete course of work of the buffer storage of data.
I/O speed between disk and internal memory is an important bottleneck of system performance always, between disk and internal memory, adds level cache, can effectively improve I/O speed.
First judging unit of buffer storage can judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets.If newly advance in the said buffer memory in raw data and the said buffer memory of data in disk and treat that the raw data of replacement data in disk is arranged in the data of the same mapping group of disk; The mode that links to each other and shine upon according to group like this; For SSD buffer memory medium; The buffer memory writing unit need directly be wiped this replacement data earlier in buffer memory, writes the memory location of replacement data at buffer memory with newly advancing data in the buffer memory then.
Treat that the raw data of replacement data in disk is not arranged in the data of the same mapping group of disk if newly advance in the said buffer memory of first judgment unit judges in the raw data of data in disk and the said buffer memory, second judgment sub-unit of disk storage unit need further judge treat in the said buffer memory whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full.
If it is full to treat that the raw data of replacement data in disk is arranged in the storage space of mapping group of disk in the said buffer memory, the recon unit of disk migration units is with newly entering the memory location of treating the raw data of replacement data in disk in raw data and the buffer memory of data in disk in the cache exchanging so.
Further; The recon unit further is treated the exchanges data memory location that the raw data of replacement data in disk is related with newly advancing in the buffer memory in the related not data cached and buffer memory of the raw data of data in disk; Newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous, it is continuous to treat in the said buffer memory to treat in data that the raw data of replacement data in disk is related and the buffer memory that the raw data of replacement data in disk is positioned at the data and the physical storage address of the same storage sets of disk.Can carry out buffer memory to the data in the disk more fast like this, effectively upgrade the data in the buffer memory.
If in said buffer memory, treat the raw data of replacement data in disk be arranged in disk the mapping group storage space less than situation under, the storing sub-units of buffer storage is moved to and is treated in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk newly advancing the raw data of data in disk in the buffer memory so.Further; Storing sub-units can also treat in the buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk with newly advancing related not data cached the moving to of the raw data of data in disk in the buffer memory, newly advances in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous.Can effectively upgrade the data in the buffer memory so that disposal system is carried out buffer memory to the data in the disk more fast like this.
Concrete; Newly advance in the buffer memory and treat the related data of the raw data of replacement data in disk in related data of the raw data of data in disk or the buffer memory; Here said association can be to belong to identical file or the more approaching data of attribute; The concrete different piece like an audio-video document is the first of video file like data, with the data of this data association then can be the other part of this video file.
In with buffer memory, newly advance the raw data of data in disk move to treat in the identical disk mapping group of the raw data of replacement data in disk in the buffer memory after; Buffer storage also need be revised the filec descriptor that newly advances data in the buffer memory, specifically comprises: revise the mapping relations of newly advancing data and disk in the buffer memory.Further according to the mapping relations of newly advancing data and disk in the amended buffer memory, buffer storage upgrades automatically and newly advances the storage sets of data in buffer memory in the buffer memory.Detect then whether the operation of newly advancing data in pair buffer memory is arranged in the I/O request queue; If have newly advancing the operation of data in this buffer memory in the I/O request queue; Need revise the filec descriptor that newly advances data in the I/O request queue in this buffer memory simultaneously, specifically comprise: revise the mapping relations of newly advancing data and disk in the buffer memory.
To link to each other that the pattern of mapping carries out with the group be the buffer memory that unit carries out data to the employing group between the buffer storage of the data that the embodiment of the invention provides, disk and buffer memory.At first newly advance in the first judgment unit judges buffer memory in raw data and the buffer memory of data in disk and treat whether the raw data of replacement data in disk is positioned at same mapping group.Advance newly in buffer memory to treat in raw data and the buffer memory of data in disk that the raw data of replacement data in disk is not arranged under the situation of different mappings group of disk; Treat the mapping group of the raw data of replacement data in disk in the buffer memory with newly advancing the original data storage of data in disk in the buffer memory; Can replace the coldest or non-hot spot data in the buffer memory like this; Thereby can improve the hit rate of buffer memory, improve the operating rate of system.
The embodiment of the invention also provides a kind of server, comprise embodiment one, three data buffer storage or adopt the caching method of the data of embodiment one, two to carry out metadata cache.Server repeats no more at this about the course of work of the buffer memory of data.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be accomplished through the related hardware of programmed instruction; Aforesaid program can be stored in the computer read/write memory medium; This program the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above; Be merely embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is in the technical scope that the present invention discloses; Can expect easily changing or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of said claim.

Claims (11)

1. the caching method of data is characterized in that, comprising:
Judge newly advance in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk in the buffer memory, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets;
Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk newly advancing the raw data of data in disk in the said buffer memory;
Write and treat the memory location of replacement data in said buffer memory in the said buffer memory newly advancing data in the said buffer memory.
2. method according to claim 1 is characterized in that, moves to and treats in the said buffer memory to comprise in the identical disk mapping group of the raw data of replacement data in disk newly advancing the raw data of data in disk in the said buffer memory:
Judge and treat in the said buffer memory whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full;
If it is full to treat that the raw data of replacement data in disk is arranged in the storage space of mapping group of disk in the said buffer memory, newly enter the memory location of treating the raw data of replacement data in disk in raw data and the buffer memory of data in disk in the cache exchanging;
If treat in the said buffer memory raw data of replacement data in disk be arranged in disk the mapping group storage space less than, newly advance the raw data of data in disk in the said buffer memory and move to and treat in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk.
3. method according to claim 2 is characterized in that, in cache exchanging, newly advance treat the memory location of the raw data of replacement data in disk in raw data and the buffer memory of data in disk after, also comprise:
Treat the exchanges data memory location that the raw data of replacement data in disk is related with newly advancing in the buffer memory in the related not data cached and buffer memory of the raw data of data in disk; Newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous, treat in the said buffer memory to treat that the raw data of replacement data in disk is positioned at the same storage sets of disk and physical storage address is continuous in data that the raw data of replacement data in disk is related and the buffer memory.
4. method according to claim 2 is characterized in that, in said buffer memory, newly advance the raw data of data in disk move to treat in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of mapping group of disk after, also comprise:
With newly advancing the clear position that related not data cached of the raw data of data in disk moved to the mapping group under the raw data of replacement data in disk in the buffer memory, advance newly in the said buffer memory that the raw data in disk of newly advancing data in the related not data cached and buffer memory of the raw data in disk of data is positioned at the same storage sets of disk and physical storage address is continuous.
5. according to each described method of claim 1-4, it is characterized in that, also comprise:
Data based in the said buffer memory added up by the access time with by access frequency, obtained the coldest data or non-hot spot data as treating replacement data in the said buffer memory.
6. the buffer storage of data is characterized in that, comprising:
First judging unit; Be used for judging buffer memory newly advances in raw data and the buffer memory of data in disk to treat whether the raw data of replacement data in disk is arranged in the same mapping group of disk, said mapping group be in the disk with buffer memory in the corresponding one or more storage sets of a storage sets;
The disk migration units; Treat that the raw data of replacement data in disk is not arranged in the same mapping group of disk if newly advance in the said buffer memory in raw data and the said buffer memory of data in disk, be used for that said buffer memory is newly advanced the raw data of data in disk and move to and treat in the said buffer memory in the identical disk mapping group of the raw data of replacement data in disk;
The buffer memory writing unit is used for that said buffer memory is newly advanced data and writes and treat the memory location of replacement data in said buffer memory in the said buffer memory.
7. device according to claim 6 is characterized in that, said disk migration units also comprises:
Second judgment sub-unit is used for judging that said buffer memory treats whether the raw data of replacement data in disk is arranged in the storage space of mapping group of disk full;
The recon unit; If it is full to treat that the raw data of replacement data in disk is arranged in the storage space of mapping group of disk in the said buffer memory, is used for cache exchanging and newly enters the memory location of treating the raw data of replacement data in disk in raw data and the buffer memory of data in disk;
Storing sub-units; If treat in the said buffer memory raw data of replacement data in disk be arranged in disk the mapping group storage space less than, be used for said buffer memory and newly advance the raw data of data in disk and move to and treat in the said buffer memory that the raw data of replacement data in disk is arranged in the clear position of the mapping group of disk.
8. device according to claim 7; It is characterized in that; Said recon unit; Also be used for buffer memory is newly advanced in the related not data cached and buffer memory of the raw data of data in disk to treat the exchanges data memory location that the raw data of replacement data in disk is related; Newly advance in the said buffer memory to advance newly in the related not data cached and buffer memory of the raw data of data in disk that the raw data of data in disk is positioned at the same storage sets of disk and physical storage address is continuous, treat in the said buffer memory to treat that the raw data of replacement data in disk is positioned at the same storage sets of disk and physical storage address is continuous in data that the raw data of replacement data in disk is related and the buffer memory.
9. device according to claim 7; It is characterized in that; Said storing sub-units also is used for buffer memory is newly advanced the clear position that related not data cached of the raw data of data in disk moved to the mapping group under the raw data of replacement data in disk, advances newly in the said buffer memory that the raw data in disk of newly advancing data in the related not data cached and buffer memory of the raw data in disk of data is positioned at the same storage sets of disk and physical storage address is continuous.
10. according to each described device of claim 6-9, it is characterized in that, also comprise:
Statistic unit is used for the data based of said buffer memory added up by the access time with by access frequency, obtains the coldest data or non-hot spot data as treating replacement data in the said buffer memory.
11. a server is characterized in that, comprises each described buffer storage of claim 6-10.
CN201110371549.8A 2011-11-21 2011-11-21 Data caching method, device and server Expired - Fee Related CN102521161B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110371549.8A CN102521161B (en) 2011-11-21 2011-11-21 Data caching method, device and server
PCT/CN2012/084951 WO2013075627A1 (en) 2011-11-21 2012-11-21 Method, device and server for caching data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110371549.8A CN102521161B (en) 2011-11-21 2011-11-21 Data caching method, device and server

Publications (2)

Publication Number Publication Date
CN102521161A true CN102521161A (en) 2012-06-27
CN102521161B CN102521161B (en) 2015-01-21

Family

ID=46292090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110371549.8A Expired - Fee Related CN102521161B (en) 2011-11-21 2011-11-21 Data caching method, device and server

Country Status (2)

Country Link
CN (1) CN102521161B (en)
WO (1) WO2013075627A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075627A1 (en) * 2011-11-21 2013-05-30 华为技术有限公司 Method, device and server for caching data
WO2014206234A1 (en) * 2013-06-25 2014-12-31 华为技术有限公司 Caching method and device
CN104932990A (en) * 2015-06-03 2015-09-23 华为技术有限公司 Substitution method and device of data block in Cache
CN108932150A (en) * 2017-05-24 2018-12-04 中兴通讯股份有限公司 Caching method, device and medium based on SSD and disk mixing storage

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229574A (en) * 2016-03-23 2017-10-03 上海复旦微电子集团股份有限公司 Caching and its control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1347527A (en) * 1999-12-17 2002-05-01 皇家菲利浦电子有限公司 Data processor with cache
CN1499382A (en) * 2002-11-05 2004-05-26 华为技术有限公司 Method for implementing cache in high efficiency in redundancy array of inexpensive discs
EP1980945A1 (en) * 2006-01-31 2008-10-15 Fujitsu Limited Memory access control apparatus and memory access control method
US20100250834A1 (en) * 2009-03-31 2010-09-30 Trika Sanjeev N Method and system to perform caching based on file-level heuristics
CN102137139A (en) * 2010-09-26 2011-07-27 华为技术有限公司 Method and device for selecting cache replacement strategy, proxy server and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5829028A (en) * 1996-05-06 1998-10-27 Advanced Micro Devices, Inc. Data cache configured to store data in a use-once manner
CN100498740C (en) * 2007-09-11 2009-06-10 腾讯科技(深圳)有限公司 Data cache processing method, system and data cache device
CN102521161B (en) * 2011-11-21 2015-01-21 华为技术有限公司 Data caching method, device and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1347527A (en) * 1999-12-17 2002-05-01 皇家菲利浦电子有限公司 Data processor with cache
CN1499382A (en) * 2002-11-05 2004-05-26 华为技术有限公司 Method for implementing cache in high efficiency in redundancy array of inexpensive discs
EP1980945A1 (en) * 2006-01-31 2008-10-15 Fujitsu Limited Memory access control apparatus and memory access control method
US20100250834A1 (en) * 2009-03-31 2010-09-30 Trika Sanjeev N Method and system to perform caching based on file-level heuristics
CN102137139A (en) * 2010-09-26 2011-07-27 华为技术有限公司 Method and device for selecting cache replacement strategy, proxy server and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075627A1 (en) * 2011-11-21 2013-05-30 华为技术有限公司 Method, device and server for caching data
WO2014206234A1 (en) * 2013-06-25 2014-12-31 华为技术有限公司 Caching method and device
CN104932990A (en) * 2015-06-03 2015-09-23 华为技术有限公司 Substitution method and device of data block in Cache
CN104932990B (en) * 2015-06-03 2018-05-11 华为技术有限公司 The replacement method and device of data block in a kind of cache memory
CN108932150A (en) * 2017-05-24 2018-12-04 中兴通讯股份有限公司 Caching method, device and medium based on SSD and disk mixing storage
CN108932150B (en) * 2017-05-24 2023-09-15 中兴通讯股份有限公司 Caching method, device and medium based on SSD and disk hybrid storage

Also Published As

Publication number Publication date
CN102521161B (en) 2015-01-21
WO2013075627A1 (en) 2013-05-30

Similar Documents

Publication Publication Date Title
CN103019962B (en) Data buffer storage disposal route, device and system
US9697133B2 (en) Methods and systems for erasing a segment from a flash cache
US9128855B1 (en) Flash cache partitioning
CN103049397B (en) A kind of solid state hard disc inner buffer management method based on phase transition storage and system
KR101028929B1 (en) Methods of Distributing Log Block Associativity in Real-time System And Flash Memory Device Performing the Same
US7536505B2 (en) Storage system and method for controlling block rearrangement
CN102156738B (en) Method for processing data blocks, and data block storage equipment and system
US20140082310A1 (en) Method and apparatus of storage tier and cache management
CN104484283B (en) A kind of method for reducing solid state disk write amplification
CN105138292A (en) Disk data reading method
CN103064797B (en) Data processing method and virtual machine management platform
CN103399823B (en) The storage means of business datum, equipment and system
CN103984648A (en) Method to throttle rate of data caching for improved I/O performance
CN103019971A (en) Method of quickly responding to trim command, SSD (Solid State Disk) controller and system
KR20100021868A (en) Buffer cache management method for flash memory device
CN102163175A (en) Hybrid address mapping method based on locality analysis
CN102521161A (en) Data caching method, device and server
CN100428193C (en) Data preacquring method for use in data storage system
CN103677670A (en) Method and device for reading data
CN106708444A (en) Data storage method and hard disc controller
KR20190008269A (en) Replacing cache entries based on the availability of entries in other caches
CN103150122A (en) Method and device for managing disk cache space
JPWO2018211749A1 (en) Storage controller, storage system, storage controller control method, and program
CN106775684A (en) A kind of disk buffering power loss recovery method based on new nonvolatile memory
CN102117262B (en) Method and system for active replication for Cache of multi-core processor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150121

Termination date: 20191121