Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, 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 belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment 1
The embodiment of the invention provides a kind of data-storage system.The present embodiment is that cache operations is arranged on before the value-added service, as shown in Figure 1, and solves and how to allow value-added service still can offer an explanation precedence relationship between data and the value-added service time point, thereby can be placed on value-added service after the cache.
As shown in Figure 2, this data-storage system comprises: cache module 200, sign arrange module 210 and value-added service module 220.Wherein:
Cache module 200 is used for the data that buffer memory carries from the write request of main frame.This cache module 200 for example is the high-speed cache (Cache) in the memory device.
Sign arranges module 210 and is used to described data that Data Identification is set.In the present embodiment, sign arranges module 210 and refers to that for described data arrange sign the data of buffer memory arrange Data Identification during data block in the Cache is as unit as Cache, and be buffered in the cache module 200, each data block among the Cache has the sign of oneself separately like this, and namely each data and its Data Identification form one to one relation.The described mode that Data Identification is set has a variety of, for example can sign be set with numeral, letter or other symbols, when utilizing numeral that Data Identification is set, this Data Identification can be set to receive the time of write request or the time of these data of buffer memory, but the present invention is not limited to this.In another embodiment of the present invention, sign arranges in the high-speed cache that module 210 can be arranged on memory device.
Value-added service module 220 is used for receiving data and the Data Identification corresponding to these data of cache module 200 buffer memorys, the write request that the recognition data sign is corresponding and the precedence relationship of value-added service request are carried out value-added service according to described precedence relationship to corresponding data.In the embodiment of the invention, described value-added service comprises: snapshot, mirror image and/or volume copy etc.
When cache module 200 submits to data in the data block to value-added service module 230, can submit simultaneously Data Identification to, the i.e. sign of this data block, it is before the value-added service that value-added service module 230 identifies these data by this sign, or after the value-added service.Particularly, be that Cache is when receiving the time of write request at Data Identification, according to the time and the time that receives the value-added service request of this write request, value-added service module 230 just can identify the precedence relationship of these data and value-added service request simply, thereby according to this precedence relationship corresponding data are carried out value-added service, for example the data before the snapshot time point are revised source book and snapped volume simultaneously.Equally, when Data Identification is data cached time of cache module 200, according to this data cached time and the time that receives the value-added service request, value-added service module 230 can identify the precedence relationship of these data and value-added service request equally simply, thereby according to this precedence relationship corresponding data is carried out value-added service.Described value-added service module 220 can be arranged in the Local or Remote memory device.
According to as above embodiment of the present invention, value-added service is placed on after the cache, and by the data to buffer memory Data Identification is set, make value-added service can offer an explanation precedence relationship between data and the value-added service time point, thereby can correctly process value-added service; And when carrying out value-added service, because the caching of data in the main frame write request is arranged on before the value-added service, therefore the high-speed cache write request of main frame that can make an immediate response, greatly reduce host requests and write time of data, simultaneously, the Cache internal memory can be the source book service only, has increased the service efficiency of Cache internal memory, and has shortened the time that creates value-added service.
Embodiment 2
The present embodiment provides a kind of data-storage system in addition.As shown in Figure 3, this data-storage system comprises: cache module 300, sign arrange module 310 and value-added service module 320.Wherein:
Described cache module 300 is used for the data that buffer memory carries from the write request of main frame.This cache module 300 for example is the high-speed cache (Cache) in the memory device.
Described sign arranges module 310 and is used for reception from the value-added service sign of value-added service module 320, according to default value-added service sign and the corresponding relation of Data Identification, priority according to described write request and value-added service time point is that described data arrange Data Identification, and is buffered in the cache module 300.As another embodiment of the present invention, described sign arranges among the high-speed cache Cache that module 310 can be arranged on memory device.
If current sign arranges module 310 and also not yet receives value-added service sign, can make an appointment arranges an initial marking for the data of carrying in the write request.
Value-added service module 320 is used for identifying corresponding write request and the precedence relationship of value-added service request according to the corresponding relation recognition data of default value-added service sign and Data Identification, according to described precedence relationship corresponding data is carried out value-added service.In the present embodiment, the value-added service module also comprises: the value-added service sign arranges module, is used for receiving the value-added service request, for this value-added service request arranges the value-added service sign.
In the embodiment of the invention, the value-added service sign that sets in advance and the corresponding relation of Data Identification, after value-added service module 320 receives new value-added service request, add value-added service for this value-added service request and identify, and this value-added service sign notice is arranged module 310 to sign; Cache receives the data in the write request, and with the cache module of data buffer storage to the Cache, it is that the data of buffer memory arrange Data Identification according to the corresponding relation of default value-added service sign and Data Identification that sign arranges module 310.Wherein, this default value-added service sign and the corresponding relation of Data Identification can comprise:
(1) the time point of the first value-added service and between the time point of rear adjacent the second value-added service the sign of the data of buffer memory, identical or corresponding with the sign of this first value-added service; Perhaps
(2) the time point of the first value-added service and between the time point of rear adjacent the second value-added service the sign of the data of buffer memory, identical or corresponding with the sign of this second value-added service.
In (1) kind situation, Data Identification corresponding to current write request identifies identical or corresponding with the up-to-date value-added service that has received.Data Identification corresponding to current write request be identical with up-to-date value-added service sign to be referred to the data setting in the current write request and up-to-date value-added service are identified identical sign, this sign can be numeral, letter or other characters, for example, up-to-date value-added service is designated at 1 o'clock, and the data in the current write request are also arranged sign 1; Data Identification corresponding to current write request be corresponding with up-to-date value-added service sign to be referred to the data setting in the current write request and up-to-date value-added service are identified corresponding sign, this sign can be numeral, letter or other characters, for example, up-to-date value-added service is designated at 1 o'clock, with the data in the current write request also arrange sign 1 ', 01 or A etc., up-to-date value-added service is designated at 2 o'clock, with the data in the current write request also arrange sign 2 ', 02 or B etc., only for giving an example, the embodiment of the invention is not limited to this at this.
Figure 4 shows that sign arranges the schematic diagram that module 310 arranges Data Identification in the embodiment of the invention.As shown in Figure 4, t1, t2, t3 represents to create the time point of value-added service, it also is the time that value-added service module 320 receives the value-added service request, for sign module 310 is set, because after value-added service module 320 receives the value-added service request, arranging and send the value-added service sign is to finish moment, therefore can be with time of receiving value-added service sign time point as corresponding value-added service, and sign arranges the value-added service sign of the correspondence that module 310 receives, namely number herein, be respectively 1,2,3.
Pass through t1 among Fig. 4, t2, t3 has been divided into a plurality of intervals to the time coordinate axle, and the data of buffer memory can have same sign in each was interval.The Data Identification that the present embodiment is set and value-added service sign Relationship Comparison are simple: the sign of the data of buffer memory between the time point of the time point of the first value-added service and adjacent the second value-added service is identical with the sign of this second value-added service.For example, when receiving write request in the time interval between the time point t2 of the time point t1 of the first value-added service 1 and next value-added service 2, it is 2 for this Data Identification that the data of carrying in this write request of Cache buffer memory and utilization sign arrange module, such as the Date-2 among Fig. 4.According to above sign corresponding relation, the value-added service module can be identified data in the write request and the context of value-added service time point as follows:
When Data Identification<=value-added service identified, these data were that this value-added service identifies before the corresponding value-added service;
When Data Identification>value-added service sign, these data are exactly after value-added service corresponding to this value-added service sign.
As another embodiment of the present invention, also can preset following Data Identification and value-added service sign relation:
The sign of the data of buffer memory is identical with the sign of this first value-added service between the time point of the time point of the first value-added service and adjacent the second value-added service.Be about to current up-to-date value-added service and identify the Data Identification that is set in the current write request, such as the Date-0~Date-3 among Fig. 5, the sign " 0 " that wherein Date-0 is corresponding is initial marking.
According to above sign corresponding relation, then value-added service module can be identified the context of write request and value-added service time point as follows:
When Data Identification<value-added service identified, these data were that this value-added service identifies before the corresponding value-added service;
When Data Identification>=value-added service sign, these data are exactly after value-added service corresponding to this value-added service sign.
As another embodiment of the present invention, when Data Identification is letter or symbol, value-added service module 320 can identify corresponding write request and the precedence relationship of value-added service request by recognition data equally according to the corresponding relation of default value-added service sign and Data Identification, and the data of buffer memory are carried out corresponding value-added service.
As another embodiment of the present invention, sign arranges module 310 and Data Identification directly can also be set to receive the time of write request or the time of these data of buffer memory, value-added service module 320 can identify corresponding write request and the precedence relationship of value-added service request by recognition data equally according to this Data Identification, and the data of buffer memory are carried out corresponding value-added service.
In the present embodiment, when the data that a new logo is arranged wish to write the Cache data block of old sign, the data of old sign need to be submitted to first the value-added service module, then discharge, admit the data of new logo, each data block does not have the mixing of new and old identification data in the assurance Cache again.Because the data in the Cache data block can be very not large, time delay is fine; Can certainly process with more complicated treatment scheme, for example, for new data creates new Cache data block, the data placement of old sign is to the data queue that promptly submits to value-added service, do simultaneously certain state setting, main frame just be can't see and has been postponed like this.
When creating new value-added service, when the value-added service sign increased, Cache can experience the variation of value-added service sign, thereby can give new sign for the data that newly write timely.
In the present embodiment, value-added service is placed on after the cache, and by the data to buffer memory Data Identification is set, make value-added service can offer an explanation precedence relationship between data and the value-added service time point, thereby can correctly process value-added service; And when carrying out value-added service, because the caching of data in the main frame write request is arranged on before the value-added service, therefore the high-speed cache write request of main frame that can make an immediate response, greatly reduce host requests and write time of data, simultaneously, the Cache internal memory can be the source book service only, has increased the service efficiency of Cache internal memory, and has shortened the time that creates value-added service.
As above among the embodiment, modules can be distributed in a device, also can be distributed in a plurality of devices in the present invention.And modules can be merged into a module, also can further split into a plurality of submodules.
Embodiment 3
The embodiment of the invention provides a kind of data cached disposal route.As shown in Figure 6, described method comprises:
Step 600 receives the write request from main frame, the data of carrying in this write request of buffer memory.
After memory device receives write request Req from main frame, utilize the request of high-speed cache response main frame, the data of carrying in this write request of buffer memory.
Step 620 is for described data arrange Data Identification.
Described Data Identification can be numeral, character, symbol or other signs.
Data in the Cache are not an integral body, are to be combined by some discrete small block datas.In the present embodiment, can Data Identification be set take the data of data block as unit as buffer memory among the Cache, namely for the data block in the Cache Data Identification is set respectively, each data block of Cache the inside has the Data Identification of oneself separately, and the Data Identification that the different pieces of information piece is corresponding among the Cache of same physical volume can be different.When Cache submits that data are to the value-added service module in the data block to, can submit simultaneously the Data Identification of this data block to, it is before the value-added service that the value-added service module can identify these data by this Data Identification, or after the value-added service.
In the embodiment of the invention, the mode that Data Identification is set for data has a variety of, such as but not limited to:
Data Identification can be set to receive the time of write request or the time of these data of buffer memory; Perhaps
Reception is from the value-added service of value-added service module sign, according to default value-added service sign and the corresponding relation of Data Identification, and is that described data arrange Data Identification according to the priority of described write request and value-added service time point.If current C ache also not yet receives the sign of value-added service, can make an appointment arranges an initial marking for the data of carrying in the write request.Wherein, this default value-added service sign and the corresponding relation of Data Identification can comprise:
The time point of the first value-added service and between the time point of rear adjacent the second value-added service the sign of the data of buffer memory, identical or corresponding with the sign of this first value-added service; Perhaps
The time point of the first value-added service and between the time point of rear adjacent the second value-added service the sign of the data of buffer memory, identical or corresponding with the sign of this second value-added service.
In the present embodiment, when the data that a new logo is arranged wish to write the Cache data block of old sign, the data of old sign need to be submitted to first the value-added service module, then discharge, admit the data of new logo, each data block does not have the mixing of new and old identification data in the assurance Cache again.Because the data in the Cache data block can be very not large, time delay is fine; Can certainly process with more complicated treatment scheme, for example, for new data creates new Cache data block, the data placement of old sign is to the data queue that promptly submits to value-added service, do simultaneously certain state setting, main frame just be can't see and has been postponed like this.
When creating new value-added service, when the value-added service sign increased, Cache can experience the variation of value-added service sign, thereby can give new sign for the data that newly write timely.
In the embodiment of the invention, step 600,620 order can be exchanged, and namely can first for the data in the write request arrange Data Identification, will be provided with the data buffer storage of sign in the data block of Cache again.
Step 640 is identified the precedence relationship of write request corresponding to described Data Identification and value-added service time point, and the data of buffer memory corresponding to described Data Identification are carried out corresponding value-added service.
Take snapshot as example, snapshot module can be carried out following operation according to write request corresponding to Data Identification and the precedence relationship of a certain snapshot time point to the data of buffer memory:
If write request before this value-added service time point, then with this data backup in snapped volume.This snapped volume can be a real book, can only be a pointer gauge rather than real book also, and snapped volume has been set up the pointer corresponding with source book, has just finished the snapshot to source book.If but the data of source book change, the pointer gauge of snapped volume will be updated, and should be the position of pointing to raw data.
If write request after this snapshot time point, then not with this data backup in snapped volume.
As another embodiment of the present invention, as shown in Figure 7, before step 620, also can comprise the steps:
Step 610 receives new value-added service request, for the value-added service sign is added in this value-added service request.
The present invention is as above among the embodiment, and memory device at first utilizes the request of high-speed cache response main frame after receiving write request Req from main frame, the data of carrying in this write request of buffer memory, and the data in the high-speed cache are arranged sign; After the data that are provided with sign are submitted to the value-added service module, the value-added service module can be identified precedence relationship between write request corresponding to these data and the value-added service request time point according to Data Identification, thereby process value-added service according to this precedence relationship, thereby improved professional treatment effeciency.Therefore the write request of main frame because high-speed cache can make an immediate response has greatly reduced the time that host requests is write data, simultaneously, has increased the service efficiency of Cache internal memory, and has reduced the time-delay that creates value-added service.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method can come the relevant hardware of instruction finish by program, this program can be stored in the computer read/write memory medium, such as ROM/RAM, magnetic disc, CD etc.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; the protection domain that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.