CN110362534A - A kind of snapshot verification method, system and electronic equipment and storage medium - Google Patents

A kind of snapshot verification method, system and electronic equipment and storage medium Download PDF

Info

Publication number
CN110362534A
CN110362534A CN201910663003.6A CN201910663003A CN110362534A CN 110362534 A CN110362534 A CN 110362534A CN 201910663003 A CN201910663003 A CN 201910663003A CN 110362534 A CN110362534 A CN 110362534A
Authority
CN
China
Prior art keywords
snapshot
file
summary file
info
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910663003.6A
Other languages
Chinese (zh)
Other versions
CN110362534B (en
Inventor
雍帅
曾震
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201910663003.6A priority Critical patent/CN110362534B/en
Publication of CN110362534A publication Critical patent/CN110362534A/en
Application granted granted Critical
Publication of CN110362534B publication Critical patent/CN110362534B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application discloses a kind of snapshot verification method, system and a kind of electronic equipment and computer readable storage mediums, this method comprises: obtaining Summary file when reaching the verification time;Wherein, each Summary file is the file generated according to SNAPSHOT INFO each in memory, each SNAPSHOT INFO is the information generated according to each write request, and the SNAPSHOT INFO includes writing position in said write request, size of data, timestamp when receiving said write request;The first file content is extracted according to the writing position in each Summary file, and the second file content is calculated according to each Summary file;Snapshot is verified by comparing first file content and second file content.Snapshot verification method provided by the present application saves memory space while snapshot verifying.

Description

A kind of snapshot verification method, system and electronic equipment and storage medium
Technical field
This application involves technical field of memory, more specifically to a kind of snapshot verification method, system and a kind of electronics Equipment and a kind of computer readable storage medium.
Background technique
In the snapshot characteristic of distributed memory system, need continuously to record the variation of file content.In the prior art, Triggering snapshot manually is carried out for the file content of write-in, by comparing md5 value and the snapshot document content of original content Md5 value carries out snapshot verifying.
In order to improve snapshot verifying granularity, write-in data are divided into the data block of default size, write-in data are carried out Piecemeal storage, it is data block that snapshot can be verified to particle size reduction.It is large number of due to data block, it needs using the above scheme at this time A large amount of md5 value is stored, memory is caused to overflow.
Therefore, memory space how is saved while snapshot verifying is that those skilled in the art need the technology solved to ask Topic.
Summary of the invention
The application be designed to provide a kind of snapshot verification method, system and a kind of electronic equipment and a kind of computer can Storage medium is read, saves memory space while snapshot verifying.
To achieve the above object, this application provides a kind of snapshot verification methods, comprising:
When reaching the verification time, Summary file is obtained;Wherein, each Summary file is according to each fast in memory According to the file that information generates, each SNAPSHOT INFO is the information generated according to each write request, the SNAPSHOT INFO packet Include said write request in writing position, size of data, receive said write request when timestamp;
The first file content is extracted according to the writing position in each Summary file, and according to each abstract text Part calculates the second file content;
Snapshot is verified by comparing first file content and second file content.
Wherein, the SNAPSHOT INFO further includes snapshot version when receiving said write request, and the snapshot version exists It is updated when each snapshot operation according to preset rules.
Wherein, further includes:
When receiving target write request, target snapshot information is generated according to the target write request and is stored to institute It states in memory;
Write-in content is calculated according to the target snapshot information, is the data block of default size by said write division of teaching contents And it is filled since the target writing position.
Wherein, it is described receive target write request after, further includes:
The data in the target writing position are obtained, calculate corresponding first SNAPSHOT INFO of the data, and will be described Snapshot version in first SNAPSHOT INFO is as the first snapshot version;
Using the latest snapshot version in the data in the memory corresponding second SNAPSHOT INFO as the second snapshot Version;
Judge whether the first snapshot version and the second snapshot version are consistent;
If so, executing the step for requesting to generate SNAPSHOT INFO and store into the memory according to said write.
Wherein, the acquisition Summary file, comprising:
The Summary file is determined according to current Summary file or comprehensive summary file;
Wherein, the current Summary file is the Summary file generated according to recent snapshot information, the recent snapshot letter Breath is the SNAPSHOT INFO generated in the last verification time to this verification time, and the comprehensive summary file includes described current Summary file and non-present Summary file, the non-present Summary file is by obtaining the corresponding abstract text of non-present SNAPSHOT INFO Part obtains, and the non-present SNAPSHOT INFO is the SNAPSHOT INFO generated before the last verification time.
It is wherein, described to verify snapshot by comparing first file content and second file content, comprising:
Judge whether first file content and second file content are consistent;
If so, determining that snapshot is verified;
If it is not, then generating the corresponding Summary file of first file content as benchmark Summary file, by comparing institute It states benchmark Summary file and the Summary file determines type of error.
It is wherein, described to determine type of error by comparing the benchmark Summary file and the Summary file, comprising:
Judge whether the benchmark Summary file and the content that timestamp and snapshot version are removed in the Summary file are consistent;
If consistent, judge whether the benchmark Summary file and the snapshot version in the Summary file are consistent;If so, Then decision error type is IO out-of-order, if it is not, then decision error type is snapshot loss;
If inconsistent, decision error type is error in data.
To achieve the above object, this application provides a kind of snapshots to verify system, comprising:
Module is obtained, for obtaining Summary file when reaching the verification time;Wherein, each Summary file is root According to the file that SNAPSHOT INFO each in memory generates, each SNAPSHOT INFO is the information generated according to each write request, The SNAPSHOT INFO include said write request in writing position, size of data, receive said write request when time Stamp;
First computing module, for extracting the first file content according to the writing position in each Summary file, and The second file content is calculated according to each Summary file;
Comparison module, for verifying snapshot by comparing first file content and second file content.
To achieve the above object, this application provides a kind of electronic equipment, comprising:
Memory, for storing computer program;
Processor is realized when for executing the computer program such as the step of above-mentioned snapshot verification method.
To achieve the above object, this application provides a kind of computer readable storage medium, the computer-readable storages It is stored with computer program on medium, the step such as above-mentioned snapshot verification method is realized when the computer program is executed by processor Suddenly.
By above scheme it is found that a kind of snapshot verification method provided by the present application, comprising: when reaching the verification time, Obtain Summary file;Wherein, each Summary file is the file generated according to SNAPSHOT INFO each in memory, each described SNAPSHOT INFO is the information generated according to each write request, and the SNAPSHOT INFO includes the write-in position in said write request Set, size of data, receive said write request when timestamp;It is extracted according to the writing position in each Summary file First file content, and the second file content is calculated according to each Summary file;By comparing first file content Snapshot is verified with second file content.
Snapshot verification method provided by the present application obtains the Summary file generated according to each SNAPSHOT INFO, each first SNAPSHOT INFO corresponds to a file write request.For the multiple write operations of the same data file, each write operation is equal A corresponding SNAPSHOT INFO, a therefore data file can correspond to multiple Summary files, each Summary file can by timestamp into Row is distinguished.It is verified by comparing the file content directly extracted from writing position and according to the file content that Summary file generates fast According to Summary file committed memory is smaller, does not need to store a large amount of md5 value in memory, saves memory headroom.The application also public affairs A kind of snapshot verifying system and a kind of electronic equipment and a kind of computer readable storage medium have been opened, above-mentioned technology is equally able to achieve Effect.
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited Application.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.Attached drawing is and to constitute specification for providing further understanding of the disclosure A part, be used to explain the disclosure together with following specific embodiment, but do not constitute the limitation to the disclosure.Attached In figure:
Fig. 1 is a kind of flow chart of snapshot verification method shown according to an exemplary embodiment;
Fig. 2 is the flow chart of another snapshot verification method shown according to an exemplary embodiment;
Fig. 3 is the flow chart according to another snapshot verification method shown in an exemplary embodiment;
Fig. 4 is a kind of structure chart of snapshot verifying system shown according to an exemplary embodiment;
Fig. 5 is the structure chart according to a kind of electronic equipment shown in an exemplary embodiment.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
The embodiment of the present application discloses a kind of snapshot verification method, saves memory space while snapshot verifying.
Referring to Fig. 1, a kind of flow chart of snapshot verification method shown according to an exemplary embodiment, as shown in Figure 1, packet It includes:
S101: when reaching the verification time, Summary file is obtained;
Wherein, each Summary file is the file generated according to SNAPSHOT INFO each in memory, each snapshot Information is the information generated according to each write request, and the SNAPSHOT INFO includes writing position, number in said write request According to size, receive said write request when timestamp;
The present embodiment can be applied to distributed memory system, it is therefore intended that the snapshot in verifying system, executing subject can Think the processor in the distributed memory system, more specifically can be snapshot identifying object.Herein not to the verification time It is specifically limited, i.e., the present embodiment can be clocked flip, every triggering of preset period snapshot verifying, naturally it is also possible to To trigger manually, at the time of the verification time can also include that other are specific, when such as write operation exception, will be carried out in subsequent embodiment It is discussed in detail.
Snapshot document has recorded the last verification time to all data files are write in system between this verification time Enter operation, it can be understood as the set of all SNAPSHOT INFOs within the above-mentioned period.SNAPSHOT INFO SNAPSHOT INFO is asked according to write-in Seek survival into, including in the write request writing position, size of data, receive the write request when timestamp, certainly also It may include random seed (key) etc..Writing position herein is initial position, since write-in data are divided into write-in Data block can determine the data block number that the write-in data occupy according to the size of data of the size of data block and write-in data Amount.Preferably, SNAPSHOT INFO can also include snapshot version when receiving the write request.It in specific implementation, is each Snapshot version (snapID) is arranged in snapshot document, and snapshot version is updated in each snapshot operation according to preset rules.It is excellent Be selected as it is incremented by successively according to preset incremental gradient, for example, snapshot document of the last verification time into this verification time SnapID be 1, then the snapID of snapshot document of this verification time into the verification time next time is 2, snapID at this time Incremental gradient be 1.Certainly, those skilled in the art also can choose other incremental gradients and incremental manner, only need to guarantee The incremental continuity of snapshot version.
It is understood that needing to suspend all write operations in storage system when carrying out verifying snapshot, in snapshot Object (FileBench, for creating file and carrying out write-in behaviour to file is written in the file of the heart (SnapKeeper) Xiang Suoyou Make) broadcast is sent, file write-in object stops write operation when receiving broadcast, and is replied to snapshot center, in snapshot The heart executes the step of obtaining Summary file after receiving All Files write-in the replying message of object.It is extensive after snapshot is proved to be successful The write operation of multiple file write-in object.
When carrying out snapshot verifying, acquisition Summary file, Summary file are generated according to the SNAPSHOT INFO in memory first.Often The corresponding Summary file of a SNAPSHOT INFO, for the multiple write operations of the same data file, each write operation is right A SNAPSHOT INFO is answered, therefore a data file corresponds to multiple Summary files, when each Summary file can be according to write operation Different snapshot versions distinguish, if the write operation generated in the same snapshot period, then can be carried out according to timestamp It distinguishes.
Preferably, this step includes: to determine the Summary file according to current Summary file or comprehensive summary file;Its In, the current Summary file is the Summary file generated according to recent snapshot information, and the recent snapshot information is the last time The SNAPSHOT INFO generated in verification time to this verification time, the comprehensive summary file include the current Summary file and Non-present Summary file, the non-present Summary file are obtained by obtaining the corresponding Summary file of non-present SNAPSHOT INFO, institute Stating non-present SNAPSHOT INFO is the SNAPSHOT INFO generated before the last verification time.
That is, the Summary file in this step can only include according to the last verification time to this verification time The current Summary file that the SNAPSHOT INFO of interior generation generates, the present embodiment are only used for in the above-mentioned period (this proving period) Snapshot verified.Summary file can also include according to the non-of the SNAPSHOT INFO generation generated before the last verification time Current Summary file, the present embodiment can verify snapshot all in system, it is to be understood that since non-present is plucked File is wanted to generate in other proving periods, this proving period can be obtained directly from memory.Certainly, in order to save It deposits, can also be regenerated in this proving period, herein without specifically limiting.
In specific implementation, the type of the write operation of file write-in object includes write-in, creation and deletion etc., for writing Enter process specifically: when receiving target write request, target snapshot information is generated according to the target write request and is deposited Storage is into the memory;Write-in content is calculated according to the target snapshot information, is default size by said write division of teaching contents Data block and filled since the target writing position.As it can be seen that write-in content is calculated according to SNAPSHOT INFO using md5 algorithm It obtains, the snapshot of the write-in content is verified, it is corresponding using the Summary file generated by the SNAPSHOT INFO.In addition, being write in file It is fashionable, piecemeal operation is carried out to write-in content, it can be specific to error block in snapshot verifying.Above-mentioned default size is excellent It is selected as 512 bytes, it can realize the verifying granularity of 512 bytes.
S102: the first file content is extracted according to the writing position in each Summary file, and according to each described Summary file calculates the second file content;
In specific implementation, include the corresponding writing position of write operation in each Summary file, extract the write-in position The file content set is as the first file content.It is understood that since the writing position for including in write request is starting Address corresponds to a data block, therefore the first file content in this step is the file content in a data block.Simultaneously Md5 algorithm is utilized according to each Summary file that previous step obtains, calculates its corresponding second file content, herein second File content is also the file content in Summary file in the corresponding data block of writing position.
S103: snapshot is verified by comparing first file content and second file content.
In this step, compare the first file content and the second file content, unanimously the then corresponding snapshot of the Summary file Information Authentication passes through, inconsistent to show to the step S101 Summary file obtained and according to the first file content reverse resolution Summary file shown.Reverse resolution herein can be understood as the inverse process of above-mentioned md5 algorithm.Due in the first file Hold the file content for indicating a data block with the second file content, therefore when mistake occurs for snapshot, can determine specific Error block, the granularity that reports an error be data block, with report an error in the prior art granularity be entire file scheme compared with, snapshot is tested It is higher to demonstrate,prove precision.
In addition, when SNAPSHOT INFO includes snapshot version, and the Summary file in step S101 includes that all in system pluck When wanting file, whether can also continuously determine whether that there are snapshot losses according to the snapshot version in all Summary files.
Snapshot verification method provided by the embodiments of the present application obtains the abstract text generated according to each SNAPSHOT INFO first Part, the corresponding file write request of each SNAPSHOT INFO.For the multiple write operations of the same data file, be written every time Operation corresponds to a SNAPSHOT INFO, therefore a data file can correspond to multiple Summary files, when each Summary file can pass through Between stab and distinguish.By comparing the file content directly extracted from writing position and the file content generated according to Summary file Snapshot is verified, Summary file committed memory is smaller, does not need to store a large amount of md5 value in memory, saves memory headroom.
The data writing process of above-mentioned distributed memory system is described below, specific:
Referring to fig. 2, the flow chart of another snapshot verification method shown according to an exemplary embodiment, as shown in Fig. 2, Include:
S201: when receiving target write request, the data in the target writing position is obtained, the data are calculated Corresponding first SNAPSHOT INFO, and using the snapshot version in first SNAPSHOT INFO as the first snapshot version;
Before data write-in, for the continuity for guaranteeing snapshot version, the first data in extraction target writing position, utilize The inverse process of md5 algorithm calculates the corresponding SNAPSHOT INFO of the data, i.e., the first SNAPSHOT INFO in this step believes the first snapshot Snapshot version in breath is as the first snapshot version.
S202: using the latest snapshot version in the data in the memory corresponding second SNAPSHOT INFO as second Snapshot version;
S203: judge whether the first snapshot version and the second snapshot version are consistent;If so, into S204;
In this step, it compares the first snapshot version and whether the second snapshot version is consistent, unanimously then illustrate snapshot version Continuously, inconsistent into S203, then it reports an error, naturally it is also possible to the step S101 in an embodiment is carried out, according to all The continuity of snapshot version in Summary file determines the snapshot version lost.
S204: target snapshot information is generated according to the target write request and is stored into the memory;
In this step, multiple file write-in objects can be called to carry out write-in behaviour to each file in distributed memory system Make.Each write operation all needs generation SNAPSHOT INFO to save into memory, to carry out snapshot verifying when verification time arrival.
S205: calculating write-in content according to the target snapshot information, is default size by said write division of teaching contents Data block is simultaneously filled since the target writing position.
In this step, the write-in content of data block is calculated according to SNAPSHOT INFO, correspondingly, verifying in snapshot When also calculated and compared using the corresponding Summary file of SNAPSHOT INFO.
It can be seen that the present embodiment compares the corresponding snapshot version of data of writing position storage before carrying out write operation Whether the snapshot version in the SNAPSHOT INFO stored in memory with the data is consistent, ensure that snapshot version is continuous.Data with Data block is that unit is written, and can determine specific error block in snapshot verifying, reduce the report of snapshot verifying Wrong granularity.
The embodiment of the present application discloses a kind of snapshot verification method, and relative to first embodiment, the present embodiment is to technical side Case has made further instruction and optimization.It is specific:
Referring to Fig. 3, the flow chart of another snapshot verification method shown according to an exemplary embodiment, as shown in figure 3, Include:
S301: when reaching the verification time, Summary file is obtained;
S302: the first file content is extracted according to the writing position in each Summary file, and according to each described Summary file calculates the second file content;
S303: judge whether first file content and second file content are consistent;If;Then enter S304; If it is not, then entering S305;
S304: determine that snapshot is verified;
S305: the corresponding Summary file of first file content is generated as benchmark Summary file, by comparing described Benchmark Summary file and the Summary file determine type of error.
In this step, when snapshot malfunctions, comparison according to the benchmark Summary file of the first file content reverse resolution with The Summary file that step S301 is obtained determines type of error.Type of error herein may include error in data, IO out-of-order and fast According to loss etc., error in data i.e. the first file content and the second file content are completely inconsistent, IO random ordering, that is, system time hair Raw chaotic, the snapshot version that snapshot is lost in i.e. system is discontinuous.
Specifically, the step of determining type of error with the Summary file by comparing the benchmark Summary file can wrap It includes:
S51: judge in the benchmark Summary file and the Summary file except the content of timestamp and snapshot version whether Unanimously;If consistent, enter S52: if inconsistent, entering S55;
S52: judge whether the benchmark Summary file and the snapshot version in the Summary file are consistent;If so, into Enter S53;If it is not, then entering S54;
S53: decision error type is IO out-of-order;
S54;Decision error type is snapshot loss;
S55: decision error type is error in data.
In specific implementation, if two Summary files are only the inconsistent of timestamp, it can determine that type of error is IO out-of-order, If two Summary files, there are the inconsistent of snapshot version, decision error type is snapshot loss.
It can be seen that the present embodiment can compare the benchmark Summary file according to the first file content reverse resolution and obtain Summary file determine type of error, realize the accurate identification of snapshot mistake.
A kind of snapshot verifying system provided by the embodiments of the present application is introduced below, a kind of snapshot described below is tested Card system can be cross-referenced with a kind of above-described snapshot verification method.
Referring to fig. 4, the structure chart of a kind of snapshot verifying system shown according to an exemplary embodiment, as shown in figure 4, packet It includes:
Module 401 is obtained, for obtaining Summary file when reaching the verification time;Wherein, each Summary file is According to the file that SNAPSHOT INFO each in memory generates, each SNAPSHOT INFO is the letter generated according to each write request Breath, the SNAPSHOT INFO include said write request in writing position, size of data, receive said write request when Between stab;
First computing module 402, for extracting the first file content according to the writing position in each Summary file, And the second file content is calculated according to each Summary file;
Comparison module 403, for verifying snapshot by comparing first file content and second file content.
Snapshot provided by the embodiments of the present application verifies system, obtains the abstract text generated according to each SNAPSHOT INFO first Part, the corresponding file write request of each SNAPSHOT INFO.For the multiple write operations of the same data file, be written every time Operation corresponds to a SNAPSHOT INFO, therefore a data file can correspond to multiple Summary files, when each Summary file can pass through Between stab and distinguish.By comparing the file content directly extracted from writing position and the file content generated according to Summary file Snapshot is verified, Summary file committed memory is smaller, does not need to store a large amount of md5 value in memory, saves memory headroom.
On the basis of the above embodiments, the SNAPSHOT INFO further includes receiving institute as a preferred implementation manner, Snapshot version when write request is stated, the snapshot version is updated in each snapshot operation according to preset rules.
On the basis of the above embodiments, as a preferred implementation manner, further include:
Generation module, for generating target snapshot according to the target write request when receiving target write request Information is simultaneously stored into the memory;
Said write division of teaching contents is pre- for calculating write-in content according to the target snapshot information by writing module If the data block of size is simultaneously filled since the target writing position.
On the basis of the above embodiments, as a preferred implementation manner, further include:
Second computing module calculates the data corresponding first for obtaining the data in the target writing position SNAPSHOT INFO, and using the snapshot version in first SNAPSHOT INFO as the first snapshot version;
Determining module, for by the latest snapshot version in the data in the memory corresponding second SNAPSHOT INFO As the second snapshot version;
Judgment module, for judging whether the first snapshot version and the second snapshot version are consistent;If so, opening Move the workflow of the generation module.
On the basis of the above embodiments, the acquisition module 401 is specially when arrival as a preferred implementation manner, When the verification time, the module of the Summary file is determined according to current Summary file or comprehensive summary file;Wherein, described current Summary file is the Summary file generated according to recent snapshot information, and the recent snapshot information is the last verification time to originally The SNAPSHOT INFO generated in the secondary verification time, the comprehensive summary file include the current Summary file and non-present abstract text Part, the non-present Summary file are obtained by obtaining the corresponding Summary file of non-present SNAPSHOT INFO, the non-present snapshot Information is the SNAPSHOT INFO generated before the last verification time.
On the basis of the above embodiments, the comparison module 403 includes: as a preferred implementation manner,
Judging unit, for judging whether first file content and second file content are consistent;If so, opening The workflow of dynamic judging unit;If it is not, then starting the workflow of determination unit;
The judging unit, for determining that snapshot is verified;
The determination unit, for generating the corresponding Summary file of first file content as benchmark Summary file, Type of error is determined by comparing the benchmark Summary file and the Summary file.
On the basis of the above embodiments, the determination unit includes: as a preferred implementation manner,
Subelement is generated, for generating the corresponding Summary file of first file content as benchmark Summary file;
First judgment sub-unit, for judging in the benchmark Summary file and the Summary file except timestamp and snapshot Whether the content of version is consistent;If consistent, start the workflow of the second judgment sub-unit;If inconsistent, start third Determine the workflow of subelement;
Second judgment sub-unit, for judging the snapshot version in the benchmark Summary file and the Summary file It is whether consistent;If so, starting first determines the workflow of subelement;If it is not, then starting second determines the work of subelement Process;
Described first determines subelement, is IO out-of-order for decision error type;
Described second determines subelement, is snapshot loss for decision error type;
The third determines subelement, is error in data for decision error type.
About the system in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
Present invention also provides a kind of electronic equipment, referring to Fig. 5, a kind of electronic equipment 500 provided by the embodiments of the present application Structure chart, as shown in figure 5, may include processor 11 and memory 12.The electronic equipment 500 can also include multimedia group Part 13, one or more of input/output (I/O) interface 14 and communication component 15.
Wherein, processor 11 is used to control the integrated operation of the electronic equipment 500, to complete above-mentioned snapshot verification method In all or part of the steps.Memory 12 is used to store various types of data to support the operation in the electronic equipment 500, These data for example may include the instruction of any application or method for operating on the electronic equipment 500, and The relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, video etc..The memory 12 can By any kind of volatibility or non-volatile memory device or their combination realization, such as static random access memory Device (Static Random Access Memory, abbreviation SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), erasable programmable Read-only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), programmable read only memory (Programmable Read-Only Memory, abbreviation PROM), and read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or CD.Multimedia component 13 may include screen and audio component.Wherein shield Curtain for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component may include one A microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in memory It 12 or is sent by communication component 15.Audio component further includes at least one loudspeaker, is used for output audio signal.I/O interface 14 provide interface between processor 11 and other interface modules, other above-mentioned interface modules can be keyboard, mouse, button Deng.These buttons can be virtual push button or entity button.Communication component 15 for the electronic equipment 500 and other equipment it Between carry out wired or wireless communication.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication Component 15 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, electronic equipment 500 can be by one or more application specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device, Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array (Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member Part is realized, for executing above-mentioned snapshot verification method.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should The step of above-mentioned snapshot verification method is realized when program instruction is executed by processor.For example, the computer readable storage medium can Think the above-mentioned memory 12 including program instruction, above procedure instruction can be executed by the processor 11 of electronic equipment 500 with complete At above-mentioned snapshot verification method.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration ?.It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.

Claims (10)

1. a kind of snapshot verification method characterized by comprising
When reaching the verification time, Summary file is obtained;Wherein, each Summary file is to be believed according to snapshot each in memory The file generated is ceased, each SNAPSHOT INFO is the information generated according to each write request, and the SNAPSHOT INFO includes institute State the writing position in write request, size of data, receive said write request when timestamp;
The first file content is extracted according to the writing position in each Summary file, and according to each Summary file meter Calculate the second file content;
Snapshot is verified by comparing first file content and second file content.
2. snapshot verification method according to claim 1, which is characterized in that the SNAPSHOT INFO further includes receiving described write Enter snapshot version when requesting, the snapshot version is updated in each snapshot operation according to preset rules.
3. snapshot verification method according to claim 2, which is characterized in that further include:
When receiving target write request, target snapshot information is generated according to the target write request and is stored to described interior In depositing;
According to the target snapshot information calculate write-in content, by said write division of teaching contents be preset size data block and from The target writing position starts to fill.
4. snapshot verification method according to claim 3, which is characterized in that it is described receive target write request after, also Include:
The data in the target writing position are obtained, calculate corresponding first SNAPSHOT INFO of the data, and by described first Snapshot version in SNAPSHOT INFO is as the first snapshot version;
Using the latest snapshot version in the data in the memory corresponding second SNAPSHOT INFO as the second snapshot version;
Judge whether the first snapshot version and the second snapshot version are consistent;
If so, executing the step for requesting to generate SNAPSHOT INFO and store into the memory according to said write.
5. snapshot verification method according to claim 1, which is characterized in that the acquisition Summary file, comprising:
The Summary file is determined according to current Summary file or comprehensive summary file;
Wherein, the current Summary file is the Summary file generated according to recent snapshot information, and the recent snapshot information is The SNAPSHOT INFO generated in the last verification time to this verification time, the comprehensive summary file include the current abstract File and non-present Summary file, the non-present Summary file are obtained by obtaining the corresponding Summary file of non-present SNAPSHOT INFO It arrives, the non-present SNAPSHOT INFO is the SNAPSHOT INFO generated before the last verification time.
6. the snapshot verification method according to any one of claim 2 to 5, which is characterized in that described by comparing described the One file content and second file content verify snapshot, comprising:
Judge whether first file content and second file content are consistent;
If so, determining that snapshot is verified;
If it is not, then generating the corresponding Summary file of first file content as benchmark Summary file, by comparing the base Quasi- Summary file and the Summary file determine type of error.
7. snapshot verification method according to claim 6, which is characterized in that it is described by comparing the benchmark Summary file with The Summary file determines type of error, comprising:
Judge whether the benchmark Summary file and the content that timestamp and snapshot version are removed in the Summary file are consistent;
If consistent, judge whether the benchmark Summary file and the snapshot version in the Summary file are consistent;If so, sentencing Determining type of error is IO out-of-order, if it is not, then decision error type is snapshot loss;
If inconsistent, decision error type is error in data.
8. a kind of snapshot verifies system characterized by comprising
Module is obtained, for obtaining Summary file when reaching the verification time;Wherein, each Summary file is in The file that each SNAPSHOT INFO generates in depositing, each SNAPSHOT INFO is the information generated according to each write request, described SNAPSHOT INFO include said write request in writing position, size of data, receive said write request when timestamp;
First computing module, for according in each Summary file writing position extract the first file content, and according to Each Summary file calculates the second file content;
Comparison module, for verifying snapshot by comparing first file content and second file content.
9. a kind of electronic equipment characterized by comprising
Memory, for storing computer program;
Processor, realizing the snapshot verification method as described in any one of claim 1 to 7 when for executing the computer program Step.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes the step of the snapshot verification method as described in any one of claim 1 to 7 when the computer program is executed by processor Suddenly.
CN201910663003.6A 2019-07-22 2019-07-22 Snapshot verification method and system, electronic equipment and storage medium Active CN110362534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910663003.6A CN110362534B (en) 2019-07-22 2019-07-22 Snapshot verification method and system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910663003.6A CN110362534B (en) 2019-07-22 2019-07-22 Snapshot verification method and system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110362534A true CN110362534A (en) 2019-10-22
CN110362534B CN110362534B (en) 2023-05-12

Family

ID=68220708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910663003.6A Active CN110362534B (en) 2019-07-22 2019-07-22 Snapshot verification method and system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110362534B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182313A1 (en) * 2002-03-19 2003-09-25 Federwisch Michael L. System and method for determining changes in two snapshots and for transmitting changes to destination snapshot
US20050182797A1 (en) * 2004-02-12 2005-08-18 International Business Machines Corporation Method and apparatus for file system snapshot persistence
US20060047658A1 (en) * 2004-08-31 2006-03-02 Microsoft Corporation Verifying dynamically generated operations on a data store
US20100114832A1 (en) * 2008-10-31 2010-05-06 Lillibridge Mark D Forensic snapshot
US8954383B1 (en) * 2012-06-29 2015-02-10 Emc Corporation Analyzing mapping objects of file systems
US9405483B1 (en) * 2014-03-11 2016-08-02 Amazon Technologies, Inc. Optimized write performance at block-based storage during volume snapshot operations
US20170031772A1 (en) * 2015-07-31 2017-02-02 Netapp Inc. Incremental transfer with unused data block reclamation
US20170147445A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Calculation of representative values for similarity units in deduplication of snapshots data
US9696940B1 (en) * 2013-12-09 2017-07-04 Forcepoint Federal Llc Technique for verifying virtual machine integrity using hypervisor-based memory snapshots
CN109597794A (en) * 2018-12-05 2019-04-09 郑州云海信息技术有限公司 A kind of file management method, system and electronic equipment and storage medium
CN110018999A (en) * 2019-04-15 2019-07-16 深信服科技股份有限公司 A kind of file management method, system and electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182313A1 (en) * 2002-03-19 2003-09-25 Federwisch Michael L. System and method for determining changes in two snapshots and for transmitting changes to destination snapshot
US20050182797A1 (en) * 2004-02-12 2005-08-18 International Business Machines Corporation Method and apparatus for file system snapshot persistence
US20060047658A1 (en) * 2004-08-31 2006-03-02 Microsoft Corporation Verifying dynamically generated operations on a data store
US20100114832A1 (en) * 2008-10-31 2010-05-06 Lillibridge Mark D Forensic snapshot
US8954383B1 (en) * 2012-06-29 2015-02-10 Emc Corporation Analyzing mapping objects of file systems
US9696940B1 (en) * 2013-12-09 2017-07-04 Forcepoint Federal Llc Technique for verifying virtual machine integrity using hypervisor-based memory snapshots
US9405483B1 (en) * 2014-03-11 2016-08-02 Amazon Technologies, Inc. Optimized write performance at block-based storage during volume snapshot operations
US20170031772A1 (en) * 2015-07-31 2017-02-02 Netapp Inc. Incremental transfer with unused data block reclamation
US20170147445A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Calculation of representative values for similarity units in deduplication of snapshots data
CN109597794A (en) * 2018-12-05 2019-04-09 郑州云海信息技术有限公司 A kind of file management method, system and electronic equipment and storage medium
CN110018999A (en) * 2019-04-15 2019-07-16 深信服科技股份有限公司 A kind of file management method, system and electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110362534B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
CN104246767B (en) Telemetry system for cloud synchronization system
CN110162662B (en) Verification method, device and equipment for data records in block chain type account book
CN107403089B (en) Resource tampering identification method and device based on application program
CN104700022B (en) A kind of dynamic authentication code generating method and device
US20140033229A1 (en) Method and computation node for processing application data
WO2012106969A1 (en) Log management device and method
CN110851535B (en) Data processing method and device based on block chain, storage medium and terminal
CN104169902A (en) Synchronizing local and remote data
CN109597653A (en) Method, BIOS and the BMC of BIOS and BMC command interaction
CN106557308A (en) A kind of software continuous integrated approach and device
CN105183641B (en) The data consistency verification method and system of a kind of kernel module
CN108573172B (en) Data checking and storing method and device
CN114328281A (en) Method and device for processing abnormal power failure of solid state disk, electronic equipment and medium
CN109462661A (en) Method of data synchronization, device, computer equipment and storage medium
CN110362534A (en) A kind of snapshot verification method, system and electronic equipment and storage medium
EP2972879A1 (en) Method and system for analyzing a trace timeline of computer system activity
KR102103590B1 (en) Method for automatic test of program compatibility and apparatus using the same
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium storing program for executing
CN110347581B (en) Test method and device and electronic equipment
US10853462B2 (en) Authorizing file access with user I/O and hardware usage patterns
CN113011869A (en) Test data generation method and device and computer readable storage medium
CN112416657A (en) System cloning method
CN102236748A (en) Computer software protection method
CN101201882B (en) Operating system protection method
CN110018930A (en) Image recovery method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant