CN104461380B - Date storage method and device - Google Patents
Date storage method and device Download PDFInfo
- Publication number
- CN104461380B CN104461380B CN201410652141.1A CN201410652141A CN104461380B CN 104461380 B CN104461380 B CN 104461380B CN 201410652141 A CN201410652141 A CN 201410652141A CN 104461380 B CN104461380 B CN 104461380B
- Authority
- CN
- China
- Prior art keywords
- data
- clock
- write
- storage device
- key
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/78—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
- G06F21/80—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in storage media based on magnetic or optical technology, e.g. disks with sectors
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The embodiment of the invention discloses a kind of date storage method and device, methods described includes:Receive data write instruction;Judge whether include WORM marks in the data write instruction;If comprising extracting Key data to be written, Value data to be written, target from the data write instruction and preserve duration and write-in user's mark;The currency for obtaining the conjunction rule clock of the storage device closes rule clock as write-in;Rule clock is closed to Key data, Value data to be written and the write-in to be written to calculate, obtain digital digest using preset algorithm;Establish the corresponding relation that the Key data to be written preserve duration, user's mark and digital digest with the target;Key data, Value data to be written and the corresponding relation to be written are written in the storage device.Therefore, can allow for supporting the storage device of key value Key Value interfaces to possess WORM characteristics.
Description
Technical field
The present invention relates to technical field of data storage, more particularly to a kind of date storage method and device.
Background technology
More and more how international office of enterprise institution and government department tends in accordance with the law preserve the data of designated period of time now
In not modifiable storage media.To assist user to deal with this laws and regulations requirement, release WORM (Write Onece, Read Many,
Single writes, and repeatedly reads, abbreviation write once read many) technology, using WORM technologies, data are not allowed to distort after write, can be effective
Data are avoided unexpectedly to be wiped, rewritten or changed.
With the rise of cloud storage, the application based on Key-Value (key-value) interface is accelerated.Has there is base in industry
In IP (Internet Protocol, Internet protocol) hard disk that Key-Value is semantic, the SCSI (Small to discard tradition
Computer System Interface, small computer system interface) interface and consensus standard, then using IP agreement come
Carry out PERCOM peripheral communication.The IP hard disks currently issued provide open Key-Value semantic interfaces, pass through API in client
(Application Programming Interface, application programming interface) is called and uses rear end hard disk.
But current IP hard disks only provide Key-Value semantic interfaces, do not provide more semantic based on Key-Value
The characteristic of interface, so WORM technologies can not be supported.
The content of the invention
A kind of date storage method and device are provided in the embodiment of the present invention, can not be supported with solving existing intelligent hard disc
The problem of WORM technologies.
In order to solve the above-mentioned technical problem, the embodiment of the invention discloses following technical scheme:
In a first aspect, the embodiments of the invention provide a kind of date storage method, applied to storage device, including:
Pass through the key value Key-Value interface data write instructions of the storage device;
Judge whether include write once read many WORM marks in the data write instruction;
When including WORM marks in the data write instruction, Key to be written is extracted from the data write instruction
Data, Value data to be written, target preserve duration and write-in user's mark;
The currency for obtaining the conjunction rule clock of the storage device closes rule clock as write-in;
Rule clock is closed using preset algorithm to Key data, Value data to be written and the write-in to be written to count
Calculate, obtain digital digest;
Establish the corresponding pass that the Key data to be written preserve duration, user's mark and digital digest with the target
System;
Key data, Value data to be written and the corresponding relation to be written are written to the storage device
In.
With reference in a first aspect, in first aspect in the first possible implementation, methods described also includes:
Instruction is deleted by the key value Key-Value interfaces data of the storage device;
Deleted from the data in instruction and extract Key data to be deleted;
Judge whether the Key data to be deleted in the storage device fail;
If failure, by the Key data to be deleted, Value data to be deleted, and, with the Key data to be deleted
Corresponding relation is deleted from the storage device.
The first possible implementation with reference to first aspect, in second of possible implementation of first aspect, institute
State whether the Key data to be deleted judged in the storage device fail, including:
Write corresponding with the Key data to be deleted is obtained according to the corresponding relation of the Key data to be deleted and closes rule
Clock and target preserve duration;
Rule clock is closed according to the storage device and determines that the data delete the reception conjunction rule clock of instruction;
Rule clock and said write conjunction rule clock are closed according to described receive, judge that the Key data to be deleted are deposited described
Whether the time stored in storage equipment, which exceedes the target, preserves duration;
If preserving duration more than the target, the Key data failures to be deleted in the storage device are determined.
With reference in a first aspect, in first aspect in the third possible implementation, methods described also includes:
Determine data to be migrated;
Key data to be migrated corresponding to the data to be migrated, Value data to be migrated, target is obtained to preserve duration, write
Enter to close digital digest when rule clock and write-in;
Rule clock is closed using preset algorithm to Key data, Value data to be migrated and the said write to be migrated to carry out
Calculate, obtain Contemporary Digital summary;
Judge whether the digital digest when Contemporary Digital summary writes with the Key data to be migrated is equal;
If equal, determine that the Key data to be migrated are not tampered with, and by Key data to be migrated, to be migrated
Rule clock is closed in migration when Value data, target preserve duration, rule clock, migration are closed in write-in and user's mark is sent to mesh
Mark storage device.
With reference in a first aspect, in the 4th kind of possible implementation of first aspect, methods described also includes:
Migrating data is obtained, the migrating data includes:Migrate Key data, migration Value data, target preserve duration,
Rule clock is closed in write-in, rule clock is closed in migration and user's mark;
Rule clock is closed according to the storage device and determines that rule clock is closed in the secondary write-in of the migrating data;
Rule clock is closed using preset algorithm to the migration Key data, migration Value data and the secondary write-in to carry out
Calculate, obtain secondary write-in digital digest;
Duration is preserved according to the target, rule clock is closed in write-in and the rule secondary preservation duration of clock calculation is closed in migration;
Establish the migration Key data and preserve the secondary of duration, user's mark and secondary write-in digital digest with secondary
Write corresponding relation;
The migration Key data, migration Value data and the secondary write-in corresponding relation are written to the storage and set
In standby.
With reference in a first aspect, in the 5th kind of possible implementation of first aspect, methods described also includes:
One NTP message is sent to ntp server by the Ethernet interface of the storage device, in the NTP messages
Carry the very first time stamp T1 at the time of NTP messages are sent;
The response message that the ntp server returns according to the NTP messages is obtained, is carried in the response message
The second time stamp T 2 and the ntp server at the time of stating very first time stamp T1, ntp server reception NTP messages are sent out
Send the 3rd time stamp T 3 at the time of the response message;
Obtain the 4th time stamp T 4 at the time of the storage device receives response message;
Using very first time stamp T1, the second time stamp T 2, the 3rd time stamp T 3 and the 4th time stamp T 4, described in calculating
Time difference between ntp server and the storage device;
Using after the time difference described in the clock delay of the ntp server rule clock is closed as described.
With reference in a first aspect, in the 6th kind of possible implementation of first aspect, methods described also includes:
First moment Tc1 of TSA server clocks is obtained by the Ethernet interface of the storage device;
Using first moment Tc1 and presupposed information composition data to be signed, and the data to be signed are sent to
The TSA servers, so that the TSA servers are signed to the data to be signed;
Receive the signature result that the TSA servers return, carried in the signature result first moment Tc1,
The 3rd when result of calculation is encrypted by the second moment Ts1 and the TSA servers when TSA servers are calculated
Moment Ts2;
The 4th when being decrypted using the public key decryptions of the TSA servers to the signature result, and obtaining decryption
Moment Tc2;
Using first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and the 4th moment Tc2, the TSA is calculated
Time difference between server and the storage device;
Using after the time difference described in the clock delay of the TSA servers rule clock is closed as described.
With reference in a first aspect, in the 7th kind of possible implementation of first aspect, methods described also includes:
The test moment value of each node local clock in the cluster where the storage device is obtained simultaneously;
The average of the test moment value of each node in computing cluster, and calculate respectively the test moment value of each node with
The variance of the average;
Selection variance is located at the node of preset range as destination node;
Standard time clock is calculated using the local clock of all destination nodes of selection, the conjunction as the storage device
Advise clock.
Second aspect, the embodiments of the invention provide a kind of data storage device, application memory equipment, including:
Write instruction receiving module, for being write by the key value Key-Value interfaces data of the storage device
Instruction;
WORM identifies judge module, for judging whether include write once read many WORM marks in the data write instruction
Know;
First extraction module, for when including WORM marks in the data write instruction, referring to from data write-in
Key data, Value data to be written, target preservation duration and write-in user's mark to be written are extracted in order;
Rule clock acquisition module is closed in write-in, is closed for obtaining the currency of conjunction rule clock of the storage device as write-in
Advise clock;
First computing module, for the Key data to be written, Value data to be written and being write using preset algorithm
Enter to close rule clock to be calculated, obtain digital digest;
First corresponding relation building module, duration, user are preserved with the target for establishing the Key data to be written
The corresponding relation of mark and digital digest;
First writing module, for Key data, Value data to be written and the corresponding relation to be written to be write
Enter into the storage device.
With reference to second aspect, in second aspect in the first possible implementation, described device also includes:
Command reception module is deleted, for being deleted by the key value Key-Value interfaces data of the storage device
Instruction;
Second extraction module, Key data to be deleted are extracted for being deleted from the data in instruction;
Fail judge module, and whether the Key data to be deleted for judging in the storage device fail;
Removing module, for when it is described failure judge module judged result for failure when, by the Key numbers to be deleted
According to, Value data to be deleted, and, deleted with the corresponding relation of the Key data to be deleted from the storage device.
The first possible implementation with reference to second aspect, in second of possible implementation of second aspect, institute
Failure judge module is stated, including:
Time acquisition submodule, for being obtained and the Key to be deleted according to the corresponding relation of the Key data to be deleted
Rule clock is closed in write-in corresponding to data and target preserves duration;
Rule clock acquisition submodule is closed in reception, for described in the currency conduct for the conjunction rule clock for obtaining the storage device
Rule clock is closed in the reception that data delete instruction;
Duration judging submodule, for closing rule clock and said write conjunction rule clock according to described receive, treated described in judgement
Delete whether the time that Key data store in the storage device exceedes target preservation duration;
Fail determination sub-module, for when the judged result of the duration judging submodule is preserves more than the target
When long, the Key data failures to be deleted in the storage device are determined.
With reference to second aspect, in second aspect in the third possible implementation, described device also includes:
Data determining module to be migrated, for determining data to be migrated;
Data message acquisition module to be migrated, for obtaining Key data to be migrated corresponding to the data to be migrated, waiting to move
Move Value data, target preserves duration, writes the digital digest closed when advising clock and write-in;
Second computing module, for utilizing preset algorithm to Key data, Value data to be migrated and the institute to be migrated
State write-in conjunction rule clock to be calculated, obtain Contemporary Digital summary;
Digital digest judge module, for judging the Contemporary Digital summary and number during the Key data write-in to be migrated
Whether word summary is equal;
Transferring module, for when the judged result of the digital digest judge module is equal, determining described to be migrated
Key data are not tampered with, and the Key data to be migrated, Value data to be migrated, target are preserved into duration, when rule are closed in write-in
Rule clock is closed in migration when clock, migration and user's mark is sent to target storage device.
With reference to second aspect, in the 4th kind of possible implementation of second aspect, described device also includes:
Migrating data acquisition module, for obtaining migrating data, the migrating data includes:Migrate Key data, migration
Value data, target preserve duration, rule clock is closed in write-in, rule clock is closed in migration and user's mark;
Rule clock acquisition module is closed in secondary write-in, and the conjunction for obtaining the storage device advises the currency of clock as institute
Rule clock is closed in the secondary write-in for stating migrating data;
3rd computing module, for utilizing preset algorithm to the migration Key data, migration Value data and described two
Secondary write-in is closed rule clock and calculated, and obtains secondary write-in digital digest;
Duration calculation module, for preserving duration according to the target, rule clock is closed in write-in and rule clock calculation is closed in migration
Secondary preservation duration;
Second corresponding relation building module, for establish the migration Key data with it is secondary preservation duration, user identify with
And the secondary write-in corresponding relation of secondary write-in digital digest;
Second writing module, for corresponding to and closing the migration Key data, migration Value data and the secondary write-in
System is written in the storage device.
With reference to second aspect, in the 5th kind of possible implementation of second aspect, described device also includes:
Message sending module, for the Ethernet interface by the storage device to NTP ntp server
A NTP message is sent, the very first time stamp T1 at the time of NTP messages are sent is carried in the NTP messages;
Response message acquisition module, the response message returned for obtaining the ntp server according to the NTP messages,
The second time at the time of the very first time stamp T1, ntp server reception NTP messages is carried in the response message
Stab the 3rd time stamp T 3 at the time of T2 and the ntp server transmission response message;
Timestamp acquisition module, for obtaining the 4th timestamp at the time of the storage device receives response message
T4;
Very first time difference computing module, for utilizing very first time stamp T1, the second time stamp T 2, the 3rd time stamp T 3
With the 4th time stamp T 4, the time difference between the ntp server and the storage device is calculated;
First close rule clock determining unit, for using after the time difference described in the clock delay of the ntp server as institute
State conjunction rule clock.
With reference to second aspect, in the 6th kind of possible implementation of second aspect, described device also includes:
First moment acquisition module, for obtaining trusted timestamp TSA clothes by the Ethernet interface of the storage device
First moment Tc1 of business device clock;
Data to be signed processing module, for forming data to be signed using first moment Tc1 and presupposed information, and
The data to be signed are sent to the TSA servers, so that the TSA servers are signed to the data to be signed
Name;
Signature result receiving module, for receiving the signature result of the TSA servers return, taken in the signature result
The second moment Ts1 and TSA servers when being calculated with first moment Tc1, the TSA servers is to calculating
The 3rd moment Ts2 when being as a result encrypted;
Deciphering module, the signature result is decrypted for the public key decryptions using the TSA servers, and obtained
The 4th moment Tc2 during decryption;
Second time difference computing module, for using first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and
4th moment Tc2, calculate the time difference between the TSA servers and the storage device;
Second close rule clock determining module, for using after the time difference described in the clock delay of the TSA servers as institute
State conjunction rule clock.
With reference to second aspect, in the 7th kind of possible implementation of second aspect, described device also includes:
Moment value acquisition module is tested, during for obtaining each node local in the cluster where the storage device simultaneously
The test moment value of clock;
Mean value computation module, for the average of the test moment value of each node in computing cluster, and calculate respectively each
The test moment value of node and the variance of the average;
Destination node selecting module, for selecting variance to be located at the node of preset range as destination node;
3rd closes rule clock determining module, and standard is calculated in the local clock for all destination nodes using selection
Clock is advised in clock, the conjunction as the storage device.
The third aspect, the embodiments of the invention provide a kind of data storage device, including:Processor and memory, wherein,
The memory memory storage has the operational order that the processor is able to carry out, so that the computing device following steps:
Receive data write instruction;
Judge whether include write once read many WORM marks in the data write instruction;
When including WORM marks in the data write instruction, Key to be written is extracted from the data write instruction
Data, Value data to be written, target preserve duration and write-in user's mark;
Obtain the processor and close the currency of rule clock as write-in conjunction rule clock;
Rule clock is closed using preset algorithm to Key data, Value data to be written and the write-in to be written to count
Calculate, obtain digital digest;
Establish the corresponding pass that the Key data to be written preserve duration, user's mark and digital digest with the target
System;
Key data, Value data to be written and the corresponding relation to be written are written in the memory.
With reference to the third aspect, in the third aspect in the first possible implementation, also stored in the memory
The operational order that processor is able to carry out is stated, so that the computing device following steps:
Instruction is deleted by the key value Key-Value interfaces data of the storage device;
Deleted from the data in instruction and extract Key data to be deleted;
Judge whether the Key data to be deleted in the storage device fail;
If failure, by the Key data to be deleted, Value data to be deleted, and, with the Key data to be deleted
Corresponding relation is deleted from the storage device.
From above technical scheme, this method provided in an embodiment of the present invention, according to the WORM in data write instruction
Mark, it is determined that need to carry out WORM protections to data, and extract from data write instruction Key data to be written, to be written
Value data, target preserve duration and write-in user's mark, and acquisition storage device closes the currency of rule clock as write-in conjunction rule
Clock, and rule clock is closed to Key data, Value data to be written and the write-in to be written using preset algorithm and calculated,
Obtain digital digest, most the Key data to be written, Value data to be written at last, and, the Key data to be written with
The corresponding relation that the target preserves duration, user's mark and digital digest is all written in the storage device.
So, for storage to the data in storage device, during target preserves duration, can only read, it is impossible to carry out
Modification is deleted, and for the data of storage, can be verified by digital digest, it is determined that whether the data of storage are usurped
Change, ensure the security of data.Therefore, can allow for supporting the storage device of key value Key-Value interfaces to possess
WORM characteristics, effective WORM protections can be carried out to the data of write-in.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, for those of ordinary skill in the art
Speech, without having to pay creative labor, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of schematic flow sheet for date storage method that inventive embodiments provide;
Fig. 2 is the schematic flow sheet for another date storage method that inventive embodiments provide;
Fig. 3 is the schematic flow sheet of step S203 in Fig. 2;
Fig. 4 is the schematic flow sheet for another date storage method that inventive embodiments provide;
Fig. 5 is the schematic flow sheet for another date storage method that inventive embodiments provide;
Fig. 6 is a kind of structural representation of data storage device provided in an embodiment of the present invention;
Fig. 7 is the structural representation of another data storage device provided in an embodiment of the present invention;
Fig. 8 is the structural representation of another data storage device provided in an embodiment of the present invention;
Fig. 9 is the structural representation of another data storage device provided in an embodiment of the present invention;
Figure 10 is a kind of structural representation of data storage device provided in an embodiment of the present invention.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the present invention, below in conjunction with of the invention real
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described implementation
Example only part of the embodiment of the present invention, rather than whole embodiments.It is common based on the embodiment in the present invention, this area
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to protection of the present invention
Scope.
The date storage method provided in an embodiment of the present invention, can be and hard for IP with the storage devices such as IP hard disks
For disk, it also provides open key value Key-Value semantic interfaces, and can be with by the key value Key-Value interfaces
So that IP hard disks are linked into Ethernet.
Fig. 1 is a kind of schematic flow sheet for date storage method that inventive embodiments provide.
As shown in figure 1, this method can include:
Step S101:Pass through the key value Key-Value interface data write instructions of the storage device.
Client can pass through API (Application Programming Interface, application programming interface)
Interface interchange has the intelligent hard disc that Key-Value connects, in order to carry out data manipulation to intelligent hard disc.For intelligent hard disc
Speech, data manipulation generally include three classes:PUT, GET and DELETE, wherein, PUT is data write instruction, for intelligent hard disc
The new data of middle write-in, GET is data read command, and for reading the data of storage from intelligent hard disc, DELETE is data
Instruction is deleted, for the data stored in intelligent hard disc to be deleted.
The instruction type of this data manipulation to intelligent hard disc can be determined by the different type of api interface.
Step S102:Judge whether include WORM marks in the data write instruction.
For data write instruction, three parts can be included:Key, Value, Optional Parameters, wherein
The mark for whether supporting WORM can be carried in Optional Parameters, and, data need the time preserved
Value.Here WORM marks can be the value of certain a data position in Optional Parameters, such as:Optional
When a preset data position is 1 in Parameters, represents that WORM is supported in the instruction, otherwise, represent that WORM is not supported in the instruction.
In addition, the time value that data need to preserve is used to specify storage time of the data in intelligent hard disc in data write instruction.
When judged result is to be identified in the data write instruction comprising WORM, step S103 is performed, otherwise, terminates stream
Journey, the data being directly written into data command are written in intelligent hard disc.
Step S103:Key data to be written, Value data to be written, target is extracted from the data write instruction to protect
Deposit duration and write-in user's mark.
User's mark is also carried in above-mentioned Optional Parameters, is specifically as follows:ID, generally number
Corresponding user is identified according to the user in write instruction, is exactly the authority user of data in the data write instruction, can be right
Data after write-in are read out.
Referring to the above-mentioned description as described in data write instruction, in this step, directly can be extracted from data write instruction
Key data, Value data to be written, target preservation duration and write-in user's mark to be written.
Step S104:The currency for obtaining the conjunction rule clock of the storage device closes rule clock as write-in.
For intelligent hard disc, although being provided with local clock in it, this local clock can not with extraneous clock
Ensure consistent.So in embodiments of the present invention, close rule clock (Compliance Clock) and do not refer to intelligent hard disc itself
Clock, and refer to the absolute clock that intelligent hard disc can be approved, such as:NTP (Network Time Protocol, network
Time protocol) clock or TSA (Time Stamp Authority, trusted timestamp) clock.In addition, when multiple hard disks composition one
, can be with unified clock in order that obtaining this cluster during individual cluster, can also be (hard i.e. in cluster with each node in cluster
Disk) local clock line number can so be entered in cluster by the absolute clock that all nodes are all approved in cluster to set one
During according to the operation such as transfer, it is possible to ensure the storage time of data, improve the WORM characteristics of cluster.
Step S105:When closing rule to Key data, Value data to be written and the write-in to be written using preset algorithm
Clock is calculated, and obtains digital digest.
For the data stored, if simple directly store, then any one user only it is to be understood that corresponding Key values with
Value values, it is possible to which data are operated., in the disclosed embodiments, can in order to improve the security of stored data
To use MD5, SHA-1, SGA-256 scheduling algorithm, conjunction when write with reference to data advises clock to Key data to be written, to be written
Value data are signed, and conjunction rule clock when being write due to data, domestic consumer is difficult to know, so passing through numeral
Can of making a summary improves the security of institute data storage, especially when needing to migrate data or WORM protective calibrations
When.
Step S106:Establish the Key data to be written and preserve duration, user's mark and digital digest with the target
Corresponding relation.
Step S107:Key data, Value data to be written and the corresponding relation to be written are written to described
In storage device.
This method provided in an embodiment of the present invention, the WORM marks in data write instruction, it is determined that needing to data
When carrying out WORM protections, and extracting from data write instruction Key data to be written, Value data to be written, target and preserve
Long and write-in user's mark, and rule are closed to Key data, Value data to be written and the write-in to be written using preset algorithm
Clock is calculated, and obtains digital digest, most the Key data to be written, Value data to be written at last, and, it is described to treat
Write-in Key data and the target preserve duration, user identifies and the corresponding relation of digital digest is all written to the storage and set
In standby.
For storage to the data in storage device, during target preserves duration, can only read, it is impossible to modify or
Delete.Therefore, can allow for supporting the storage device of key value Key-Value interfaces to possess WORM characteristics, can be right
The data of write-in carry out effective WORM protections.
It is after the data writing is finished, interior during the preservation of setting according to the characteristic of WORM data, data can only be read
Take, and data can not be modified or deleted.Therefore, in an embodiment of the present invention, as shown in Fig. 2 this method can be with
Comprise the following steps:
Step S201:Instruction is deleted by the key value Key-Value interfaces data of the storage device.
Step S202:Deleted from the data in instruction and extract Key data to be deleted.
Step S203:Judge whether the Key data to be deleted in the storage device fail;
For the Key data and Value data that are stored in intelligent hard disc, due to having formulated data in write-in
Holding time, so, in data storage procedure, once receive to Key data stored in intelligent hard disc and
The deletion action of Value data, then just need to judge whether data to be deleted fail, that is, whether judge data to be deleted
Exceed corresponding target and preserve duration.Only the holding time can just be deleted more than the data of target preservation duration.
In embodiments of the present invention, as shown in figure 3, step S203 may comprise steps of:
Step S2031:Obtained according to the corresponding relation of the Key data to be deleted corresponding with the Key data to be deleted
Write-in close rule clock and target preserve duration;
Step S2032:The currency for obtaining the conjunction rule clock of the storage device deletes connecing for instruction as the data
Fold rule clock;
Step S2033:Rule clock and write-in conjunction rule clock are closed according to the reception, judge that the Key data to be deleted exist
Whether the time stored in the storage device, which exceedes the target, preserves duration;
If preserving duration more than the target, step S2034 is carried out, otherwise, terminates flow.
Step S2034:Determine the Key data failures to be deleted in the storage device.
When judged result is the Key data failures to be deleted, step S204 is carried out, otherwise, terminates flow.
Step S204:By the Key data to be deleted, Value data to be deleted, and, with the Key data to be deleted
Corresponding relation deleted from the storage device.
Because the characteristic of WORM data is write-once, repeatedly read, and in data retention period, it is impossible to data
Distorted, so, in embodiments of the present invention, it is necessary to enter to the validity of data to be deleted when deleting data
Row determines that the data only to fail can just be deleted by user.
In a particular application, data can be just deleted after only failing, only with respect to use hard disk user or tenant
For, but for system manager, hard disk is managed for convenience, can be to appointing after hard disk purview certification
Meaning data are deleted.Correspondingly, receive data delete instruction after, it is also necessary to data delete instruction in user identify into
Row judges, when the user that only data are deleted in instruction is identified as system manager, can just allow to delete any data
Remove.
In addition, in data retention period, the preservation duration that user can be to data extends, and extends protection duration
Operation with above-mentioned embodiment illustrated in fig. 1, equivalent to new data are write in a hard disk, repeating no more again.
In data storage procedure, once there is the situation that intelligent hard disc may face failure, by ensure being stored
The securities of data, it is necessary to by the Data Migration stored in intelligent hard disc into new hard disk, such as:It is located at the intelligent hard disc
Other intelligent hard discs in same cluster.For WORM data, it is necessary to ensure that data are not usurped in data migration process
Change.Therefore, as shown in figure 4, in embodiments of the present invention, methods described is further comprising the steps of:
Step S301:Determine data to be migrated.
Step S302:Key data to be migrated corresponding to the data to be migrated, Value data to be migrated, target is obtained to protect
Deposit digital digest when duration, write-in conjunction rule clock and write-in.
Step S303:Key data, Value data to be migrated and the said write to be migrated are closed using preset algorithm
Rule clock is calculated, and obtains Contemporary Digital summary.
Step S304:Judge whether is digital digest when Contemporary Digital summary writes with the Key data to be migrated
It is equal.
If equal, step S305 is carried out, otherwise, is terminated.
Step S305:Determine that the Key data to be migrated are not tampered with, and by Key data to be migrated, to be migrated
Rule clock is closed in migration when Value data, target preserve duration, rule clock, migration are closed in write-in and user's mark is sent to mesh
Mark storage device.
By above-mentioned steps, before Data Migration is carried out, as the data side of moving out intelligent hard disc can be migrated
Data whether be tampered and verified, and after being only verified, just data to be migrated can be sent to target storage and set
It is standby, such as:Another intelligent hard disc in cluster.
Correspondingly, when needing to Data Migration, intelligent hard disc is also possible to as the data side of moving into, therefore, such as Fig. 5 institutes
Show, this method can also comprise the following steps:
Step S401:Obtain migrating data.
Migrating data includes:Migrate Key data, migration Value data, target and preserve duration, write-in conjunction rule clock, migration
Close rule clock and user's mark.
Step S402:Obtain secondary write-in of the currency of the conjunction rule clock of the storage device as the migrating data
Close rule clock.
Step S403:The migration Key data, migration Value data and the secondary write-in are closed using preset algorithm
Rule clock is calculated, and obtains secondary write-in digital digest.
Step S404:Duration is preserved according to the target, rule clock is closed in write-in and the rule secondary preservation of clock calculation is closed in migration
Duration.
Because data have saved a period of time before migration, then target can be preserved into duration after migration and subtracted
Historic preservation duration is removed, as new preservation duration, i.e., secondary preservation duration.Such as:A length of 1 year when the target of data preserves,
It is 1 day 12 October in 2013 that rule clock is closed in write-in in the first intelligent hard disc:00, migration closes rule clock and is August in 2014 1
12:00, then visible, secondary preservation duration will be 2 months.
Step S405:The migration Key data are established to pluck with secondary preservation duration, user's mark and secondary write-in numeral
The secondary write-in corresponding relation wanted.
Step S406:The migration Key data, migration Value data and the secondary write-in corresponding relation are written to
In the storage device.
Data need individually to calculate outer after moving into except preserving duration, and others are identical with the ablation process of new data,
This is no longer described in detail.
Pass through above-mentioned steps, it is ensured that after data are moved into, data can be re-write according to WORM characteristics
Process, and in ablation process, fully taken into account the continuity of the preservation duration of data so that Data Migration can be gentle
Transition, avoid and occur the problem of error in data in data migration process.
In order to be accurately obtained in above-mentioned steps S104 close rule clock currency and as write-in close rule clock, it is necessary to
The conjunction rule clock of storage device is got first.In embodiments of the present invention, this method can also comprise the following steps:
11) a NTP message, the NTP reports, are sent to ntp server by the Ethernet interface of the storage device
The very first time stamp T1 at the time of NTP messages are sent is carried in text;
12) response message that the ntp server returns according to the NTP messages, is obtained, is carried in the response message
There are the second time stamp T 2 at the time of the very first time stamp T1, ntp server reception NTP messages and the NTP to service
Device sends the 3rd time stamp T 3 at the time of the response message;
13) the 4th time stamp T 4 at the time of the storage device receives response message, is obtained;
14) T1, the second time stamp T 2, the 3rd time stamp T 3 and the 4th time stamp T 4, are stabbed using the very first time, is calculated
Time difference between the ntp server and the storage device;
From the point of view of above-mentioned interaction, the time delay of NTP message a cycle back and forth is:(T4-T1)-(T3-T2), then storage is set
The standby time difference between ntp server is:[(T2-T1)-(T4-T3)]/2.
15), rule clock is closed as described using after the time difference described in the clock delay of the ntp server.
By above-mentioned steps, when intelligent hard disc is as a node in cluster, due to each node in the cluster
All obtain in the manner described above and close rule clock, then can make it that the conjunction rule clock of each node is with NPT servers
Time is reference, that is, the conjunction rule clock obtained is all identical for all nodes.
In addition, when clock is advised in the conjunction for getting storage device, this method can also comprise the following steps:
First moment Tc1 of TSA server clocks is obtained by the Ethernet interface of the storage device;
Using first moment Tc1 and presupposed information composition data to be signed, and the data to be signed are sent to
The TSA servers, so that the TSA servers are signed to the data to be signed;
Receive the signature result that the TSA servers return, carried in the signature result first moment Tc1,
The 3rd when result of calculation is encrypted by the second moment Ts1 and the TSA servers when TSA servers are calculated
Moment Ts2;
The 4th when being decrypted using the public key decryptions of the TSA servers to the signature result, and obtaining decryption
Moment Tc2;
Using first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and the 4th moment Tc2, the TSA is calculated
Time difference between server and the storage device;
From the point of view of above-mentioned interaction, the time delay of a cycle of TSA message back and forth is:(Tc2-Tc1)-(Ts2-Ts1), then
Time difference between storage device and ntp server is:[(Ts1-Tc1)-(Tc2-Ts1)]/2.
Using after the time difference described in the clock delay of the TSA servers rule clock is closed as described.
By above-mentioned steps, when intelligent hard disc is as a node in cluster, due to each node in the cluster
All obtain in the manner described above and close rule clock, then can make it that the conjunction rule clock of each node is with NPT servers
Time is reference, that is, the conjunction rule clock obtained is all identical for all nodes.
In addition, when clock is advised in the conjunction for getting storage device, this method can also comprise the following steps:
The test moment value of each node local clock in the cluster where the storage device is obtained simultaneously;
The average of the test moment value of each node in computing cluster, and calculate respectively the test moment value of each node with
The variance of the average;
Selection variance is located at the node of preset range as destination node;
Standard time clock is calculated using the local clock of all destination nodes of selection, the conjunction as the storage device
Advise clock.
When intelligent hard disc is as a node in cluster, due to each node in the cluster in the manner described above
Obtain and close rule clock, then it is identical that can, which make it that clock is advised in the conjunction of each node, i.e., is definitely approved by each node
's.Correspondingly, when subsequently carrying out Data Migration, it is ensured that the time of each node is consistent.
The description of embodiment of the method more than, it is apparent to those skilled in the art that the present invention can
Realized by the mode of software plus required general hardware platform, naturally it is also possible to by hardware, but in many cases the former
It is more preferably embodiment.Based on such understanding, technical scheme substantially makes tribute to prior art in other words
The part offered can be embodied in the form of software product, and the computer software product is stored in a storage medium, bag
Some instructions are included to so that a computer equipment (can be personal computer, server, or network equipment etc.) performs
The all or part of step of each embodiment methods described of the present invention.And foregoing storage medium includes:Read-only storage
(ROM), random access memory (RAM), magnetic disc or CD etc. are various can be with the medium of store program codes.
Corresponding with date storage method embodiment provided by the invention, present invention also offers a kind of data storage dress
Put.
It is a kind of structural representation of data storage device provided in an embodiment of the present invention referring to Fig. 6, the device includes:
Write instruction receiving module 11, WORM marks judge module 12, the first extraction module 13, write-in close rule clock acquisition module 14,
First computing module 15, the first corresponding relation building module 16 and the first writing module 17.
The write instruction receiving module 11, for the key value Key-Value interface data by the storage device
Write instruction;
The WORM identifies judge module 12, for judging whether include WORM marks in the data write instruction;
First extraction module 13, for when including WORM marks in the data write instruction, being write from the data
Enter and Key data, Value data to be written, target preservation duration and write-in user's mark to be written are extracted in instruction;
Rule clock acquisition module 14 is closed in the write-in, and the currency for closing rule clock for obtaining the storage device, which is used as, to be write
Enter to close rule clock;
First computing module 15, for using preset algorithm to the Key data to be written, Value data to be written
Rule clock is closed with write-in to be calculated, and obtains digital digest;
First corresponding relation building module 16, for establish the Key data to be written and the target preserve duration,
User identifies and the corresponding relation of digital digest;
First writing module 17, for Key data, Value data to be written and described correspond to be written to be closed
System is written in the storage device.
The device provided in an embodiment of the present invention, the WORM marks in data write instruction, it is determined that needing to data
When carrying out WORM protections, and extracting from data write instruction Key data to be written, Value data to be written, target and preserve
Long and write-in user's mark, and rule are closed to Key data, Value data to be written and the write-in to be written using preset algorithm
Clock is calculated, and obtains digital digest, most the Key data to be written, Value data to be written at last, and, it is described to treat
Write-in Key data and the target preserve duration, user identifies and the corresponding relation of digital digest is all written to the storage and set
In standby.
For storage to the data in storage device, during target preserves duration, can only read, it is impossible to modify or
Delete.Therefore, can allow for supporting the storage device of key value Key-Value interfaces to possess WORM characteristics, can be right
The data of write-in carry out effective WORM protections.
It is after the data writing is finished, interior during the preservation of setting according to the characteristic of WORM data, data can only be read
Take, and data can not be modified or deleted.Therefore, in an embodiment of the present invention, as shown in fig. 7, the device can be with
Including:Delete command reception module 21, the second extraction module 22, failure judge module 23 and removing module 24.
The deletion command reception module 21, for the key value Key-Value interface data by the storage device
Delete instruction;
Second extraction module 22, Key data to be deleted and deletion user are extracted in instruction for being deleted from the data
Mark;
Whether the failure judge module 23, the Key data to be deleted for judging in the storage device fail;
In embodiments of the present invention, failure judge module 23 can include:Time acquisition submodule, reception are closed rule clock and obtained
Submodule, duration judging submodule and failure determination sub-module are taken, wherein:The time acquisition submodule, for being treated according to
The corresponding relation of deletion Key data obtains write corresponding with the Key data to be deleted and closes rule clock and target preservation duration;
Rule clock acquisition submodule is closed in the reception, is deleted for obtaining the currency of conjunction rule clock of the storage device as the data
Except rule clock is closed in the reception of instruction;The duration judging submodule, for closing rule clock and write-in conjunction rule clock according to the reception,
Judge whether the time that the Key data to be deleted store in the storage device exceedes target preservation duration;The mistake
Imitate determination sub-module, for when the duration judging submodule judged result be more than the target preserve duration when, it is determined that
The Key data failures to be deleted in the storage device.
The removing module 24, for when it is described failure judge module judged result for failure when, by the Key to be deleted
Data, Value data to be deleted, and, deleted with the corresponding relation of the Key data to be deleted from the storage device.
Because the characteristic of WORM data is write-once, repeatedly read, and in data retention period, it is impossible to data
Distorted, so, in embodiments of the present invention, it is necessary to enter to the validity of data to be deleted when deleting data
Row determines that the data only to fail can just be deleted by user.
In a particular application, data can be just deleted after only failing, only with respect to use hard disk user or tenant
For, but for system manager, hard disk is managed for convenience, can be to appointing after hard disk purview certification
Meaning data are deleted.Correspondingly, receive data delete instruction after, it is also necessary to data delete instruction in user identify into
Row judges, when the user that only data are deleted in instruction is identified as system manager, can just allow to delete any data
Remove.
In addition, in data retention period, the preservation duration that user can be to data extends, and extends protection duration
Operation with above-mentioned embodiment illustrated in fig. 1, equivalent to new data are write in a hard disk, repeating no more again.
In data storage procedure, once there is the situation that intelligent hard disc may face failure, by ensure being stored
The securities of data, it is necessary to by the Data Migration stored in intelligent hard disc into new hard disk, such as:It is located at the intelligent hard disc
Other intelligent hard discs in same cluster.For WORM data, it is necessary to ensure that data are not usurped in data migration process
Change.Therefore, as shown in figure 8, in embodiments of the present invention, described device also includes:It is data determining module 31 to be migrated, to be migrated
Data message acquisition module 32, the second computing module 33, digital digest judge module 34 and transferring module 35.
The data determining module 31 to be migrated, for determining data to be migrated;
The data message acquisition module 32 to be migrated, for obtain Key data to be migrated corresponding to the data to be migrated,
Value data to be migrated, target preserve duration, rule clock is closed in write-in and digital digest during write-in;
Second computing module 33, for using preset algorithm to the Key data to be migrated, Value data to be migrated
Rule clock is closed with said write to be calculated, and obtains Contemporary Digital summary;
The digital digest judge module 34, for judging that the Contemporary Digital summary and the Key data to be migrated write
When digital digest it is whether equal;
The transferring module 35, for when the digital digest judge module judged result for it is equal when, it is determined that described treat
Migration Key data are not tampered with, and the Key data to be migrated, Value data to be migrated, target are preserved into duration, write-in conjunction
Rule clock is closed in migration when rule clock, migration and user's mark is sent to target storage device.
In the embodiment of the present invention, before Data Migration is carried out, treat and move as the data side of moving out intelligent hard disc can
Whether the data of shifting, which are tampered, is verified, and after being only verified, data to be migrated can be just sent to target storage
Equipment, such as:Another intelligent hard disc in cluster.
Correspondingly, when needing to Data Migration, intelligent hard disc is also possible to as the data side of moving into, therefore, such as Fig. 9 institutes
Show, as shown in figure 9, the device can also include:Migrating data acquisition module 41, secondary write-in close rule clock acquisition module 42,
3rd computing module 43, duration calculation module 44, the second corresponding relation building module 45 and the second writing module 46.
Migrating data acquisition module 41, for obtaining migrating data, the migrating data includes:Migrate Key data, migration
Value data, target preserve duration, rule clock is closed in write-in, rule clock is closed in migration and user's mark;
Rule clock acquisition module 42 is closed in secondary write-in, the currency conduct of the conjunction rule clock for obtaining the storage device
Rule clock is closed in the secondary write-in of the migrating data;
3rd computing module 43, for using preset algorithm to the migration Key data, migrate Value data and described
Secondary write-in is closed rule clock and calculated, and obtains secondary write-in digital digest;
Duration calculation module 44, based on duration, write-in conjunction rule clock are preserved according to the target and is migrated and closes rule clock
Calculate secondary preservation duration;
Second corresponding relation building module 45, identified for establishing the migration Key data with secondary preservation duration, user
And the secondary write-in corresponding relation of secondary write-in digital digest;
Second writing module 46, for the migration Key data, migration Value data and the secondary write-in is corresponding
Relation is written in the storage device.
Rule clock acquisition module 14 is closed in above-mentioned write-in to obtain when rule clock is closed in write-in, it is necessary to get storage device first
Conjunction rule clock.In an embodiment of the invention, the device can also include:
Message sending module, for the Ethernet interface by the storage device to NTP ntp server
A NTP message is sent, the very first time stamp T1 at the time of NTP messages are sent is carried in the NTP messages;
Response message acquisition module, the response message returned for obtaining the ntp server according to the NTP messages,
The second time at the time of the very first time stamp T1, ntp server reception NTP messages is carried in the response message
Stab the 3rd time stamp T 3 at the time of T2 and the ntp server transmission response message;
Timestamp acquisition module, for obtaining the 4th timestamp at the time of the storage device receives response message
T4;
Very first time difference computing module, for utilizing very first time stamp T1, the second time stamp T 2, the 3rd time stamp T 3
With the 4th time stamp T 4, the time difference between the ntp server and the storage device is calculated;
First close rule clock determining unit, for using after the time difference described in the clock delay of the ntp server as institute
State conjunction rule clock.
In another embodiment, the device can also include:
First moment acquisition module, for obtaining trusted timestamp TSA clothes by the Ethernet interface of the storage device
First moment Tc1 of business device clock;
Data to be signed processing module, for forming data to be signed using first moment Tc1 and presupposed information, and
The data to be signed are sent to the TSA servers, so that the TSA servers are signed to the data to be signed
Name;
Signature result receiving module, for receiving the signature result of the TSA servers return, taken in the signature result
The second moment Ts1 and TSA servers when being calculated with first moment Tc1, the TSA servers is to calculating
The 3rd moment Ts2 when being as a result encrypted;
Deciphering module, the signature result is decrypted for the public key decryptions using the TSA servers, and obtained
The 4th moment Tc2 during decryption;
Second time difference computing module, for using first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and
4th moment Tc2, calculate the time difference between the TSA servers and the storage device;
Second close rule clock determining module, for using after the time difference described in the clock delay of the TSA servers as institute
State conjunction rule clock.
In another embodiment, the device can also include:
Moment value acquisition module is tested, during for obtaining each node local in the cluster where the storage device simultaneously
The test moment value of clock;
Mean value computation module, for the average of the test moment value of each node in computing cluster, and calculate respectively each
The test moment value of node and the variance of the average;
Destination node selecting module, for selecting variance to be located at the node of preset range as destination node;
3rd closes rule clock determining module, and standard is calculated in the local clock for all destination nodes using selection
Clock is advised in clock, the conjunction as the storage device
The embodiment of the present invention also provides a kind of data storage device, and as shown in Figure 10, the data storage device includes:Processing
Device 100 and memory 200, wherein, processor 100 is connected by key value Key-Value interfaces 300 with Ethernet.
The memory memory storage has the operational order that the processor is able to carry out, so that below the computing device
Step:
Receive data write instruction;
Judge whether include WORM marks in the data write instruction;
When including WORM marks in the data write instruction, Key to be written is extracted from the data write instruction
Data, Value data to be written, target preserve duration and write-in user's mark;
Obtain the processor and close the currency of rule clock as write-in conjunction rule clock;
Rule clock is closed using preset algorithm to Key data, Value data to be written and the write-in to be written to count
Calculate, obtain digital digest;
Establish the corresponding pass that the Key data to be written preserve duration, user's mark and digital digest with the target
System;
Key data, Value data to be written and the corresponding relation to be written are written in the memory
In an embodiment of the invention, the operation that the processor is able to carry out also is stored with the memory to refer to
Order, so that the computing device following steps:
Instruction is deleted by the key value Key-Value interfaces data of the storage device;
Deleted from the data in instruction and extract Key data to be deleted;
Judge whether the Key data to be deleted in the storage device fail;
If failure, by the Key data to be deleted, Value data to be deleted, and, with the Key data to be deleted
Corresponding relation is deleted from the storage device.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each unit can be realized in same or multiple softwares and/or hardware during invention.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Especially for device or
For system embodiment, because it is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to method
The part explanation of embodiment.Apparatus and system embodiment described above is only schematical, wherein the conduct
The unit that separating component illustrates can be or may not be it is physically separate, can be as the part that unit is shown or
Person may not be physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can root
Factually border needs to select some or all of module therein realize the purpose of this embodiment scheme.Ordinary skill
Personnel are without creative efforts, you can to understand and implement.
The present invention can be described in the general context of computer executable instructions, such as program
Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type
Part, data structure etc..The present invention can also be put into practice in a distributed computing environment, in these DCEs, by
Task is performed and connected remote processing devices by communication network.In a distributed computing environment, program module can be with
In the local and remote computer-readable storage medium including storage device.
It should be noted that herein, the relational terms of such as " first " and " second " or the like are used merely to one
Individual entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operate it
Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Cover including for nonexcludability, so that process, method, article or equipment including a series of elements not only include those
Key element, but also the other element including being not expressly set out, or also include for this process, method, article or set
Standby intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that
Other identical element in the process including the key element, method, article or equipment also be present.
Described above is only the embodiment of the present invention, is made skilled artisans appreciate that or realizing this hair
It is bright.A variety of modifications to these embodiments will be apparent to one skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (18)
- A kind of 1. date storage method, applied to storage device, it is characterised in that including:Pass through the key value Key-Value interface data write instructions of the storage device;Judge whether include write once read many WORM marks in the data write instruction;When including WORM marks in the data write instruction, extracted from the data write instruction Key data to be written, Value data, target preservation duration and write-in user's mark to be written;The currency for obtaining the conjunction rule clock of the storage device closes rule clock as write-in;The rule clock that closes is default quilt The absolute clock of the storage device accreditation, the rule clock that closes include but is not limited to NTP NTP clocks or credible Time stamp T SA clocks;Rule clock is closed to Key data, Value data to be written and the write-in to be written to calculate, obtain using preset algorithm To digital digest;Establish the corresponding relation that the Key data to be written preserve duration, user's mark and digital digest with the target;Key data, Value data to be written and the corresponding relation to be written are written in the storage device.
- 2. according to the method for claim 1, it is characterised in that methods described also includes:Instruction is deleted by the key value Key-Value interfaces data of the storage device;Deleted from the data in instruction and extract Key data to be deleted;Judge whether the Key data to be deleted in the storage device fail;If failure, by the Key data to be deleted, Value data to be deleted, and, it is corresponding with the Key data to be deleted Relation is deleted from the storage device.
- 3. according to the method for claim 2, it is characterised in that described to be deleted in the judgement storage device Whether Key data fail, including:Write corresponding with the Key data to be deleted is obtained according to the corresponding relation of the Key data to be deleted and closes rule clock Duration is preserved with target;The currency for obtaining the conjunction rule clock of the storage device deletes the reception conjunction rule clock of instruction as the data;Rule clock and said write conjunction rule clock are closed according to described receive, judge that the Key data to be deleted are set in the storage Whether the time of standby middle storage, which exceedes the target, preserves duration;If preserving duration more than the target, the Key data failures to be deleted in the storage device are determined.
- 4. according to the method for claim 1, it is characterised in that methods described also includes:Determine data to be migrated;Obtain that Key data to be migrated corresponding to the data to be migrated, Value data to be migrated, target preserve duration, write-in is closed Advise digital digest when clock and write-in;Rule clock is closed using preset algorithm to Key data, Value data to be migrated and the said write to be migrated to count Calculate, obtain Contemporary Digital summary;Judge whether the digital digest when Contemporary Digital summary writes with the Key data to be migrated is equal;If equal, determine that the Key data to be migrated are not tampered with, and by the Key data to be migrated, Value numbers to be migrated Duration is preserved according to, target, rule clock is closed in migration when rule clock, migration are closed in write-in and user's mark is sent to target storage and set It is standby.
- 5. according to the method for claim 1, it is characterised in that methods described also includes:Migrating data is obtained, the migrating data includes:Migrate Key data, migration Value data, target and preserve duration, write-in Close rule clock, rule clock is closed in migration and user's mark;The currency for obtaining the conjunction rule clock of the storage device closes rule clock as the secondary write-in of the migrating data;Rule clock is closed using preset algorithm to the migration Key data, migration Value data and the secondary write-in to count Calculate, obtain secondary write-in digital digest;Duration is preserved according to the target, rule clock is closed in write-in and the rule secondary preservation duration of clock calculation is closed in migration;Establish the migration Key data and the secondary write-in of secondary preservation duration, user's mark and secondary write-in digital digest Corresponding relation;The migration Key data, migration Value data and the secondary write-in corresponding relation are written to the storage device In.
- 6. according to the method for claim 1, it is characterised in that methods described also includes:One NTP message is sent to NTP ntp server by the Ethernet interface of the storage device, it is described The very first time stamp T1 at the time of NTP messages are sent is carried in NTP messages;The response message that the ntp server returns according to the NTP messages is obtained, described is carried in the response message The second time stamp T 2 and the ntp server at the time of one timestamp T1, the ntp server receive NTP messages send institute State the 3rd time stamp T 3 at the time of response message;Obtain the 4th time stamp T 4 at the time of the storage device receives response message;Using very first time stamp T1, the second time stamp T 2, the 3rd time stamp T 3 and the 4th time stamp T 4, the NTP is calculated Time difference between server and the storage device;Clock is advised into conjunction after time difference described in the clock delay of the ntp server as the storage device.
- 7. according to the method for claim 1, it is characterised in that methods described also includes:First moment Tc1 of trusted timestamp TSA server clocks is obtained by the Ethernet interface of the storage device;Using first moment Tc1 and presupposed information composition data to be signed, and the data to be signed are sent to described TSA servers, so that the TSA servers are signed to the data to be signed;The signature result that the TSA servers return is received, first moment Tc1, described is carried in the signature result The 3rd moment when result of calculation is encrypted by the second moment Ts1 and the TSA servers when TSA servers are calculated Ts2;The 4th moment when being decrypted using the public key decryptions of the TSA servers to the signature result, and obtaining decryption Tc2;Using first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and the 4th moment Tc2, the TSA services are calculated Time difference between device and the storage device;Clock is advised into conjunction after time difference described in the clock delay of the TSA servers as the storage device.
- 8. according to the method for claim 1, it is characterised in that methods described also includes:The test moment value of each node local clock in the cluster where the storage device is obtained simultaneously;The average of the test moment value of each node in computing cluster, and calculate respectively the test moment value of each node with it is described The variance of average;Selection variance is located at the node of preset range as destination node;Standard time clock is calculated using the local clock of all destination nodes of selection, when the conjunction as the storage device is advised Clock.
- 9. a kind of data storage device, application memory equipment, it is characterised in that including:Write instruction receiving module, for the key value Key-Value interface data write instructions by the storage device;WORM identifies judge module, for judging whether include write once read many WORM marks in the data write instruction;First extraction module, for when in the data write instruction include WORM mark when, from the data write instruction Extract Key data, Value data to be written, target preservation duration and write-in user's mark to be written;Rule clock acquisition module is closed in write-in, when closing rule as write-in for obtaining the currency of conjunction rule clock of the storage device Clock;The rule clock that closes is the default absolute clock approved by the storage device, and the rule clock that closes includes but is not limited to NTP NTP clocks or trusted timestamp TSA clocks;First computing module, for being closed using preset algorithm to Key data, Value data to be written and the write-in to be written Rule clock is calculated, and obtains digital digest;First corresponding relation building module, for establishing, the Key data to be written and the target preserve duration, user identifies And the corresponding relation of digital digest;First writing module, for Key data, Value data to be written and the corresponding relation to be written to be written to In the storage device.
- 10. device according to claim 9, it is characterised in that described device also includes:Command reception module is deleted, for deleting instruction by the key value Key-Value interfaces data of the storage device;Second extraction module, Key data to be deleted are extracted for being deleted from the data in instruction;Fail judge module, and whether the Key data to be deleted for judging in the storage device fail;Removing module, for when the failure judge module judged result for failure when, by the Key data to be deleted, treat Value data are deleted, and, deleted with the corresponding relation of the Key data to be deleted from the storage device.
- 11. device according to claim 10, it is characterised in that the failure judge module, including:Time acquisition submodule, for being obtained and the Key data to be deleted according to the corresponding relation of the Key data to be deleted Rule clock is closed in corresponding write-in and target preserves duration;Receive and close rule clock acquisition submodule, the conjunction for obtaining the storage device advises the currency of clock as the data Rule clock is closed in the reception for deleting instruction;Duration judging submodule, for closing rule clock and said write conjunction rule clock according to described receive, judge described to be deleted Whether the time that Key data store in the storage device, which exceedes the target, preserves duration;Fail determination sub-module, for being to preserve duration more than the target when the judged result of the duration judging submodule When, determine the Key data failures to be deleted in the storage device.
- 12. device according to claim 9, it is characterised in that described device also includes:Data determining module to be migrated, for determining data to be migrated;Data message acquisition module to be migrated, for obtaining Key data to be migrated corresponding to the data to be migrated, to be migrated Digital digest when Value data, target preserve duration, rule clock is closed in write-in and write;Second computing module, for the Key data to be migrated, Value data to be migrated and described being write using preset algorithm Enter to close rule clock to be calculated, obtain Contemporary Digital summary;Digital digest judge module, for judging that the Contemporary Digital summary is plucked with numeral during the Key data write-in to be migrated It is whether equal;Transferring module, for when the judged result of the digital digest judge module is equal, determining the Key numbers to be migrated According to being not tampered with, and by the Key data to be migrated, Value data to be migrated, target preserves duration, rule clock is closed in write-in, moves Rule clock is closed in migration during shifting and user's mark is sent to target storage device.
- 13. device according to claim 9, it is characterised in that described device also includes:Migrating data acquisition module, for obtaining migrating data, the migrating data includes:Migrate Key data, migration Value Data, target preserve duration, rule clock is closed in write-in, rule clock is closed in migration and user's mark;Secondary write closes rule clock acquisition module, for being moved described in the currency conduct for the conjunction rule clock for obtaining the storage device Rule clock is closed in the secondary write-in for moving data;3rd computing module, for the migration Key data, migration Value data and described secondary being write using preset algorithm Enter to close rule clock to be calculated, obtain secondary write-in digital digest;Duration calculation module, it is secondary for closing rule clock according to target preservation duration, write-in and migrating conjunction rule clock calculation Preserve duration;Second corresponding relation building module, for establishing the migration Key data and secondary preservation duration, user's mark and two The secondary write-in corresponding relation of secondary write-in digital digest;Second writing module, for the migration Key data, migration Value data and the secondary write-in corresponding relation to be write Enter into the storage device.
- 14. device according to claim 9, it is characterised in that described device also includes:Message sending module, sent for the Ethernet interface by the storage device to NTP ntp server One NTP message, the very first time stamp T1 at the time of NTP messages are sent is carried in the NTP messages;Response message acquisition module, the response message returned for obtaining the ntp server according to the NTP messages are described The second time stamp T 2 at the time of the very first time stamp T1, ntp server reception NTP messages is carried in response message The 3rd time stamp T 3 at the time of the response message is sent with the ntp server;Timestamp acquisition module, for obtaining the 4th time stamp T 4 at the time of the storage device receives response message;Very first time difference computing module, for utilizing very first time stamp T1, the second time stamp T 2, the 3rd time stamp T 3 and the Four time stamp Ts 4, calculate the time difference between the ntp server and the storage device;First close rule clock determining unit, for using after the time difference described in the clock delay of the ntp server as the conjunction Advise clock.
- 15. device according to claim 9, it is characterised in that described device also includes:First moment acquisition module, for obtaining trusted timestamp TSA servers by the Ethernet interface of the storage device First moment Tc1 of clock;Data to be signed processing module, for using first moment Tc1 and presupposed information composition data to be signed, and by institute State data to be signed and be sent to the TSA servers, so that the TSA servers are signed to the data to be signed;Signature result receiving module, for receiving the signature result of the TSA servers return, carried in the signature result The second moment Ts1 and TSA servers when first moment Tc1, the TSA servers are calculated is to result of calculation The 3rd moment Ts2 when being encrypted;Deciphering module, the signature result is decrypted for the public key decryptions using the TSA servers, and obtains decryption When the 4th moment Tc2;Second time difference computing module, for utilizing first moment Tc1, the second moment Ts1, the 3rd moment Ts2 and the 4th Moment Tc2, calculate the time difference between the TSA servers and the storage device;Second close rule clock determining module, for using after the time difference described in the clock delay of the TSA servers as the conjunction Advise clock.
- 16. device according to claim 9, it is characterised in that described device also includes:Moment value acquisition module is tested, for obtaining each node local clock in the cluster where the storage device simultaneously Test moment value;Mean value computation module, for the average of the test moment value of each node in computing cluster, and each node is calculated respectively Test moment value and the average variance;Destination node selecting module, for selecting variance to be located at the node of preset range as destination node;3rd closes rule clock determining module, when standard is calculated in the local clock for all destination nodes using selection Clock is advised in clock, the conjunction as the storage device.
- A kind of 17. data storage device, it is characterised in that including:Processor and memory, wherein, the memory memory storage There is the operational order that the processor is able to carry out, so that the computing device following steps:Receive data write instruction;Judge whether include write once read many WORM marks in the data write instruction;When including WORM marks in the data write instruction, extracted from the data write instruction Key data to be written, Value data, target preservation duration and write-in user's mark to be written;Obtain the processor and close the currency of rule clock as write-in conjunction rule clock;The rule clock that closes is default described The absolute clock of storage device accreditation, the rule clock that closes include but is not limited to NTP NTP clocks or trusted time Stab TSA clocks;Rule clock is closed to Key data, Value data to be written and the write-in to be written to calculate, obtain using preset algorithm To digital digest;Establish the corresponding relation that the Key data to be written preserve duration, user's mark and digital digest with the target;Key data, Value data to be written and the corresponding relation to be written are written in the memory.
- 18. equipment according to claim 17, it is characterised in that being also stored with the processor in the memory can The operational order of execution, so that the computing device following steps:Instruction is deleted by the key value Key-Value interfaces data of the storage device;Deleted from the data in instruction and extract Key data to be deleted;Judge whether the Key data to be deleted in the storage device fail;If failure, by the Key data to be deleted, Value data to be deleted, and, it is corresponding with the Key data to be deleted Relation is deleted from the storage device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410652141.1A CN104461380B (en) | 2014-11-17 | 2014-11-17 | Date storage method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410652141.1A CN104461380B (en) | 2014-11-17 | 2014-11-17 | Date storage method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104461380A CN104461380A (en) | 2015-03-25 |
CN104461380B true CN104461380B (en) | 2017-11-21 |
Family
ID=52907509
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410652141.1A Active CN104461380B (en) | 2014-11-17 | 2014-11-17 | Date storage method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461380B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9927984B2 (en) * | 2015-10-14 | 2018-03-27 | Samsung Electronics Co., Ltd. | Electronic system with interface control mechanism and method of operation thereof |
CN111427517A (en) | 2015-12-28 | 2020-07-17 | 华为技术有限公司 | Data processing method and NVMe memory |
CN107436726B (en) * | 2016-05-26 | 2020-09-08 | 华为技术有限公司 | Data writing method, storage controller, computing device and storage device |
CN108021585B (en) * | 2016-10-28 | 2022-01-18 | 腾讯科技(深圳)有限公司 | Distributed data storage method and device |
CN107301018A (en) * | 2017-06-15 | 2017-10-27 | 郑州云海信息技术有限公司 | A kind of WORM technology application processes on cluster-based storage |
CN109284621B (en) * | 2017-07-19 | 2022-10-25 | 阿里巴巴集团控股有限公司 | Data protection/recovery method and device and data storage/protection method |
CN108647248B (en) * | 2018-04-16 | 2021-03-09 | 新华三技术有限公司成都分公司 | WORM state monitoring transfer method and device |
CN111381917A (en) * | 2018-12-29 | 2020-07-07 | 阿里巴巴集团控股有限公司 | Data reading and writing method and device |
CN111444396B (en) * | 2020-03-24 | 2021-06-01 | 深圳市中盛瑞达科技有限公司 | Big data storage system |
CN112911392B (en) * | 2021-01-14 | 2022-06-10 | 海信视像科技股份有限公司 | Audio and video playing control method and display device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013188153A1 (en) * | 2012-06-13 | 2013-12-19 | Caringo, Inc. | Two level addressing in storage clusters |
CN103838844A (en) * | 2014-03-03 | 2014-06-04 | 珠海市君天电子科技有限公司 | Method and device for storing and transmitting key value pair data |
CN104021049A (en) * | 2014-05-16 | 2014-09-03 | 华为技术有限公司 | Method for unifying data in distributed storage system and Ethernet interface hard disk |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4881468B1 (en) * | 2010-09-17 | 2012-02-22 | 株式会社東芝 | Storage device, protection method, and electronic device |
-
2014
- 2014-11-17 CN CN201410652141.1A patent/CN104461380B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013188153A1 (en) * | 2012-06-13 | 2013-12-19 | Caringo, Inc. | Two level addressing in storage clusters |
CN103838844A (en) * | 2014-03-03 | 2014-06-04 | 珠海市君天电子科技有限公司 | Method and device for storing and transmitting key value pair data |
CN104021049A (en) * | 2014-05-16 | 2014-09-03 | 华为技术有限公司 | Method for unifying data in distributed storage system and Ethernet interface hard disk |
Also Published As
Publication number | Publication date |
---|---|
CN104461380A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104461380B (en) | Date storage method and device | |
US11916920B2 (en) | Account access security using a distributed ledger and/or a distributed file system | |
US20190317757A1 (en) | Deployment of infrastructure in pipelines | |
CN106850746B (en) | The method and device of smooth service upgrading | |
US20160042355A1 (en) | Method and Apparatus of Identifying a Transaction Risk | |
US10567227B2 (en) | Production software application performance and resiliency testing | |
CN108039975A (en) | Container cluster management system and its application process | |
CN105027106B (en) | Data are managed in cloud computing environment using management metadata | |
CN108830104A (en) | BIM data organization method based on block chain | |
CN110222042A (en) | For determining the method, apparatus, equipment and system architecture of having checked business datum | |
CN109492049A (en) | Data processing, block generation and synchronous method for block chain network | |
CN104104582B (en) | A kind of data storage path management method, client and server | |
CN106682021A (en) | Database migration method and device | |
CN109272324A (en) | A kind of business function implementation method, system, equipment and computer storage medium | |
CN104778123A (en) | Method and device for detecting system performance | |
CN107580032A (en) | Data processing method, device and equipment | |
CN105677579B (en) | Data access method in caching system and system | |
Leimich et al. | A RAM triage methodology for Hadoop HDFS forensics | |
CN110555682B (en) | Multi-channel implementation method based on alliance chain | |
Gu et al. | Constructing and testing privacy-aware services in a cloud computing environment: challenges and opportunities | |
CN111898161B (en) | Method, system, device and medium for managing authority of HUE | |
Kumar Raju et al. | Timeline-based cloud event reconstruction framework for virtual machine artifacts | |
CN104899213B (en) | A kind of method and apparatus for parsing institution term | |
CN106557390A (en) | A kind of distributed storage file connected reference method and system | |
US20160026390A1 (en) | Method of deleting information, computer program product and computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220913 Address after: No. 1899 Xiyuan Avenue, high tech Zone (West District), Chengdu, Sichuan 610041 Patentee after: Chengdu Huawei Technologies Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |