CN101493753B - Cache memory and data manipulation method thereof - Google Patents

Cache memory and data manipulation method thereof Download PDF

Info

Publication number
CN101493753B
CN101493753B CN2008100659615A CN200810065961A CN101493753B CN 101493753 B CN101493753 B CN 101493753B CN 2008100659615 A CN2008100659615 A CN 2008100659615A CN 200810065961 A CN200810065961 A CN 200810065961A CN 101493753 B CN101493753 B CN 101493753B
Authority
CN
China
Prior art keywords
data
cache
district
block
information
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
Application number
CN2008100659615A
Other languages
Chinese (zh)
Other versions
CN101493753A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008100659615A priority Critical patent/CN101493753B/en
Publication of CN101493753A publication Critical patent/CN101493753A/en
Application granted granted Critical
Publication of CN101493753B publication Critical patent/CN101493753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a cache memory and a data operating method thereof. The memory area of the cache memory comprises a cache block information area of the cache memory and a Cache block data area; the Cache block information area comprises a read Cache block information area and a write Cache block information area, and is used for storing the information of each data block in the Cache block data area; the information comprises the relevant information of the data block and data storage addresses; and the Cache block data area is used for storing data with the block as the unit. The invention only needs to adjust the proportion of the write Cache block information area and the read Cache block information area in the Cache block information area without massive data copying, thus improving the adjusting flexibility; and when the refresh operation is carried out, only little data copying is carried out, thus reducing the time of data refresh and improving the refresh performance.

Description

A kind of cache memory and data manipulation method thereof
Technical field
The present invention relates to disk array technology, relate in particular to Cache (cache memory) and data manipulation method thereof in the disk array.
Background technology
In disk array, Cache is a kind of special storer, is made up of Cache memory block and Cache control zone, is used for the data of buffer memory host requests, and it is one of key factor that influences performance of disk arrays.The organizational form of Cache has two kinds usually, and a kind of mode is that read data and write data are used whole C ache storage area jointly; Another kind of mode is that read data uses different Cache storage areas with write data.
Because the different qualities of read operation and write operation is read Cache and is write the Cache different Cache storage area of use usually.Even under identical applied environment, can there be the inconsistent situation of read-write ratio in disk array under different application environments.
As shown in Figure 1; This figure is the structural drawing of the memory block of existing Cache; The working method of this Cache is that read data and write data are used different storage regions, thereby will read the Cache zone and write the Cache zone and carried out physical division, suppose that Cache storage area size is 1G; Preceding 512M is the read data zone, and back 512M is the write data zone.
Under the situation of separating in the above-mentioned Cache of reading and the zone of writing Cache, exist data both to be kept to read the Cache zone also to be kept at the situation of writing the Cache zone, when read data, guarantee to read up-to-date data.To above-mentioned Cache, a kind of method that reads and writes data has been proposed in the US6321298 patent.The operating process of read data is as shown in Figure 2, is specially:
201, when receiving read request, at first inquire about the data that whether have read request in the write data district, if exist, then get into step 207, otherwise get into step 202.
202, whether there are the data of read request in the inquiry read data district,, then get into step 207 if exist; Otherwise there are not the data that need visit in write data district and read data district, read the data of read request in the memory device, get into step 203.
203, whether inquiry read data district exists free space, if having free space then get into step 205; Otherwise get into step 204.
204, in release portion space, read data district
205, be read data application space.
206, reading of data from memory device is saved in the read data district.
207, return the data of read request.
The flow process of write data is as shown in Figure 3:
301, write when request when receiving, whether inquiry write data district exists the data of the request of writing, if exist, then gets into step 307; Otherwise get into step 303.
302, whether inquiry write data district exists free space, if exist, then gets into step 306, otherwise gets into step 303.
303, execution refreshes behaviour in the write data district.
304, copy refresh data to the read data district.
305, discharge the space that refresh data is deposited.
306, the application space in the write data district.
307, the data that will write request write the write data district.
Storage organization according to above-mentioned Cache carries out existing in the above-mentioned data read-write operation following problem: because the read-write zone is separated from each other fully; Then operation more complicated during the scale in adjustment read-write zone needs to move the data of depositing in read data zone and the write data zone; The copying data that needs when Refresh Data is carried out in the write data zone to refresh has increased the time of refresh data to the read data zone, has reduced efficient and accuracy.
Summary of the invention
Technical matters to be solved by this invention provides a kind of Cache and data manipulation method thereof, solves in the prior art problem that mode caused of the Cache storage area being carried out physical division.
For solving the problems of the technologies described above, the present invention realizes through following technical scheme:
A kind of cache memory comprises memory block and control zone, and said memory block comprises cache memory Cache block message district and Cache blocks of data district;
Said Cache block message district comprises reads Cache block message district and writes Cache block message district, is used for storing the information of each data block of Cache blocks of data district, and this information comprises the relevant information and the deposit data address of data block;
It is unit storage data that said Cache blocks of data district is used for the piece.
Wherein, said Cache blocks of data district comprises usage flag table and deposit data district;
Said usage flag table is used to store the mark of a sequence, and every mark is corresponding with a data block in the deposit data district, and whether the physical space that is used to identify institute's corresponding data piece is used;
Said deposit data district comprises at least one data block, is used for store data.
A kind of data manipulation method of aforesaid cache memory, said method comprises reading of data and wiring method;
Wherein, the read method of said data is:
A, in reading Cache block message district, obtain the information of the data block of preserving the reading of data of wanting;
B, according to the respective data blocks reading of data in the Cache blocks of data district of the deposit data address in the said information;
The wiring method of said data is:
A, in writing Cache block message district, search whether to have and preserve the information that institute will write the data block of data,, then get into step b if having, otherwise entering step c;
B, from write Cache block message district, obtain the information of respective data blocks, write new data according to wherein deposit data address respective data blocks in the Cache blocks of data district again, finish afterwards;
C, to writing Cache block message district and Cache blocks of data district respectively request for data block message parking space and deposit data space; Then data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for.
Wherein, Also comprise in the read method of said data: when reading of data; If read not store in the Cache block message district information of the data block of the reading of data of wanting; Reading of data in the memory device then; To reading Cache block message district and Cache blocks of data district request for data block message parking space and deposit data space respectively, said data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for then.
Wherein, Also comprise in the wiring method of said data: carry out refresh operation after writing data; This operation further comprises: the information of the data block that inquiry need refresh in writing Cache block message district; Deposit data address according to wherein obtains data, and to memory device, and the information copy of the data block that said need are refreshed is to reading in the Cache block message district with this deposit data.
Wherein, in the said method, when the application parking space; If the parking space in Cache blocks of data district is full; Then before the application parking space, carry out putspace operations earlier, this operation further comprises: the information of the releasable data block of inquiry in Cache block message district, find corresponding data block in the Cache blocks of data district according to deposit data address wherein; Delete data wherein, and delete the information of this data block in the Cache block message district.
Wherein, In the said method, when the request for data parking space, search untapped data block according to the usage flag table in Cache blocks of data district; And the data block corresponding flag bit of being applied for to the usage flag table in Cache blocks of data district is set to 1, is used to identify this data block.
Wherein, in the said method, when carrying out putspace operations, also comprise: the data block corresponding flag bit that is discharged to the usage flag table in Cache blocks of data district is set to 0, does not use to identify this data block.
Wherein, said method also comprises: the Cache block message district of reading in the Cache block message district adjusts with the space proportion size of writing Cache block message district.
The present invention has following beneficial effect:
1) the present invention is divided into Cache block message district and Cache blocks of data district with Cache; Cache blocks of data district is shared in write and read Cache block message district in the Cache block message district; Thereby; When adjustment read-write Cache regional percentage big or small, only need adjust and write Cache block message district in the Cache block message district and read the ratio in Cache block message district, not need the lot of data copy, improve the dirigibility of adjustment;
When 2) after write data, carrying out refresh operation, only need the information of relevant data block is copied to and reads only to have carried out a spot of copying data the Cache block message district from writing Cache block message district, reduce the time of Refresh Data, improved the performance that refreshes.
Description of drawings
Fig. 1 is the structural representation of Cache storage area in the prior art;
Fig. 2 is the operational flowchart of read data in the prior art;
Fig. 3 is the operational flowchart of write data in the prior art;
Fig. 4 is the structural representation of Cache storage area among the present invention;
Fig. 5 is the space structure figure in Cache blocks of data district among the present invention;
Fig. 6 is the method flow diagram of application spatial operation.
Embodiment
To combine accompanying drawing and embodiment that the present invention is described in further detail below:
See also Fig. 4, this figure is depicted as the structural drawing of Cache storage area among the present invention, comprises Cache block message district and Cache blocks of data district.
Wherein, Cache block message district comprises again reads Cache block message district and writes Cache block message district two parts; All be used for storing the information of each data block of Cache blocks of data district, this information comprises the relevant information (like write time of data etc.) and the deposit data address of data block.
The space structure figure in Cache blocks of data district is as shown in Figure 5, comprises usage flag table and deposit data district; The usage flag table is used to store the mark of a sequence, and every mark is corresponding with a data block in the deposit data district, and whether the physical space that is used to identify institute's corresponding data piece is used (following use with 1 expression, 0 expression is not used for example); The deposit data district comprises at least one data block, is used for store data.
The operation that above-mentioned Cache can carry out has: applies for space, Free up Memory, visit data, refreshes write data, adjusts read-write Cache area size etc., specific as follows said:
The application spatial operation: realization flow is as shown in Figure 6, may further comprise the steps,
601, in Cache block message district, apply for Cache block message parking space,, apply for otherwise arrive to write in the Cache block message district if read data is arrived and read to apply in the Cache block message district;
602, arrive Cache blocks of data district request for data parking space again, find out untapped data block zone according to the usage flag table in Cache blocks of data district;
The data block corresponding flag bit of 603, being applied for to the usage flag table is set to 1, is used to identify this data block;
604, the deposit data address that will in Cache blocks of data district, apply in the deposit data district is saved in the Cache block message district.
Data manipulation among the visit Cache: at first arrive relevant information and deposit data address that Cache block message district obtains data block, then according to visiting the data that this Cache piece is deposited in the deposit data district of Cache blocks of data storage address in the Cache data field.
Discharge the Cache spatial operation: the information of in Cache block message district, finding out the data block that will discharge; Obtain the deposit data address of this data block; The corresponding usage flag position of this data block is set to 0 in the usage flag table in Cache blocks of data district again; Do not use to identify this data block, then the information of this data block of deletion in the Cache block message district.
Refresh the Cache data: the information of at first in writing Cache block message district, finding out the data block that need refresh; Obtain the deposit data address of this data block; Arrive Cache blocks of data district visit data according to the deposit data address; Then data are write memory device, at last with all information copy of this data block to reading in the Cache block message district.
Adjustment Cache read-write area size: realize with the space proportion size of writing Cache block message district through reading Cache block message district in the adjustment Cache block message district.For example: reduce the space of reading Cache block message district, increase the space of writing Cache block message district.There is enough big free space if read Cache block message district, then can this idle component be drawn and write Cache block message district; There is not enough big free space if read Cache block message district, can discharges the Cache spatial operation and discharge the space that part is read Cache block message district, this segment space is drawn write Cache block message district then.
Can on Cache, realize data write in conjunction with aforesaid operations, the read method of data is:
(1) from reading the information that Cache block message district obtains the data block of preserving the reading of data of wanting;
(2) according to the respective data blocks reading of data in the Cache blocks of data district of the deposit data address in the said information.
In above-mentioned read method; If read not store in the Cache block message district information of the data block of the reading of data of wanting; Reading of data in the memory device then; Apply for spatial operation then,, the data block corresponding flag bit of being applied for is changed to 1 in the usage flag table in Cache blocks of data district and has been used to identify this data block promptly to reading Cache block message district and Cache blocks of data district respectively request for data block message parking space and deposit data space; Then said data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for.
The method that in Cache, writes data is:
1. in writing Cache block message district, search whether to have and preserve the information that institute will write the data block of data,, then get into step 2., otherwise the entering step 3. if having;
2. from write Cache block message district, obtain the information of respective data blocks, write new data according to wherein deposit data address respective data blocks in the Cache blocks of data district again, finish afterwards;
3. apply for spatial operation; Promptly to writing Cache block message district and Cache blocks of data district request for data block message parking space and deposit data space respectively; The data block corresponding flag bit of being applied for being changed to 1 in the usage flag table in Cache blocks of data district has been used to identify this data block; Then data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for.
Also need carry out refresh operation after writing data; This operation further comprises: the information of the data block that inquiry need refresh in writing Cache block message district; Deposit data address according to wherein obtains data; To memory device, and the information copy of the data block that said need are refreshed is to reading in the Cache block message district with this deposit data.
Above-mentioned data read with wiring method in; When the application parking space; If the parking space in Cache blocks of data district is full, then before the application parking space, carry out putspace operations earlier, this operation is specially: information (if the read data of the data block that inquiry will discharge in Cache block message district; Then inquire about in the Cache block message district to reading; If write data is then inquired about to writing in the Cache block message district), find corresponding data block in the Cache blocks of data district according to deposit data address wherein; This data block corresponding flag bit is set to 0 in the usage flag table in Cache blocks of data district, all information of this data block in the deletion read/write Cache block message district.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. a cache memory comprises memory block and control zone, it is characterized in that, said memory block comprises cache memory Cache block message district and Cache blocks of data district;
Said Cache block message district comprises reads Cache block message district and writes Cache block message district, is used for storing the information of each data block of Cache blocks of data district, and this information comprises the relevant information and the deposit data address of data block;
It is unit storage data that said Cache blocks of data district is used for the piece, the said Cache of reading block message district with write Cache block message district and share said Cache blocks of data district.
2. cache memory as claimed in claim 1 is characterized in that, said Cache blocks of data district comprises usage flag table and deposit data district;
Said usage flag table is used to store the mark of a sequence, and every mark is corresponding with a data block in the deposit data district, and whether the physical space that is used to identify institute's corresponding data piece is used;
Said deposit data district comprises at least one data block, is used for store data.
3. the data manipulation method of a cache memory as claimed in claim 1 is characterized in that, said method comprises reading of data and wiring method;
Wherein, the read method of said data is:
A, in reading Cache block message district, obtain the information of the data block of preserving the reading of data of wanting;
B, according to the respective data blocks reading of data in the Cache blocks of data district of the deposit data address in the said information;
The wiring method of said data is:
A, in writing Cache block message district, search whether to have and preserve the information that institute will write the data block of data,, then get into step b if having, otherwise entering step c;
B, from write Cache block message district, obtain the information of respective data blocks, write new data according to wherein deposit data address respective data blocks in the Cache blocks of data district again, finish afterwards;
C, to writing Cache block message district and Cache blocks of data district respectively request for data block message parking space and deposit data space; Then data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for.
4. data manipulation method as claimed in claim 3; It is characterized in that; Also comprise in the read method of said data: when reading of data; If read in the Cache block message district the information of the data block of the storage reading of data of wanting, then reading of data in the memory device is distinguished request for data block message parking space and deposit data space to reading Cache block message district and Cache blocks of data district then; Said data are write in the data block of being applied for, and the relevant information and the deposit data address of this data block write in the data block information parking space of being applied for.
5. data manipulation method as claimed in claim 3; It is characterized in that; Also comprise in the wiring method of said data: write and carry out refresh operation after the data, this operation further comprises: the information of the data block that inquiry need refresh in writing Cache block message district, obtain data according to wherein deposit data address; To memory device, and the information copy of the data block that said need are refreshed is to reading in the Cache block message district with this deposit data.
6. like claim 3 or 4 described data manipulation methods; It is characterized in that, in the said method, when the application parking space; If the parking space in Cache blocks of data district is full; Then before the application parking space, carry out putspace operations earlier, this putspace operations further comprises: the information of the releasable data block of inquiry in Cache block message district, find corresponding data block in the Cache blocks of data district according to deposit data address wherein; Delete data wherein, and delete the information of this data block in the Cache block message district.
7. like claim 3 or 4 described data manipulation methods; It is characterized in that; In the said method, when the request for data parking space, search untapped data block according to the usage flag table in Cache blocks of data district; And the data block corresponding flag bit of being applied for to the usage flag table in Cache blocks of data district is set to 1, is used to identify this data block.
8. data manipulation method as claimed in claim 6; It is characterized in that, in the said method, when carrying out putspace operations; Also comprise: the data block corresponding flag bit that is discharged to the usage flag table in Cache blocks of data district is set to 0, does not use to identify this data block.
9. data manipulation method as claimed in claim 3 is characterized in that, said method also comprises: the Cache block message district of reading in the Cache block message district adjusts with the space proportion size of writing Cache block message district.
CN2008100659615A 2008-01-22 2008-01-22 Cache memory and data manipulation method thereof Active CN101493753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100659615A CN101493753B (en) 2008-01-22 2008-01-22 Cache memory and data manipulation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100659615A CN101493753B (en) 2008-01-22 2008-01-22 Cache memory and data manipulation method thereof

Publications (2)

Publication Number Publication Date
CN101493753A CN101493753A (en) 2009-07-29
CN101493753B true CN101493753B (en) 2012-06-06

Family

ID=40924371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100659615A Active CN101493753B (en) 2008-01-22 2008-01-22 Cache memory and data manipulation method thereof

Country Status (1)

Country Link
CN (1) CN101493753B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063264B (en) * 2009-11-18 2012-08-29 成都市华为赛门铁克科技有限公司 Data processing method, equipment and system
CN103257831B (en) 2012-02-20 2016-12-07 深圳市腾讯计算机系统有限公司 The read/writing control method of memorizer and the memorizer of correspondence

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6321298B1 (en) * 1999-01-25 2001-11-20 International Business Machines Corporation Full cache coherency across multiple raid controllers
CN1505317A (en) * 2002-10-29 2004-06-16 ض� Configurable transmit and receive system interfaces for a network device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6321298B1 (en) * 1999-01-25 2001-11-20 International Business Machines Corporation Full cache coherency across multiple raid controllers
CN1505317A (en) * 2002-10-29 2004-06-16 ض� Configurable transmit and receive system interfaces for a network device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张宇弘等.利用基地址相关的低功耗数据cache设计.《浙江大学学报(工学版)》.2005,(第10期), *

Also Published As

Publication number Publication date
CN101493753A (en) 2009-07-29

Similar Documents

Publication Publication Date Title
US9298384B2 (en) Method and device for storing data in a flash memory using address mapping for supporting various block sizes
CN103136121B (en) Cache management method for solid-state disc
CN104794070B (en) Solid state flash memory write buffer system and method based on dynamic non-covered RAID technique
US10169232B2 (en) Associative and atomic write-back caching system and method for storage subsystem
US8954648B2 (en) Memory device and operating method thereof
CN103608782B (en) Selective data storage in LSB page face and the MSB page
CN102779096B (en) Page, block and face-based three-dimensional flash memory address mapping method
CN102541983B (en) Method for synchronously caching by multiple clients in distributed file system
US20060010293A1 (en) Cache for file system used in storage system
CN103942011B (en) A kind of residual quantity fast photographic system and its application method
CN109582593B (en) FTL address mapping reading and writing method based on calculation
US10061704B2 (en) Systems and methods for managing cache of a data storage device
CN105335098A (en) Storage-class memory based method for improving performance of log file system
CN101840308A (en) Hierarchical memory system and logical volume management method thereof
CN105893274B (en) A kind of device for establishing checkpoint towards isomery memory system
CN107798130A (en) A kind of Snapshot Method of distributed storage
CN102981963A (en) Implementation method for flash translation layer of solid-state disc
CN110058822A (en) A kind of disk array transverse direction expanding method
CN107818052A (en) Memory pool access method and device
CN106815152A (en) A kind of method for optimizing page level flash translation layer (FTL)
CN104750433A (en) Cache design method based on SCST
CN109739696B (en) Double-control storage array solid state disk caching acceleration method
US7640410B2 (en) Instant copy of data through pointers interchanging
CN102681792B (en) Solid-state disk memory partition method
CN102650972B (en) Date storage method, Apparatus and system

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