CN109933564A - File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction - Google Patents
File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction Download PDFInfo
- Publication number
- CN109933564A CN109933564A CN201910238373.5A CN201910238373A CN109933564A CN 109933564 A CN109933564 A CN 109933564A CN 201910238373 A CN201910238373 A CN 201910238373A CN 109933564 A CN109933564 A CN 109933564A
- Authority
- CN
- China
- Prior art keywords
- page
- data
- snapshot
- node
- inode
- 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.)
- Pending
Links
Abstract
The application provides file system management method, device, terminal, the medium that quick rollback is realized based on chained list and N-ary tree construction, the described method includes: the data based on N-ary tree construction management the be stored in amount of physical memory of file system, to enable file data random storage in amount of physical memory;Based on the snapshot version of logical data page in chained list management file, the data snapshot and rollback of file system are executed.The application manages the data of the be stored in physical address space of file system using N-ary tree construction, realize random storage of the file data in amount of physical memory, based on the snapshot version of logical data page in chained list management file, the data snapshot and rollback of file system are realized.
Description
Technical field
This application involves file system management technical fields, fast more particularly to being realized based on chained list and N-ary tree construction
File system management method, device, terminal, the medium of fast rollback.
Background technique
As the development and IBM of the novel memory technology such as NVDIMM, 3D Xpoint are to storage level memory (Storage
Class Memory, SCM) framework proposition, based on mixing memory system framework and management non-volatile memory NVM become research
Hot spot.Novel memory technology SCM have the characteristics that it is non-volatile, read to write fastly fast, low in energy consumption, but still have gap compared with DRAM,
Limited wiping cycle life of writing also reduces the reliability of system.In the prior art, it is proposed based on novel memory technology SCM excessive
Kind memory organization mode and optimization method.
With the development of the technologies such as big data, cloud computing, Internet of Things, data just constantly increasing at an unprecedented rate and
Accumulation.These data how are managed and organized, are a challenge for traditional file system.Although current file system
A kind of easy-to-use Method of Data Organization is provided for application, however the Method of Data Organization is that the hardware characteristics based on block device are set
Meter, be unable to give full play SCM can random access performance characteristics.Therefore, how organization data is effectively organized, allows application program energy
It is enough to use and access in a manner of closer to memory, and it is able to maintain that file system is reliable, advantages easy to maintain and shared etc., it is maximum
Change ground and improves system overall operation efficiency as urgent problem to be solved.
Apply for content
In view of the foregoing deficiencies of prior art, the application is designed to provide based on chained list and N-ary tree construction
File system management method, device, terminal, the medium for realizing quick rollback, for solving the problems of the prior art.
In order to achieve the above objects and other related objects, the first aspect of the application provides a kind of based on chained list and N-ary
Tree construction realizes the file system management method of quick rollback comprising: it is stored based on N-ary tree construction management file system
In the data of amount of physical memory, to enable file data random storage in amount of physical memory;Based in chained list management file
The snapshot version of logical data page executes the data snapshot and rollback of file system.
In some embodiments of the first aspect of the application, the file system is equipped with: the area iNode is stored with more
A iNode node;Each iNode node includes iNode nodes information field, N-ary tree grade digital section, N-ary tree root section
Point field and snapshot version pointer field;Wherein, the iNode nodes information field is used for the management information of storage file;
The N-ary tree grade digital section is used for the series of the used N-ary tree construction of storage file;The N-ary root vertex field
For N grades of node page Page of storage fileNStart physical address;The snapshot version pointer field is for being directed toward the iNode
Snapshot iNode node corresponding to the last snapshot of node;Data field is used for storage file data;The data field
Page includes the node page and data page of mutual mixing;
Wherein, using N grades of node page page numbers corresponding to file as root node, with (N-1) grade node page page number for the 1st
Grade child node, and so on, with the 1st grade of node page page number for (N-1) grade child node, a N-ary tree is formed to this article
All data of part carry out storage management;All data pages occupy the afterbody node of N-ary tree, root node physical address
It is recorded in the area iNode in iNode structure corresponding to this document with the series of tree;Chained list area, is patrolled for managing in file
Collect the snapshot version of data page;The chained list area includes a plurality of page index record, and each index record corresponds to the data field
One physical page.The creation time and thereon of the data page is saved in data field in page index record corresponding to each data page
The location information of one edition data page, to form data page chained list, all data in every data page chained list in data field
Whole old versions that the current version and snapshot of some logical data page generate in page respective file.
It is fast according to the creation time of iNode node and the last time in some embodiments of the first aspect of the application
According to the comparison result information of time, the update mode of the corresponding iNode node is selected.When creating snapshot, file system record
The recent snapshot time, when system request updates data page, if the data page creation time will be updated prior to the recent snapshot time
Free page is written in data, as new data page, former data page location information and current time write-in new data page is corresponding
In index record, so that new data page is inserted into the head of data page chained list, and more new node page content makes it be directed toward new data
Page;If the data page creation time is later than the recent snapshot time, illustrate that current data page was also not backed up, then can be based on current number
According to the multiple more new data of page, until Snapshot time reaches next time.
In some embodiments of the first aspect of the application, which comprises if the creation time of the iNode node
It is later than the last Snapshot time, then is updated on the iNode node;If the creation time of the iNode node is earlier than most
A nearly Snapshot time then distributes backup node of the free time iNode node as original iNode node in the area iNode, and enables original
It is updated after the node number of iNode node storage backup node.
In some embodiments of the first aspect of the application, the file system safeguards a snapshot under root folder
File, and will be under the content map of root folder to snapshot document folder;Wherein: the case where passing through root folder path access
Under, read-write operation is completed directly against the current version of file data;In the case where pressing from both sides path access by snapshot document, refuse
Exhausted write operation, and the latest edition in file data before specified Snapshot time is returned to read operation.
In some embodiments of the first aspect of the application, which comprises file system is in response read operation text
When part system is accessed in a manner of POSIX, access the state data memory of specified time as follows: process requested access should
Logical page (LPAGE) before moment;File system traverses the corresponding page of the chain table section logical page (LPAGE) and indexes chained list, to obtain earlier than this
Moment and the Page table index record nearest apart from the moment;N- is updated according to the page physical address saved in the index record
The logical page (LPAGE) corresponding physical address information in respective nodes page in ary tree construction.
In some embodiments of the first aspect of the application, which comprises be rolled back to as follows a certain
Snapshot point: the file for working as front opening is closed;Creation time, is later than the iNode of Snapshot time by the area iNode of traversal file system
Knot removal recycling;Erasing time is later than Snapshot time but creation time is restored earlier than the iNode node of Snapshot time, and it is right
Linking relationship makes corresponding modification;Other iNode nodes retain constant;Chained list area is traversed, creation time is later than Snapshot time
Data page recycled by changing bit map area corresponding bits, and corresponding modification made to linking relationship, restores file data
To snapshot point version;Other data pages retain constant.
In order to achieve the above objects and other related objects, the second aspect of the application provides a kind of based on chained list and N-ary
Tree construction realizes the apparatus for file system management of quick rollback comprising: data memory module, for being based on N-ary tree construction
The data of the be stored in amount of physical memory of file system are managed, to enable file data random storage in amount of physical memory;
Data snapshot and roll-back module execute file system for the snapshot version based on logical data page in chained list management file
Data snapshot and rollback.
In order to achieve the above objects and other related objects, the third aspect of the application provides a kind of computer-readable storage medium
Matter is stored thereon with computer program, realizes when the computer program is executed by processor described based on chained list and N-ary tree
Structure realizes the file system management method of quick rollback.
In order to achieve the above objects and other related objects, the fourth aspect of the application provides a kind of electric terminal, comprising: place
Manage device and memory;The memory is used to execute the memory storage for storing computer program, the processor
Computer program, so that the terminal executes the file system pipe for realizing quick rollback based on chained list and N-ary tree construction
Reason method.
As described above, the application based on chained list and N-ary tree construction realize quick rollback file system management method,
Device, terminal, medium have the advantages that the application manages the be stored in physics of file system using N-ary tree construction
The data of address space realize random storage of the file data in amount of physical memory, based on logic in chained list management file
The snapshot version of data page realizes the data snapshot and rollback of file system.
Detailed description of the invention
Fig. 1 is shown as realizing the file system of quick rollback in one embodiment of the application based on chained list and N-ary tree construction
The flow diagram of management method.
Fig. 2 is shown as the schematic diagram of the file system of N-ary tree construction in one embodiment of the application.
Fig. 3 is shown as the plane figure schematic diagram of file system in one embodiment of the application.
Fig. 4 is shown as the structural schematic diagram in the area iNode in one embodiment of the application.
Fig. 5 is shown as the N-ary tree construction of file in one embodiment of the application and file data in the distribution of data field
Schematic diagram.
Fig. 6 is shown as realizing the file system of quick rollback in one embodiment of the application based on chained list and N-ary tree construction
Managing device schematic diagram.
Fig. 7 is shown as the structural schematic diagram of electric terminal in one embodiment of the application.
Specific embodiment
Illustrate presently filed embodiment below by way of specific specific example, those skilled in the art can be by this specification
Disclosed content understands other advantages and effect of the application easily.The application can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also based on different viewpoints and application, without departing from
Various modifications or alterations are carried out under spirit herein.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It should be noted that with reference to attached drawing, attached drawing describes several embodiments of the application in described below.It should
Understand, other embodiments also can be used, and mechanical group can be carried out without departing substantially from spirit and scope
At, structure, electrical and operational change.Following detailed description should not be considered limiting, and the application
The range of embodiment only limited by the claims for the patent announced.Term used herein is merely to description is specific
Embodiment, and it is not intended to limit the application.The term of space correlation, for example, "upper", "lower", "left", "right", " following ", " under
Side ", " lower part ", " top ", " top " etc. can be used in the text in order to elements or features shown in explanatory diagram and another
The relationship of one elements or features.
In this application unless specifically defined or limited otherwise, term " installation ", " connected ", " connection ", " fixation ",
Terms such as " fixings " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;
It can be mechanical connection, be also possible to be electrically connected;It can be directly connected, can also indirectly connected through an intermediary, it can be with
It is the connection inside two elements.For the ordinary skill in the art, above-mentioned art can be understood as the case may be
The concrete meaning of language in this application.
Furthermore as used in herein, singular " one ", "one" and "the" are intended to also include plural number shape
Formula, unless there is opposite instruction in context.It will be further understood that term "comprising", " comprising " show that there are the spies
Sign, operation, element, component, project, type, and/or group, but it is not excluded for one or more other features, operation, element, group
Presence, appearance or the addition of part, project, type, and/or group.Term "or" and "and/or" used herein are interpreted as including
Property, or mean any one or any combination.Therefore, " A, B or C " or " A, B and/or C " mean " it is following any one:
A;B;C;A and B;A and C;B and C;A, B and C ".Only when the combination of element, functions or operations is inherently mutual under certain modes
When repulsion, it just will appear the exception of this definition.
As the development and IBM of the novel memory technology such as NVDIMM, 3D Xpoint are to storage level memory (Storage
Class Memory, SCM) framework proposition, based on mixing memory system framework and management non-volatile memory NVM become research
Hot spot.Novel memory technology SCM have the characteristics that it is non-volatile, read to write fastly fast, low in energy consumption, but still have gap compared with DRAM,
Limited wiping cycle life of writing also reduces the reliability of system.In the prior art, it is proposed based on novel memory technology SCM excessive
Kind memory organization mode and optimization method.
With the development of the technologies such as big data, cloud computing, Internet of Things, data just constantly increasing at an unprecedented rate and
Accumulation.These data how are managed and organized, are a challenge for traditional file system.Although current file system
A kind of easy-to-use Method of Data Organization is provided for application, however the Method of Data Organization is that the hardware characteristics based on block device are set
Meter, be unable to give full play SCM can random access performance characteristics.Therefore, how organization data is effectively organized, allows application program energy
It is enough to use and access in a manner of closer to memory, and it is able to maintain that file system is reliable, advantages easy to maintain and shared etc., it is maximum
Change ground and improves system overall operation efficiency as urgent problem to be solved.
In view of the foregoing deficiencies of prior art, the main thought of the application, which is intended to provide, can be realized quick rollback
File system management method, device, terminal, the medium that quick rollback is realized based on chained list and N-ary tree construction of random access,
It uses N-ary tree construction to manage the data of the be stored in physical address space of this document system, realizes file data in physics
Random storage in memory space, without pressing Documents Logical sequence in physical address space sequential storage, thus maximumlly
Improve the operational efficiency of file system entirety;Based on the snapshot version of logical data page in chained list management file, file system is realized
The data snapshot and rollback of system.
As shown in Figure 1, showing the file for realizing quick rollback in one embodiment of the application based on chained list and N-ary tree construction
The flow diagram of method for managing system.In this present embodiment, the method includes the steps S11 and step S12.
It should be noted that method provided by the present application can be applied to controller, and such as: ARM controller, FPGA control
Device, SoC controller, dsp controller or MCU controller etc..This method can also be applied to include memory, storage control
Device, one or more processing units (CPU), Peripheral Interface, RF circuit, voicefrequency circuit, loudspeaker, microphone, input/output
(I/O) computer of subsystem, display screen, other outputs or the control components such as equipment and outside port;The computer packet
It includes but is not limited to such as desktop computer, laptop, tablet computer, smart phone, smart television, personal digital assistant
PCs such as (Personal Digital Assistant, abbreviation PDA).This method applies also for server, the clothes
Business device can be arranged in one or more property servers according to many factors such as function, loads, can also by being distributed or
The server cluster of concentration is constituted.
In step s 11, the data based on N-ary tree construction management the be stored in amount of physical memory of file system, with
Enable file data random storage in amount of physical memory.
N-ary tree, is called N-ary tree, is a kind of common tree data structure, is usually used to complete the quick row of data
Sequence, data compression and quick-searching.N-ary tree has a root node, and the son node number of each node is identical.The application
What is provided realizes that the file system management method of quick rollback can be applied to dynamic randon access based on chained list and N-ary tree construction
The storage system of memory and non-volatile RAM unified addressing.Wherein, the non-volatile RAM includes
Phase transition storage, resistance-variable storing device, magnetic memory, ferroelectric memory etc..
In this present embodiment, the area iNode, chained list area and data field are set in file system, and file system is based on N-ary tree
Structure realizes the random storage of file data, and the data snapshot and rollback of file system are realized based on chained list management.
In one embodiment, the iNode node stored in the area iNode includes N-ary tree grade digital section and N-ary
Root vertex field, the N-ary tree grade digital section are used for the series of the used N-ary tree construction of storage file, the N-ary
Root vertex field is used for the start physical address of N grades of node pages of storage file;INode node further includes snapshot version pointer
Field, the snapshot version pointer field is for being directed toward the section of snapshot iNode corresponding to the last snapshot of the iNode node
Point.
In one embodiment, the data field includes node page and data page, and the data page is used for storage file data,
The node page is for storing the physical address of next stage node page or data page in N-ary tree;The data page and the section
Point page is in data field mixing.
In order to facilitate the understanding of those skilled in the art, it is carried out now in conjunction with the file system of Fig. 2 N-ary tree construction shown
It is corresponding to illustrate.In Fig. 2, using N grades of node page page numbers is root nodes corresponding to file, with (N-1) grade node
Page page number is the 1st grade of child node, and so on, with the 1st grade of node page page number for (N-1) grade child node, form a N-ary
Tree carries out storage management with all data to this document;Wherein the 1st grade of node page is data page;N-ary traversal of tree sequence
For the logical order of data page.
In one embodiment, the chained list area is made of a plurality of page index record, and every page index record corresponds in order
One physical page of data field, page index record number is identical as data field physical page number, each data page institute in data field
The interior creation time for saving the data page of corresponding page index record and the thereon location information of an edition data page, thus
Data field forms data page chained list, in every data page chained list in all data page respective files some logical data page it is current
Whole old versions that version and snapshot generate.
As shown in figure 3, showing the plane figure schematic diagram of file system in one embodiment of the application.In this present embodiment,
File system includes superblock area, bit map area, the area iNode, chained list area and data field.
In this present embodiment, the area iNode structure as shown in figure 4, in the present embodiment the area iNode structure and the prior art
In the structure in the area iNode have significantly different, each iNode node increases on the basis of existing iNode nodes information field
N-ary tree grade digital section, N-ary root vertex field and snapshot version pointer field are added.
Specifically, iNode nodes information field is used for the management information of storage file, such as founder, creation time, storage
Catalogue, permission etc.;N-ary tree grade digital section is used for the series of the used N-ary tree construction of storage file;N-ary tree root section
Point field is used for N grades of node page Page of storage fileNStart physical address.Snapshot version pointer field is for being directed toward this
Snapshot iNode node corresponding to the last snapshot of iNode node.
In this present embodiment, data field and the data field in existing file system are also different, the data field in the application
Page be divided into node page and data page, node page and data page mixing, the node page is for storing next stage section in N-ary tree
The physical address of point page or data page, data page are used for storage file data.With N grades of node pages corresponding to file
NodePageNPage number is root node, with (N-1) grade node page NodePageN-1Page number is the 1st grade of child node, and so on,
With the 1st grade of node page NodePage1Page number is (N-1) grade child node, forms a N-ary tree with all numbers to this document
According to storage management is carried out, the 1st grade of node page is data page.
Specifically, the amount of physical memory where file data, based on N grades of node pages of file corresponding to file
NodePageNPage number, (N-1) grade node page NodePageN-1Page number ... ..., the 1st grade of node page NodePage1Page number, with
N grades of node page NodePageNPage number is root node, with (N-1) grade node page NodePageN-1Page number is the 1st grade of child node,
And so on, the 1st grade of node page NodePage1Page number is (N-1) grade child node, forms a N-ary tree and comes to number of files
According to progress storage management.
In one embodiment, every first nodes manage its child node, every grade of child node in a manner of page table in N-ary tree
Number be fixed as 512.As shown in Fig. 2, the 1st grade of node page NodePage1Page is data page.That is, from root node
It is used to organize node page to N-2 grades of child nodes, N-1 grades of child nodes are used to organize data page.Root node storage
The physical address of the corresponding node page of 1st grade of child node;1st grade of child node stores the object of the corresponding node page of the 2nd grade of child node
Manage address;And so on, (N-2) grade child node stores the physical address of the corresponding node page of (N-1) grade child node.1st
Grade node page is data page, and all data pages occupy the afterbody node of N-ary tree.Therefore, the page object stored in node page
Managing address can be next stage node page physical address, or data page physical address.
The present embodiment manages all-file data, the size and operating system memory page size of page in a manner of page
Unanimously.N-ary traversal of tree sequence is the logical order of data page.Wherein, serial number of the data page when N-ary tree traverses should
The logical page number (LPN) of data page hereof.Therefore, the data where the address can be extrapolated according to the logical address in file
The logical page number (LPN) and the data page of page are to the path of root node.
In step s 12, the snapshot version based on logical data page in chained list management file, executes the data of file system
Snapshot and rollback.
The chained list area is used to manage the snapshot version of logical data page in file, realize file system data snapshot and
Rollback.Specifically, chained list directorial area is made of N item page index record, a physics in every page index record corresponding data area
The page, chained list directorial area capacity are the 1/512 of data field total capacity, and page index record establishes page index note as unit of 8 bytes
Mapping relations between record and data field Physical Page.Preceding 4 byte memory pages of the page index record of chained list directorial area are physically
Location, rear 4 bytes store Physical Page modification time.Each logical page (LPAGE) of file system exists with one or more page of index record
Incidence relation, the modification time of page index record refer to the current modification time of logical page (LPAGE), the page physical address of page index record
Refer to the physical address of corresponding data page after once modifying before logical page (LPAGE).When logical page (LPAGE) in file system is repeatedly modified,
The data page of the data page that same logical page (LPAGE) will have multiple versions, multiple versions is saved in data field.With same logical page (LPAGE)
There are the page index records of incidence relation to form one page index chained list, every number according to the time modification sequencing of the logical page (LPAGE)
The whole history versions generated according to the current version and snapshot of some logical data page in data page respective files all in page chained list
This.
In one embodiment, which comprises according to the creation time of iNode node and the last Snapshot time
Comparison result information selects the update mode of the corresponding iNode node.
Specifically, when system request updates iNode node information, if the creation time of the iNode node is later than recently
Snapshot time is then completed to update directly on the iNode;Otherwise a free time iNode node is newly distributed in the area iNode to make
For snapshot iNode, it is based on original iNode node information initial snapshot iNode node information, is saved on former iNode node fast
According to iNode node number, and complete to update.
For example, when system request updates the filename of a file A, compare iNode firstAThe creation time of node
TAWhether than file system the last time Snapshot time TsnapshotIf TAIt is later than Tsnapshot, then the iNode of supporting paper AAKnot
Point creation time is later than the last snapshot creation time, and Snapshot time has not arrived next time, can be directly at A pairs of file
The iNode answeredAThe relevant information that the node is repeatedly updated on node, if TAEarlier than Tsnapshot, then the iNode of supporting paper AAKnot
Point creation time had been saved iNode when creating earlier than the last snapshot creation time, the last snapshotAThe shape of node
State information, updates iNode againAWhen node information, then need newly to distribute a free time iNode in the area iNodeA1Node conduct
Node iNodeASnapshot iNodeA1, it is based on iNodeANode information initial snapshot iNodeA1Node information, and in iNodeA
Snapshot iNode is saved on nodeA1Node number is then based on node iNodeAIt completes to update.
In one embodiment, when creating snapshot, file system records the recent snapshot time, and system request updates data page
When, if free page is written prior to the recent snapshot time, by more new data in the data page creation time, as new data page,
Former data page location information and current time are written in the corresponding index record of new data page, so that new data page is inserted into number
According to the head of page chained list, and more new node page content makes it be directed toward new data page;If the data page creation time is later than current fast
According to the time, illustrate that current data page was also not backed up, then can be based on current data page repeatedly more new data, until snapshot next time
Time reaches.
For example, if file A presses write operation sequence, the 1st logical page (LPAGE), the 500th logical page (LPAGE), the 600th are patrolled
Volume page, the 1000th logical page (LPAGE) realize write operation, then the N-ary tree construction of this document and file data are in data field
Distribution situation is as shown in Figure 5.This document has 3 node pages, 4 data pages, interior joint page NodePage3It is deposited for root node
Store up node page NodePage21 and NodePage22 physical address, node page NodePage21 stores and respective logic
The corresponding data page DataPage of page number21 and data page DataPage5001 physical address, node page NodePage22 storages
Data page DataPage corresponding with respective logic page number6001 and data page DataPage10001 physical address.Chained list
4 index records respectively correspond data page DataPage in area21、DataPage5001、DataPage6001 and data page
DataPage10001, have recorded the creation time of corresponding data page.
If process will write the 500th logic web update data, system is first looked at corresponding to the 500th logical page (LPAGE)
Data page DataPage5001 creation time TDataPage500The 1 and and Snapshot time T with file system the last timesnapshotPhase
Compare, if TDataPage5001 is later than TSnapshot,Then illustrate data page DataPage corresponding to the 500th logical page (LPAGE)5001 wound
Building the time is later than the last snapshot creation time, and Snapshot time has not arrived next time, can be directly in data page
DataPage500The relevant information that the node is repeatedly updated on 1, if TDataPage5001 earlier than Tsnapshot, then illustrate data page
DataPage5001 creation time had been saved when creating earlier than the last snapshot creation time, the last snapshot
DataPage5001 status information is based on page faults mechanism when process will again update the 500th logical page data
Newly one data page DataPage corresponding with the 500th logical page (LPAGE) of distribution5002, one and data page are created in chained list area
DataPage5002 corresponding index records, then by data page DataPage5002 physical address is stored to node page
NodePage21 appropriate address field.In chained list area, with data page DataPage5002 distribution time filling will be counted with physics
According to page DataPage500The time field of the corresponding index record of 2 Physical Page, with data page DataPage5001 physical address
It updates and physics is by data page DataPage500The physical address field of the corresponding index record of 2 Physical Page.
And so on, after repeatedly being updated to the 500th logical page (LPAGE) and after multiple corresponding specified time interval snapshot, after
It is continuous to be assigned with Physical Page DataPage5003、DataPage5004 ..., DataPage500The 500th logical data page of N, file A
Current version and snapshot generate whole old versions it is as shown in Figure 5.
Preferably, the file system safeguards snapshot document folder under root folder, and by the content of root folder
It maps under snapshot document folder;Wherein: in the case where passing through root folder path access, read-write operation is directly against number of files
According to current version complete;In the case where pressing from both sides path access by snapshot document, refuse write operation, and text is returned to read operation
Latest edition of the number of packages in front of specified Snapshot time.
In one embodiment, file data is accessed based on POSIX mode, distinguishes snapshot text by iNode identification means
Part or ordinary file, to realize the read and write access with read access, to ordinary file to snapshot document.File system is in root file
Safeguard that a snapshot document presss from both sides snapshot under folder/root, by the method for mapping by the content map of root file system to fastly
According under file, by the current version of root folder path access file data, path is pressed from both sides by snapshot document to realize pair
Specified time corresponding File Snapshot version.
In this implementation by example, root/root of file system includes that a snapshot document presss from both sides snapshot/ and three
File File1, File2, File3.When system will access the data in file system, memory is arrived by file system mounted first
In, create a root node iNoderoot, iNode is filled based on the root node information in file systemrootNode information,
When system will be accessed to iNodeFile1When the file answered, system is by the file data of file File1 current version from file system
System reads in memory, then carries out corresponding read-write operation.When system will access the file under snapshot snapshot file, need
The root node information filling that under the content map of root folder to snapshot document folder, will be primarily based in file system
iNodesnapshotNode information, when system will access iNode under snapshot fileFile1It, first will mark when the file answered
Remember iNodeFile1, then system is by the iNode after labelFile1And corresponding Snapshot time is handed down to file system.File system root
According to labeled iNodeFile1, search iNodeFile1Corresponding file, and by access request specified time corresponding snapshot version
It copies in memory for system read access.
Preferably, when file system accesses a certain snapshot point, file system is in response read operation file system with the side POSIX
When formula accesses, accessible specified time T0State data memory, its step are as follows:
Step 1: process requested access T0Logical page (LPAGE) Lpage before moment.
Step 2: file system traverses chained list directorial area page corresponding with logical page (LPAGE) LPage and indexes chained list, finds early
In T0Moment and from T0Moment it is nearest Page table index record.
Step 3: logical page (LPAGE) LPage in N-ary tree construction is updated with the page physical address saved in above-mentioned index record
The corresponding physical address information in respective nodes page.
Preferably, the file system of the random access of the N-ary tree construction of quick rollback is realized based on chained list management, it is special
Sign is: when being rolled back to a certain snapshot point, its step are as follows:
Step 1: closing the file of all openings.
Step 2: the iNode that creation time is later than Snapshot time is deleted recycling by the area traversal file system iNode;It will delete
Except the time is later than Snapshot time but creation time is restored earlier than the iNode of Snapshot time, and corresponding modification is made to linking relationship;
Other iNode retain constant.
Step 3: traversal chained list directorial area, the data page that creation time is later than Snapshot time are corresponding by change bit map area
Bit is recycled, and makes corresponding modification to linking relationship, restores file data to snapshot point version;Other data pages retain
It is constant.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of computer program is crossed to complete.Computer program above-mentioned can store in a computer readable storage medium
In.When being executed, execution includes the steps that above-mentioned each method embodiment to the program;And storage medium above-mentioned include: ROM,
The various media that can store program code such as RAM, magnetic or disk.
As shown in fig. 6, showing the file for realizing quick rollback in one embodiment of the application based on chained list and N-ary tree construction
The schematic diagram of system management facility.Described device includes data memory module 61 and data snapshot and roll-back module 62.
Data memory module 61 is used for the number based on N-ary tree construction management the be stored in amount of physical memory of file system
According to enable file data deposit at random in amount of physical memory.Data snapshot and roll-back module 62 are used for based on chained list management text
The snapshot version of logical data page in part, executes the data snapshot and rollback of file system.
It should be noted that the file system provided in this embodiment for realizing quick rollback based on chained list and N-ary tree construction
The embodiment for managing device of uniting, with the file system for realizing quick rollback based on chained list and N-ary tree construction being provided above
The embodiment for management method of uniting is similar, and so it will not be repeated.It is further to note that it should be understood that the modules of apparatus above
Division be only a kind of logic function division, can completely or partially be integrated on a physical entity in actual implementation,
It can also be physically separate.
As shown in fig. 7, showing the structural schematic diagram of another electric terminal provided by the embodiments of the present application.This example provides
Electric terminal, comprising: processor 71, memory 72, transceiver 73, communication interface 74 and system bus 75;72 He of memory
Communication interface 74 connect with processor 71 and transceiver 73 and completes mutual communication by system bus 75, and memory 72 is used
In storage computer program, communication interface 74 and transceiver 73 are used to be communicated with other equipment, and processor 71 is for running
Computer program makes electric terminal execute the file system management for as above realizing quick rollback based on chained list and N-ary tree construction
Each step of method.
System bus mentioned above can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The system bus can be divided into address bus, data/address bus, control bus etc..
Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.Communication connects
Mouth is for realizing the communication between database access device and other equipment (such as client, read-write library and read-only library).Storage
Device may include random access memory (Random Access Memory, abbreviation RAM), it is also possible to further include non-volatile deposit
Reservoir (non-volatile memory), for example, at least a magnetic disk storage.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In conclusion the application provides the file system management side for realizing quick rollback based on chained list and N-ary tree construction
Method, device, terminal, medium, the application manage the number of the be stored in physical address space of file system using N-ary tree construction
According to, random storage of the realization file data in amount of physical memory, the snapshot based on logical data page in chained list management file
Version realizes the data snapshot and rollback of file system.So the application effectively overcome various shortcoming in the prior art and
Has high industrial utilization value.
The principles and effects of the application are only illustrated in above-described embodiment, not for limitation the application.It is any ripe
Know the personage of this technology all can without prejudice to spirit herein and under the scope of, carry out modifications and changes to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from spirit disclosed herein and institute under technical idea such as
At all equivalent modifications or change, should be covered by claims hereof.
Claims (11)
1. a kind of file system management method for realizing quick rollback based on chained list and N-ary tree construction, which is characterized in that packet
It includes:
Based on the data of N-ary tree construction management the be stored in amount of physical memory of file system, to enable file data in physics
Random storage in memory space;
Based on the snapshot version of logical data page in chained list management file, the data snapshot and rollback of file system are executed.
2. the method according to claim 1, wherein the file system is equipped with:
The area iNode is stored with multiple iNode nodes;Each iNode node includes iNode nodes information field, N-ary
Set grade digital section, N-ary root vertex field and snapshot version pointer field;Wherein, the iNode nodes information field
Management information for storage file;The N-ary tree grade digital section is used for the grade of the used N-ary tree construction of storage file
Number;The N-ary root vertex field is used for N grades of node page Page of storage fileNStart physical address;The snapshot version
Pointer field is for being directed toward snapshot iNode node corresponding to the last snapshot of the iNode node;Data field, for depositing
Store up file data;The page of the data field includes the node page and data page of mutual mixing;
Wherein, using N grades of node page page numbers corresponding to file as root node, with (N-1) grade node page page number for the 1st grade of son
Node, and so on, with the 1st grade of node page page number for (N-1) grade child node, a N-ary tree is formed to this document
All data carry out storage management;All data pages occupy the afterbody node of N-ary tree, root node physical address and tree
Series be recorded in the area iNode in iNode structure corresponding to this document;
Chained list area, for managing the snapshot version of logical data page in file;The chained list area includes a plurality of page index record, respectively
Index record corresponds to a physical page of the data field;It is protected in page index record corresponding to each data page in data field
The creation time and the location information of an edition data page thereon of the data page are deposited, to form data page chained list in data field,
The whole that the current version and snapshot of some logical data page generate in all data page respective files in every data page chained list
Old version.
3. according to the method described in claim 2, it is characterized in that, which comprises according to the creation time of iNode node
With the comparison result information of the last Snapshot time, the update mode of the corresponding iNode node is selected;Wherein, creation is fast
According to when, file system record the recent snapshot time, system request update data page when, if the data page creation time is prior to current
Former data page location information and current time are then write more new data write-in free page as new data page by Snapshot time
Enter in the corresponding index record of new data page, so that new data page is inserted into the head of data page chained list, and in more new node page
Appearance makes it be directed toward new data page;If the data page creation time is later than the recent snapshot time, illustrate that current data page is also not backed up
It crosses, then can be based on current data page repeatedly more new data, until Snapshot time reaches next time.
4. according to the method described in claim 3, it is characterized in that, which comprises
If the creation time of the iNode node is later than the last Snapshot time, it is updated on the iNode node;
If the creation time of the iNode node distributes free time iNode section earlier than the last Snapshot time, in the area iNode
Backup node of the point as original iNode node, and be updated after enabling the node number of former iNode node storage backup node.
5. the method according to claim 1, wherein the file system safeguards a snapshot under root folder
File, and will be under the content map of root folder to snapshot document folder;Wherein:
In the case where passing through root folder path access, read-write operation is completed directly against the current version of file data;
In the case where pressing from both sides path access by snapshot document, refuse write operation, and return in file data and referring to read operation
Determine the latest edition before Snapshot time.
6. the method according to claim 1, wherein the described method includes: file system is in response read operation text
When part system is accessed in a manner of POSIX, the state data memory of specified time is accessed as follows:
Logical page (LPAGE) before the process requested access moment;
File system traverses the corresponding page of the chain table section logical page (LPAGE) and indexes chained list, to obtain earlier than the moment and when apart from this
Carve nearest Page table index record;
According to the logical page (LPAGE) in the page physical address update N-ary tree construction saved in the index record in respective nodes page
In corresponding physical address information.
7. the method according to claim 1, wherein the described method includes: being rolled back to as follows a certain
Snapshot point:
Close the file for working as front opening;
The area iNode of traversal file system recycles the iNode knot removal that creation time is later than Snapshot time;When will delete
Between be later than Snapshot time but creation time is restored earlier than the iNode node of Snapshot time, and corresponding modification is made to linking relationship;
Other iNode nodes retain constant;
Chained list area is traversed, the data page that creation time is later than Snapshot time is recycled by changing bit map area corresponding bits,
And corresponding modification is made to linking relationship, restore file data to snapshot point version;Other data pages retain constant.
8. a kind of apparatus for file system management for realizing quick rollback based on chained list and N-ary tree construction, which is characterized in that packet
It includes:
Data memory module, for managing the data of the be stored in amount of physical memory of file system based on N-ary tree construction, with
Enable file data random storage in amount of physical memory;
Data snapshot and roll-back module execute file system for the snapshot version based on logical data page in chained list management file
The data snapshot and rollback of system.
9. device according to claim 8, which is characterized in that the file system is equipped with:
The area iNode is stored with multiple iNode nodes;Each iNode node includes iNode nodes information field, N-ary
Set grade digital section, N-ary root vertex field and snapshot version pointer field;Wherein, the iNode nodes information field
Management information for storage file;The N-ary tree grade digital section is used for the grade of the used N-ary tree construction of storage file
Number;The N-ary root vertex field is used for N grades of node page Page of storage fileNStart physical address;The snapshot version
Pointer field is for being directed toward snapshot iNode node corresponding to the last snapshot of the iNode node;
Data field is used for storage file data;The page of the data field includes the node page and data page of mutual mixing;Wherein,
The node page is for storing the physical address of next stage node page or data page in N-ary tree, and the data page is for storing
File data;
Chained list area, for managing the snapshot version of logical data page in file;The chained list area includes a plurality of page index record, respectively
Index record corresponds to a physical page of the data field;It is protected in page index record corresponding to each data page in data field
The creation time and the location information of an edition data page thereon of the data page are deposited, to form page chain in data field
Table, in every data page chained list in all data page respective files the current version and snapshot of some logical data page generate it is complete
Portion's old version.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
It is realized when being executed by processor and quick rollback is realized based on chained list and N-ary tree construction described in any one of claims 1 to 7
File system management method.
11. a kind of electric terminal characterized by comprising processor and memory;
The memory is for storing computer program;
The processor is used to execute the computer program of the memory storage, so that the terminal executes such as claim 1
To the file system management method for realizing quick rollback described in any one of 7 based on chained list and N-ary tree construction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910238373.5A CN109933564A (en) | 2019-03-27 | 2019-03-27 | File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910238373.5A CN109933564A (en) | 2019-03-27 | 2019-03-27 | File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109933564A true CN109933564A (en) | 2019-06-25 |
Family
ID=66988453
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910238373.5A Pending CN109933564A (en) | 2019-03-27 | 2019-03-27 | File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109933564A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110515543A (en) * | 2019-08-02 | 2019-11-29 | 星辰天合(北京)数据科技有限公司 | Object bucket-based snapshot method, device and system |
CN112395260A (en) * | 2020-11-11 | 2021-02-23 | 苏宁云计算有限公司 | Data storage method and medium |
CN113138785A (en) * | 2021-04-21 | 2021-07-20 | 维沃移动通信有限公司 | Application program updating method and device |
CN115438628A (en) * | 2022-11-08 | 2022-12-06 | 宏景科技股份有限公司 | Structured document cooperation management method and system and document structure |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354890A (en) * | 2016-11-22 | 2017-01-25 | 中国科学院上海微系统与信息技术研究所 | Implementation method of random access file system based on N-ary tree structure |
CN107180092A (en) * | 2017-05-15 | 2017-09-19 | 中国科学院上海微系统与信息技术研究所 | A kind of control method of file system, device and terminal |
-
2019
- 2019-03-27 CN CN201910238373.5A patent/CN109933564A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354890A (en) * | 2016-11-22 | 2017-01-25 | 中国科学院上海微系统与信息技术研究所 | Implementation method of random access file system based on N-ary tree structure |
CN107180092A (en) * | 2017-05-15 | 2017-09-19 | 中国科学院上海微系统与信息技术研究所 | A kind of control method of file system, device and terminal |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110515543A (en) * | 2019-08-02 | 2019-11-29 | 星辰天合(北京)数据科技有限公司 | Object bucket-based snapshot method, device and system |
CN112395260A (en) * | 2020-11-11 | 2021-02-23 | 苏宁云计算有限公司 | Data storage method and medium |
CN113138785A (en) * | 2021-04-21 | 2021-07-20 | 维沃移动通信有限公司 | Application program updating method and device |
CN115438628A (en) * | 2022-11-08 | 2022-12-06 | 宏景科技股份有限公司 | Structured document cooperation management method and system and document structure |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109933564A (en) | File system management method, device, terminal, the medium of quick rollback are realized based on chained list and N-ary tree construction | |
CN103765393B (en) | Storage system | |
CN103020315B (en) | A kind of mass small documents storage means based on master-salve distributed file system | |
CN103473251B (en) | The method and system of the file system snapshot using selectivity tuple versioned is provided in the computing environment using processing apparatus | |
CN102436408B (en) | Data storage cloud and cloud backup method based on Map/Dedup | |
CN104298681B (en) | A kind of date storage method and device | |
CN102982151B (en) | Method for merging multiple physical files into one logic file | |
CN102915278A (en) | Data deduplication method | |
CN107247778A (en) | System and method for implementing expansible data storage service | |
CN107180092A (en) | A kind of control method of file system, device and terminal | |
CN101488153A (en) | Method for implementing high-capacity flash memory file system in embedded type Linux | |
CN106775446A (en) | Based on the distributed file system small documents access method that solid state hard disc accelerates | |
CN110347651A (en) | Method of data synchronization, device, equipment and storage medium based on cloud storage | |
CN106682110B (en) | Image file storage and management system and method based on Hash grid index | |
CN104462185A (en) | Digital library cloud storage system based on mixed structure | |
CN100424699C (en) | Attribute extensible object file system | |
CN111177143B (en) | Key value data storage method and device, storage medium and electronic equipment | |
CN106951375A (en) | The method and device of snapped volume is deleted within the storage system | |
CN109767274B (en) | Method and system for carrying out associated storage on massive invoice data | |
CN114600094A (en) | Generating hash trees for database architectures | |
CN113377868A (en) | Offline storage system based on distributed KV database | |
CN103942301B (en) | Distributed file system oriented to access and application of multiple data types | |
CN113568582A (en) | Data management method and device and storage equipment | |
CN113806300A (en) | Data storage method, system, device, equipment and storage medium | |
CN112334891A (en) | Centralized storage for search servers |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190625 |
|
RJ01 | Rejection of invention patent application after publication |