CN109491962A - A kind of file directory tree management method and relevant apparatus - Google Patents

A kind of file directory tree management method and relevant apparatus Download PDF

Info

Publication number
CN109491962A
CN109491962A CN201811315141.7A CN201811315141A CN109491962A CN 109491962 A CN109491962 A CN 109491962A CN 201811315141 A CN201811315141 A CN 201811315141A CN 109491962 A CN109491962 A CN 109491962A
Authority
CN
China
Prior art keywords
node
directory
directory tree
tree
modified
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
CN201811315141.7A
Other languages
Chinese (zh)
Other versions
CN109491962B (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.)
Shenzhen Onething Technology Co Ltd
Shenzhen Xunlei Network Technology Co Ltd
Original Assignee
Shenzhen Onething Technology 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201811315141.7A priority Critical patent/CN109491962B/en
Publication of CN109491962A publication Critical patent/CN109491962A/en
Application granted granted Critical
Publication of CN109491962B publication Critical patent/CN109491962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of file directory management methods based on Merkle DAG, when the subdirectory node of the first directory node in existing directory tree is modified, change directly is not made to existing directory tree, but this time modify first modification is determined as a result, and determining the second modification result that all ancestor directories nodes of the subdirectory node are changed with the modification of the subdirectory section.Then the first modification result of addition is modified with second as a result, so as to so that directory tree records the result after changing each time on the basis of existing directory tree, it may be convenient to the content of history modification each time is traced back to, to facilitate the recovery of directory tree.The present invention also provides a kind of directory tree managing devices, system, computer readable storage medium, and said effect equally may be implemented.

Description

A kind of file directory tree management method and relevant apparatus
Technical field
The present invention relates to directory tree technical field more particularly to a kind of file directory tree managers based on Merkle DAG Method, device, system and a kind of computer readable storage medium.
Background technique
In computer systems, the file being stored under each layer path is managed usually using directory tree, in directory tree, Parent directory saves the pointer of subdirectory, can find subdirectory by parent directory.But in current directory tree technology, if gone out The case where existing directory tree is maliciously tampered, is difficult to be restored to and distorts pervious structure.
Therefore, the structure for how easily restoring directory tree is those skilled in the art's problem to be solved.
Summary of the invention
The file directory tree management method that the purpose of the present invention is to provide a kind of based on Merkle DAG, device, system And a kind of computer readable storage medium, it is intended to solve the problems, such as the structure for how easily restoring directory tree.
To achieve the above object, a kind of file directory tree management method based on Merkle DAG provided by the invention, packet It includes:
When the subdirectory node of the first directory node in existing directory tree is modified, the subdirectory node is determined First modification result;
Determine that all ancestor directories nodes of the subdirectory node modify to obtain according to the first modification result Second modification result;
Added in the existing directory tree it is described first modification result and it is described second modify result formed it is modified Directory tree.
Optionally, all ancestor directories nodes of the determination subdirectory node according to it is described first modification result into The second modification result that row modification obtains, comprising:
The parent directory node for generating the first modification result, as the second directory node;
All ancestor directories nodes of second directory node are generated by second directory node;
It is described that the first modification result and the second modification result formation modification are added in the existing directory tree Directory tree afterwards, comprising: by all ancestrals of the first modification result, second directory node and second directory node First directory node, which is added in existing directory tree, forms modified directory tree.
Optionally, the existing directory tree and the modified directory tree are generated when being formed for recording version letter The v ion of breath, the v ion are the parent directory node of root node;Wherein, the version is preserved in the v ion The timestamp at this node generation time point.
Optionally, the v ion saves the cryptographic Hash of current version number, the cryptographic Hash of previous start context.
Optionally, each directory node saves the cryptographic Hash of current directory nodal information and current in the directory tree The cryptographic Hash of the first layer subdirectory node information of directory node.
To achieve the above object, the present invention further provides a kind of, and the file directory tree based on Merkle DAG manages dress It sets, described device includes memory and processor, and the file mesh that can be run on the processor is stored on the memory Record tree management program, the file directory tree management program realize following method when being executed by the processor: when existing catalogue When the subdirectory node of the first directory node in tree is modified, the first modification result of the subdirectory node is determined;It determines All ancestor directories nodes of the subdirectory node are tied according to the second modification that the first modification result is modified Fruit;The first modification result is added in the existing directory tree and the second modification result forms modified catalogue Tree.
Optionally, it is also realized when the file directory tree management program is executed by the processor:
The parent directory node for generating the first modification result, as the second directory node;
All ancestor directories nodes of second directory node are generated by second directory node;
It is described that the first modification result and the second modification result formation modification are added in the existing directory tree Directory tree afterwards, comprising: by all ancestrals of the first modification result, second directory node and second directory node First directory node, which is added in existing directory tree, forms modified directory tree.
Optionally, it is also realized when the file directory tree management program is executed by the processor:
The existing directory tree and the modified directory tree generate the version for being used for recording version information when being formed This node, the v ion are the parent directory node of root node;Wherein, the v ion is preserved in the v ion Generate the timestamp at time point.
Optionally, the v ion saves the cryptographic Hash of current version number, the cryptographic Hash of previous start context.
Optionally, each directory node saves the cryptographic Hash of current directory nodal information and current in the directory tree The cryptographic Hash of the first layer subdirectory node information of directory node.
To achieve the above object, invention further provides a kind of, and the file directory tree based on Merkle DAG manages system System, comprising:
First determination unit, for when the subdirectory node of the first directory node in existing directory tree is modified, really First modification result of the fixed subdirectory node;
Second determination unit, for determining all ancestor directories nodes of the subdirectory node according to first modification As a result the second modification result modified;
Adding unit, for adding the first modification result and the second modification result in the existing directory tree Form modified directory tree.
To achieve the above object, invention further provides a kind of computer readable storage mediums, and the computer can It reads to be stored with file directory tree management program on storage medium, the file directory Guan Shuli program can be handled by one or more Device executes, to realize the file directory tree management method as described in any one.
To achieve the above object, a kind of computer program product provided by the invention, which is characterized in that refer to including computer It enables, when run on a computer, computer is allowed to execute the file directory tree pipe based on Merkle DAG Reason method.
It can be seen that a kind of file directory management method based on Merkle DAG provided by the embodiments of the present application, when existing When thering is the subdirectory node of the first directory node in directory tree to be modified, change directly is not made to existing directory tree, but Determine this time modify first modification as a result, and determining all ancestor directories nodes of the subdirectory node with the specific item The the second modification result recording the modification of section and changing.Then on the basis of existing directory tree addition first modification result with Second modification is as a result, so as to so that directory tree records the result after changing each time, it may be convenient to trace back to each Secondary history modifies content, to facilitate the recovery of directory tree.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, 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 invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow diagram of one embodiment of the invention;
Fig. 2 is the flow diagram of another embodiment of the present invention;
Fig. 3 is a kind of specific existing directory tree structure schematic diagram disclosed by the embodiments of the present invention;
Fig. 4 is a kind of specific modified directory tree structure schematic diagram disclosed by the embodiments of the present invention;
Fig. 5 is a kind of specific modified directory tree structure schematic diagram disclosed by the embodiments of the present invention;
Fig. 6 is a kind of specific modified directory tree structure schematic diagram disclosed by the embodiments of the present invention;
Fig. 7 is the schematic diagram of internal structure for the directory tree managing device that one embodiment of the invention discloses.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
The description and claims of this application and term " first ", " second ", " third ", " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims Protection scope within.
The present invention provides a kind of catalog management method.
Referring to Fig.1, Fig. 1 is the flow diagram of one embodiment of the invention.
In one embodiment, this method comprises:
S101 determines the subdirectory when the subdirectory node of the first directory node in existing directory tree is modified First modification result of node.
When in the present solution, to modify to the subdirectory node of the first directory node, not directly by existing directory tree It modifies, but determines first that this is modified as a result, as the first modification result.
It should be noted that the first directory node is any node in directory tree, and corresponding modification operates, and specifically may be used It also include adding to the first directory node to include being operated to the delete operation of the existing subdirectory node of the first directory node, modification Add subdirectory node.
S102 determines that all ancestor directories nodes of the subdirectory node are modified according to the first modification result The second obtained modification result.
Further, it is determined that all ancestor directories nodes of above-mentioned subdirectory node out, ancestor directories node is this The parent directory node of subdirectory node, parent directory node of parent directory node etc., until root node.
In the present solution, each node of directory tree can record oneself information and its first layer subdirectory node Information, therefore, after the information of above-mentioned subdirectory node is modified, his father's directory node information to be recorded can also change Become, and so on, until root node requires primary change.It therefore, will also be according to after the first modification result has been determined One modification result determines that all ancestor directories nodes of subdirectory node are modified accordingly as a result, as the second modification result.
In a specific embodiment, each directory node saves current directory nodal information in the directory tree Cryptographic Hash and current directory node first layer subdirectory node information cryptographic Hash.
S103, adds the first modification result in the existing directory tree and the second modification result is formed and modified Directory tree afterwards.
In the present solution, for the ease of tracing modification content each time, above-mentioned modification operation is only merely that record is corresponding The first modification result and the second modification as a result, and there is no directly make change to existing directory tree.It in this step, will be upper It states the first modification result to be added in existing directory tree with the second modification result in the form added, forms modified catalogue Tree.
It can be seen that a kind of file for being based on Merkle DAG (Merkel's directed acyclic graph) provided by the embodiments of the present application Catalog management method, when the subdirectory node of the first directory node in existing directory tree is modified, not directly to existing mesh Record tree makes change, but determines that this time modify first modifies as a result, and determining all ancestors of the subdirectory node The second modification result that directory node is changed with the modification of the subdirectory section.Then on the basis of existing directory tree Addition first modification result with second modification as a result, so as to so that directory tree record change each time after as a result, can Easily to trace back to the content of history modification each time, to facilitate the recovery of directory tree.
It is the flow diagram of another embodiment of the present invention referring to Fig. 2, Fig. 2.
S201 determines the subdirectory when the subdirectory node of the first directory node in existing directory tree is modified First modification result of node.
S202 generates the parent directory node of the first modification result, as the second directory node.
It is to generate first to repair first in the present solution, determine the concrete operations of the second modification result of ancestor directories node The parent directory node for changing result, using the parent directory as the second directory node.
It should be noted that can determine whether the first modification as a result, and the first modification knot after above-mentioned subdirectory node is modified Fruit is exactly a new subdirectory node in fact, and is directed to this new subdirectory node, in the present solution, also needing corresponding Generate his father's directory node.It should be noted that if the subdirectory node there are also other brotghers of node before a modification, also It is the first directory node other than above-mentioned need subdirectory node to be modified, there are also other subdirectory nodes, then this is a little The brotgher of node of directory node is also required to the subdirectory node as the second directory node.In other words, the second directory node is The parent directory node of first modification result and the brotgher of node of the subdirectory node.
S203 is generated all ancestor directories nodes of second directory node by second directory node.
Further, according to above-mentioned second directory node, all ancestor directories nodes are sequentially generated.It needs to illustrate It is that these ancestor directories nodes are corresponding with the ancestor node of the first directory node in existing directory tree, is only directed to The information of one modification result, being modified in layer, and other information and the corresponding ancestor node in existing directory tree It is identical.
S204, by all ancestors of the first modification result, second directory node and second directory node Directory node, which is added in existing directory tree, forms modified directory tree.
It should be noted that existing directory tree and modified directory tree can be generated for recording version when being formed The v ion of information, it is to be understood that existing directory tree can be used as a version, and it is current modified, it is modified Directory tree then can be used as a new version, therefore for the ease of finding the directory tree of different editions, can be in this programme For the directory tree build version node of each version, the directory tree of each version just generates a record version letter when being formed The v ion of breath, the root node of v ion corresponding catalogue tree, so that corresponding directory tree can be found according to v ion Root node, so as to find whole directory tree under the version.
In a specific embodiment, v ion saves the cryptographic Hash of current version number, previous start context Cryptographic Hash.
It should be noted that the timestamp that v ion generates time point can also be recorded in above-mentioned v ion, thus The time that directory tree is formed, that is, the time that subdirectory node is modified can be determined according to timestamp.
Specific embodiment provided by the embodiments of the present application is introduced below, specific embodiments described below is pair The specific example explanation of above-described embodiment, can be cross-referenced with any of the above-described embodiment.
Referring to Fig. 3, Fig. 3 is a kind of specific existing directory tree structure schematic diagram provided by the embodiments of the present application.It is existing at this Having in directory tree, "/" is root, and first layer has " a ", " b ", " c " three subdirectory nodes respectively under root, " a ", " b ", " c " corresponding node is the subdirectory node of root node, and corresponding under " a ", " b ", " c " three catalogues is had Three subdirectory nodes " aa ", " bb ", " cc ", " aa ".
Wherein, each directory node saves the cryptographic Hash and current directory section of current directory nodal information in directory tree The cryptographic Hash of the first layer subdirectory node information of point.In the directory tree, the key-value pair information of each node may refer to table 1.Wherein, the cryptographic Hash of hash-a, that is, a, the keys of other nodes, value and so on, the key of root node is the Hash of root node information Value, is indicated with root_hash_1, and number 1 is version corresponding to this directory tree structure, and root is the meaning of " root ".It needs Illustrate, when directory node is the leaf directory node of the bottom, there is no subdirectory nodes, therefore its value is sky, i.e., []。
Table 1
Node Key (cryptographic Hash of nodal information) Value
/ Root_hash_1 (root node information cryptographic Hash) [hash-a,hash-b,hash-c]
a hash-a [hash-aa]
b hash-b [hash-bb]
c hash-c [hash-cc]
aa hash-aa []
bb hash-bb []
cc hash-cc []
In the present solution, the directory tree of each version has a v ion, v ion is as root in directory tree The parent directory node of catalogue is directed toward root.Wherein, the v ion saves the cryptographic Hash of current version number, previous version The cryptographic Hash of this number.
In the present solution, existing directory tree version be version 1, in v ion, record v ion oneself letter The information (the namely root nodal information of directory tree) of breath, its subdirectory node, can also record previous the release directory tree V ion information.
Referring to table 2, information that table 2 is recorded by the v ion of existing directory tree.
Table 2
When the subdirectory node of the first directory node in existing directory tree is modified, the subdirectory node is determined First modification result.
Specifically, modification operation includes the delete operation of the existing subdirectory node of the first directory node, modification operation, also wrap It includes and subdirectory node is added to the first directory node.Therefore, corresponding to three kinds of modification operations with three specific examples below File directory tree management method based on Merkle DAG is introduced.
Referring to fig. 4, Fig. 4 is a kind of specific modified directory tree structure schematic diagram provided by the present application.
When adding subdirectory node to the first directory node in existing directory tree, for example, the first directory node is c, One subdirectory node cc1 is added to this directory node of c, therefore, the first modification result is cc1 subdirectory node.
Further, parent directory node is generated for the first modification result, as the second directory node.Due to being in existing mesh A subdirectory cc1 node is added under c node in record tree, and its original subdirectory node cc is still remained, so cc1 is saved There are also brotgher of node cc for point, therefore the second directory node is exactly to generate parent directory node c' to cc and cc1.The information of c' i.e. include The cryptographic Hash hash-c' of c', the cryptographic Hash with its subdirectory node, the i.e. cryptographic Hash of cc and cc1 cryptographic Hash [hash-cc, hash-cc1]。
All ancestor directories nodes of the second directory node are generated by the second directory node, that is, generate the parent directory section of c' Point, that is, new root node "/".
Since the information of c directory node changes, the value of his father's directory node i.e. root node also becomes therewith Change, therefore, all new ancestor node is generated according to the second directory node c', since the second directory node only has in this programme One ancestor node, i.e. root node, therefore this programme namely generates new root node, new root node Information includes the second mesh not modified in the cryptographic Hash of oneself and the cryptographic Hash of the second directory node and existing directory tree The cryptographic Hash of the brotgher of node of node is recorded, i.e., [hash-a, hash-b, hash-c'].
All ancestor directories nodes of above-mentioned first modification result, the second directory node, the second directory node are being determined Afterwards, these contents are added in existing directory tree.Referring to table 3, table 3 is the information of the node of modified directory tree.
Table 3
It should be noted that after directory tree after the modification generates, it is also necessary to generate a v ion for it, record version This information.
Referring to table 4, information that table 4 is recorded by the v ion of modified directory tree.
Table 4
Referring to Fig. 5, Fig. 5 is a kind of specific modified directory tree structure schematic diagram provided by the present application.
When the existing subdirectory node of the first directory node in existing directory tree is modified operate when, determine first Modify result.
For example, the first directory node is c, existing subdirectory node is cc, and in the embodiment of the present application, cc is revised as Cc1, therefore the first modification result is cc1.
Further, new parent directory node is generated for the first modification result, as the second directory node, cc1 is generated New parent directory node c', at this point, the information of c' includes the cryptographic Hash hash-cc1 of the cryptographic Hash hash-c' and cc1 of c'.
All ancestor directories nodes of the second directory node are generated by the second directory node, that is, generate new root Node "/".The information of new root node includes the cryptographic Hash of oneself and the cryptographic Hash of the second directory node and existing mesh The cryptographic Hash of the brotgher of node for the second directory node not modified in record tree, i.e., [hash-a, hash-b, hash-c'].
All ancestor directories nodes of above-mentioned first modification result, the second directory node, the second directory node are being determined Afterwards, these contents are added in existing directory tree.Referring to table 5, table 5 is the information of the node of modified directory tree.
Table 5
Node Key (cryptographic Hash of nodal information) Value
/ Root_hash_1 (root node information cryptographic Hash) [hash-a,hash-b,hash-c]
a hash-a [hash-aa]
b hash-b [hash-bb]
c hash-c [hash-cc]
aa hash-aa []
bb hash-bb []
cc hash-cc []
/ root_hash_2 [hash-a,hash-b,hash-c']
c' hash-c' [hash-cc1]
cc1 Hash-cc1 []
Similarly, be also required in this programme for modified directory tree generate a v ion, content with it is above-mentioned The v ion of modified directory tree is identical in embodiment, is no longer repeated herein.
Referring to Fig. 6, a kind of Fig. 6 specific modified directory tree schematic diagram provided by the embodiments of the present application.
When being deleted the existing subdirectory node of the first directory node in existing directory tree, the first modification is determined As a result, first modifying result, that is, null value at this time, that is, there is no the subdirectory nodes.
For example, the first directory node is c, existing subdirectory node is cc, and in the embodiment of the present application, cc is deleted, because This first modification result, that is, null value.
Further, new parent directory node is generated for the first modification result, as the second directory node, repaired due to first Changing result is null value, a corresponding parent directory node c' namely subdirectory node in fact, under no subdirectory node. At this point, the information of c' is cryptographic Hash hash-c' and [] for including c'.
All ancestor directories nodes of the second directory node are generated by the second directory node, that is, generate new root Node "/".The information of new root node includes the cryptographic Hash of oneself and the cryptographic Hash of the second directory node and existing mesh The cryptographic Hash of the brotgher of node for the second directory node not modified in record tree, i.e., [hash-a, hash-b, hash-c'].
All ancestor directories nodes of above-mentioned first modification result, the second directory node, the second directory node are being determined Afterwards, these contents are added in existing directory tree.Referring to table 6, table 6 is the information of the node of modified directory tree.
Table 6
Node Key (cryptographic Hash of nodal information) Value
/ Root_hash_1 (root node information cryptographic Hash) [hash-a,hash-b,hash-c]
a hash-a [hash-aa]
b hash-b [hash-bb]
c hash-c [hash-cc]
aa hash-aa []
bb hash-bb []
cc hash-cc []
/ root_hash_2 [hash-a,hash-b,hash-c']
c' hash-c' []
Similarly, be also required in this programme for modified directory tree generate a v ion, content with it is above-mentioned The v ion of modified directory tree is identical in embodiment, is no longer repeated herein.
It is the file directory tree managing device based on Merkle DAG that one embodiment of the invention discloses referring to Fig. 7, Fig. 7 Schematic diagram of internal structure.
It is situated between below to a kind of file directory tree managing device based on Merkle DAG provided by the embodiments of the present application It continues, it is described below a kind of mutually to be joined based on the file directory tree managing device of Merkle DAG and any of the above-described embodiment According to.
In the present embodiment, the file directory tree managing device 1 based on Merkle DAG can be PC (Personal Computer, PC), be also possible to smart phone, tablet computer, palm PC, portable computer, intelligent router, Mine machine, network storage equipment terminal device.
The directory tree managing device 1 can be the node of composition CDN network or block chain network.
The directory tree managing device 1 may include memory 11, processor 12 and bus 13.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11 It can be the internal storage unit of directory tree managing device 1, such as the hard disk of the directory management device 1 in some embodiments. Memory 11 is also possible to the External memory equipment of directory management device 1, such as directory management device 1 in further embodiments The plug-in type hard disk of upper outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) block, flash card (Flash Card) etc..Further, memory 11 can also have been deposited both the inside including directory management device 1 Storage unit also includes External memory equipment.Memory 11 can be not only used for storage be installed on directory management device 1 using soft Part and Various types of data, such as the code of directory tree management program 01 etc., can be also used for temporarily storing exported or will The data to be exported.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11 Code or processing data, such as execute directory tree management program 01 etc..
The bus 13 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 bus can be divided into address bus, data/address bus, control bus etc..For convenient for indicating, in Fig. 7 only with one slightly Line indicates, it is not intended that an only bus or a type of bus.
When 01 times of processor 12 of the directory tree management program executes, following method is realized:
When the subdirectory node of the first directory node in existing directory tree is modified, the subdirectory node is determined First modification result;Determine that all ancestor directories nodes of the subdirectory node are modified according to the first modification result The second obtained modification result;The first modification result and the second modification result shape are added in the existing directory tree At modified directory tree.
It can be seen that a kind of file directory managing device based on Merkle DAG provided by the embodiments of the present application, when existing When thering is the subdirectory node of the first directory node in directory tree to be modified, change directly is not made to existing directory tree, but Determine this time modify first modification as a result, and determining all ancestor directories nodes of the subdirectory node with the specific item The the second modification result recording the modification of section and changing.Then on the basis of existing directory tree addition first modification result with Second modification is as a result, so as to so that directory tree records the result after changing each time, it may be convenient to trace back to each Secondary history modifies content, to facilitate the recovery of directory tree.
When the directory tree management program 01 is executed by the processor 12, it can also realize:
The parent directory node for generating the first modification result, as the second directory node;By second directory node Generate all ancestor directories nodes of second directory node;It is described that first modification is added in the existing directory tree As a result modified directory tree is formed with the second modification result, comprising: by the first modification result, second catalogue Node and all ancestor directories nodes of second directory node are added in existing directory tree and form modified catalogue Tree.
Wherein, the existing directory tree and the modified directory tree are generated when being formed is used for recording version information V ion, the v ion be root node parent directory node;Wherein, the version is preserved in the v ion The timestamp at node generation time point.
Wherein, the v ion saves the cryptographic Hash of current version number, the cryptographic Hash of previous start context.
Wherein, in the directory tree each directory node save current directory nodal information cryptographic Hash and current mesh Record the cryptographic Hash of the first layer subdirectory node information of node.
Further, directory tree managing device 1 can also include network interface 14, and network interface 14 optionally may include Wireline interface and/or wireless interface (such as WI-FI interface, blue tooth interface), commonly used in the device 1 and other electronic equipments Between establish communication connection.
Optionally, which can also include user interface, and user interface may include display (Display), input unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface, Wireless interface.Optionally, in some embodiments, it is aobvious to can be light-emitting diode display, liquid crystal display, touch control type LCD for display Show that device and OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touch device etc..Wherein, display Appropriate it can also be known as display screen or display unit, for being shown in the information and use that handle in directory tree managing device 1 In the visual user interface of display.
Fig. 7 illustrates only the directory tree managing device 1 with component 11-14 and directory tree management program 01, this field Technical staff may include ratio it is understood that structure shown in fig. 1 does not constitute the restriction to directory tree managing device 1 It illustrates less perhaps more components and perhaps combines certain components or different component layouts.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.
It is situated between below to a kind of file directory tree management system based on Merkle DAG provided by the embodiments of the present application Continue, it is described below it is a kind of can be cross-referenced with above-described embodiment based on the file directory tree management system of Merkle DAG.
In one embodiment, the file directory tree management system based on Merkle DAG includes:
First determination unit, for when the subdirectory node of the first directory node in existing directory tree is modified, really First modification result of the fixed subdirectory node;
Second determination unit, for determining all ancestor directories nodes of the subdirectory node according to first modification As a result the second modification result modified;
Adding unit, for adding the first modification result and the second modification result in the existing directory tree Form modified directory tree.
The present embodiment is based on Merkle based on the file directory tree management system of Merkle DAG for realizing above-mentioned The file directory tree management method of DAG, therefore the specific embodiment party in the file directory tree management system based on Merkle DAG The embodiment part of the visible file directory tree pipe method based on Merkle DAG hereinbefore of formula, for example, the first determination unit, Second determination unit, adding unit are respectively used to realize step S101, S102, S103 in above-mentioned catalog management method, so, Its specific embodiment is referred to the description of corresponding various pieces embodiment, and details are not described herein.
Present invention also provides another computer readable storage mediums, are stored thereon with computer program, the calculating Step provided by above-described embodiment may be implemented in machine program when being executed by processor.The storage medium may include: USB flash disk, move Dynamic hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), the various media that can store program code such as magnetic or disk.
Present invention also provides a kind of computer program products, which includes computer instruction, when it When running on computers, computer is allowed to execute the file mesh described in any of the above-described embodiment based on Merkle DAG Record tree management method.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present invention.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave) mode to another website Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit Any usable medium of storage either includes that the data storages such as one or more usable mediums integrated server, data center are set It is standby.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or partly lead Body medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the application Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element Or there is also other identical elements in method.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (12)

1. a kind of file directory tree management method based on Merkle DAG characterized by comprising
When the subdirectory node of the first directory node in existing directory tree is modified, the first of the subdirectory node is determined Modify result;
Determine all ancestor directories nodes of the subdirectory node are modified according to the first modification result the Two modification results;
The first modification result is added in the existing directory tree and the second modification result forms modified catalogue Tree.
2. the method according to claim 1, wherein all ancestor directories of the determination subdirectory node The second modification result that node is modified according to the first modification result, comprising:
The parent directory node for generating the first modification result, as the second directory node;
All ancestor directories nodes of second directory node are generated by second directory node;
It is described added in the existing directory tree it is described first modification result and it is described second modify result formed it is modified Directory tree, comprising: by all ancestors' mesh of the first modification result, second directory node and second directory node Record node, which is added in existing directory tree, forms modified directory tree.
3. the method according to claim 1, wherein the existing directory tree and the modified directory tree exist The v ion for being used for recording version information is generated when formation, the v ion is the parent directory node of root node;Wherein, The timestamp that the v ion generates time point is preserved in the v ion.
4. according to the method described in claim 3, it is characterized in that, the v ion saves the Hash of current version number Value, the cryptographic Hash of previous start context.
5. the method according to claim 1, wherein each directory node saves current mesh in the directory tree Record the cryptographic Hash of the cryptographic Hash of nodal information and the first layer subdirectory node information of current directory node.
6. a kind of file directory tree managing device based on Merkle DAG, which is characterized in that described device include memory and Processor is stored with the file directory tree management program that can be run on the processor, the file mesh on the memory Record tree management program realizes following method when being executed by the processor:
When the subdirectory node of the first directory node in existing directory tree is modified, the first of the subdirectory node is determined Modify result;
Determine all ancestor directories nodes of the subdirectory node are modified according to the first modification result the Two modification results;
The first modification result is added in the existing directory tree and the second modification result forms modified catalogue Tree.
7. device according to claim 6, which is characterized in that the file directory tree management program is held by the processor It is also realized when row:
The parent directory node for generating the first modification result, as the second directory node;
All ancestor directories nodes of second directory node are generated by second directory node;
It is described added in the existing directory tree it is described first modification result and it is described second modify result formed it is modified Directory tree, comprising: by all ancestors' mesh of the first modification result, second directory node and second directory node Record node, which is added in existing directory tree, forms modified directory tree.
8. device according to claim 6, which is characterized in that the file directory tree management program is held by the processor It is also realized when row:
The existing directory tree and the modified directory tree generate the version section for being used for recording version information when being formed Point, the v ion are the parent directory node of root node;Wherein, the v ion is preserved in the v ion to generate The timestamp at time point.
9. device according to claim 8, which is characterized in that the v ion saves the Hash of current version number Value, the cryptographic Hash of previous start context.
10. device according to claim 8, which is characterized in that each directory node saves currently in the directory tree The cryptographic Hash of the first layer subdirectory node information of the cryptographic Hash and current directory node of directory node information.
11. a kind of file directory tree management system based on Merkle DAG characterized by comprising
First determination unit, for determining institute when the subdirectory node of the first directory node in existing directory tree is modified State the first modification result of subdirectory node;
Second determination unit, for determining all ancestor directories nodes of the subdirectory node according to the first modification result The the second modification result modified;
Adding unit is formed for adding the first modification result in the existing directory tree with the second modification result Modified directory tree.
12. a kind of computer readable storage medium, which is characterized in that be stored with file mesh on the computer readable storage medium Record tree management program, the file directory Guan Shuli program can be executed by one or more processors, to realize such as claim 1 To file directory tree management method described in any one of 5.
CN201811315141.7A 2018-11-06 2018-11-06 File directory tree management method and related device Active CN109491962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811315141.7A CN109491962B (en) 2018-11-06 2018-11-06 File directory tree management method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811315141.7A CN109491962B (en) 2018-11-06 2018-11-06 File directory tree management method and related device

Publications (2)

Publication Number Publication Date
CN109491962A true CN109491962A (en) 2019-03-19
CN109491962B CN109491962B (en) 2022-02-22

Family

ID=65694020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811315141.7A Active CN109491962B (en) 2018-11-06 2018-11-06 File directory tree management method and related device

Country Status (1)

Country Link
CN (1) CN109491962B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826007A (en) * 2019-12-04 2020-02-21 杭州安恒信息技术股份有限公司 Column updating date determining method, device and equipment and readable storage medium
CN112765102A (en) * 2021-01-26 2021-05-07 建信金融科技有限责任公司 File system management method and device
CN114265814A (en) * 2022-03-01 2022-04-01 天津安锐捷技术有限公司 Data lake file system based on object storage
WO2022073225A1 (en) * 2020-10-10 2022-04-14 中国科学院深圳先进技术研究院 Dna storage-based incremental information management method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102017687A (en) * 2007-11-15 2011-04-13 华为技术有限公司 Method and device for instantiating management object of management tree in terminal device
CN102684901A (en) * 2011-03-17 2012-09-19 环达电脑(上海)有限公司 Method for managing servers by utilizing structure tree
CN103020058A (en) * 2011-09-21 2013-04-03 阿里巴巴集团控股有限公司 Multi-version data acquisition method and device
CN103744961A (en) * 2014-01-06 2014-04-23 清华大学 Method for prolonging service life of nonvolatile storage with reconfigurable file system directory tree
CN103780490A (en) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 Method and device for updating routing lookup tree
CN104536908A (en) * 2014-11-05 2015-04-22 北京中安比特科技有限公司 Single-machine-oriented mass small record efficient storage and management method
CN105302817A (en) * 2014-06-25 2016-02-03 苏宁云商集团股份有限公司 Distributed file system management method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102017687A (en) * 2007-11-15 2011-04-13 华为技术有限公司 Method and device for instantiating management object of management tree in terminal device
CN102684901A (en) * 2011-03-17 2012-09-19 环达电脑(上海)有限公司 Method for managing servers by utilizing structure tree
CN103020058A (en) * 2011-09-21 2013-04-03 阿里巴巴集团控股有限公司 Multi-version data acquisition method and device
CN103780490A (en) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 Method and device for updating routing lookup tree
CN103744961A (en) * 2014-01-06 2014-04-23 清华大学 Method for prolonging service life of nonvolatile storage with reconfigurable file system directory tree
CN105302817A (en) * 2014-06-25 2016-02-03 苏宁云商集团股份有限公司 Distributed file system management method and apparatus
CN104536908A (en) * 2014-11-05 2015-04-22 北京中安比特科技有限公司 Single-machine-oriented mass small record efficient storage and management method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826007A (en) * 2019-12-04 2020-02-21 杭州安恒信息技术股份有限公司 Column updating date determining method, device and equipment and readable storage medium
CN110826007B (en) * 2019-12-04 2022-07-05 杭州安恒信息技术股份有限公司 Column updating date determining method, device and equipment and readable storage medium
WO2022073225A1 (en) * 2020-10-10 2022-04-14 中国科学院深圳先进技术研究院 Dna storage-based incremental information management method and device
CN112765102A (en) * 2021-01-26 2021-05-07 建信金融科技有限责任公司 File system management method and device
CN114265814A (en) * 2022-03-01 2022-04-01 天津安锐捷技术有限公司 Data lake file system based on object storage
CN114265814B (en) * 2022-03-01 2022-06-07 天津安锐捷技术有限公司 Data lake file system based on object storage

Also Published As

Publication number Publication date
CN109491962B (en) 2022-02-22

Similar Documents

Publication Publication Date Title
CN109491962A (en) A kind of file directory tree management method and relevant apparatus
US8494996B2 (en) Creation and revision of network object graph topology for a network performance management system
CN104699423B (en) The method and apparatus that drive is bound in linux system
CN105426223B (en) Using loading method and device
US11010401B2 (en) Efficient snapshot generation of data tables
US11237749B2 (en) System and method for backup data discrimination
CN105094707A (en) Method and device for storing and reading data
CN103902632A (en) File system building method and device in key-value storage system, and electronic device
US20130117319A1 (en) Objects in a storage environment for connected applications
US20090265301A1 (en) Database Object Update Order Determination
CN102938784A (en) Method and system used for data storage and used in distributed storage system
US20200065313A1 (en) Extensible content object metadata
CN104079613A (en) Method and system for multiple tenants to share application program objects
CN108268609A (en) A kind of foundation of file path, access method and device
CN111209120A (en) Data synchronization method and device for microservice and computer readable storage medium
CN109597707A (en) Clone volume data copying method, device and computer readable storage medium
CN107844519A (en) Electronic installation, data base querying scenario generation method and storage medium
CN108304142A (en) A kind of data managing method and device
EP3269097A1 (en) Architecture for large data management in communication applications through multiple mailboxes
CN108255434A (en) Label management method, managing device and computer readable storage medium
CN110879701A (en) Workflow visualization configuration method, server, system and medium
US9342530B2 (en) Method for skipping empty folders when navigating a file system
CN110263006A (en) A kind of method and apparatus for downloading file on a user device
CN115617797A (en) Dynamic expansion method of service metadata field, electronic equipment and storage medium
US10853331B1 (en) System and method for editing materializations of a data store

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210909

Address after: 518000 21 / f-23 / F, block B, building 12, Shenzhen Bay science and technology ecological park, No. 18, South Keji Road, high tech community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Xunlei Networking Technologies, Ltd.

Applicant after: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd.

Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd.

GR01 Patent grant
GR01 Patent grant