CN110515909A - File storage method and device, electronic equipment and computer storage medium - Google Patents

File storage method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN110515909A
CN110515909A CN201910810550.2A CN201910810550A CN110515909A CN 110515909 A CN110515909 A CN 110515909A CN 201910810550 A CN201910810550 A CN 201910810550A CN 110515909 A CN110515909 A CN 110515909A
Authority
CN
China
Prior art keywords
file
node
stored
storage
tree
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
CN201910810550.2A
Other languages
Chinese (zh)
Other versions
CN110515909B (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910810550.2A priority Critical patent/CN110515909B/en
Publication of CN110515909A publication Critical patent/CN110515909A/en
Application granted granted Critical
Publication of CN110515909B publication Critical patent/CN110515909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

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

Abstract

The embodiment of the disclosure relates to the technical field of data storage, and discloses a file storage method, a file storage device, an electronic device and a computer-readable storage medium, wherein the file storage method comprises the following steps: acquiring a request for storing at least one file to be stored; then, according to the request, determining the node position of each file to be stored in the corresponding file tree, wherein the node position is a child file node of a target parent file node in the file tree or a root file node in the file tree; and then, storing each file to be stored to a corresponding node position respectively. The method of the embodiment of the disclosure can organize the associated files into a file tree, thereby conveniently managing each file, not only avoiding the storage position error caused by the fact that a user cannot determine the association relationship between the files, but also quickly and accurately positioning a certain file to be searched according to the file tree, and greatly improving the query efficiency.

Description

File memory method, device, electronic equipment and computer storage medium
Technical field
The embodiment of the present disclosure is related to technical field of data storage, specifically, this disclosure relates to a kind of file memory method, Device, electronic equipment and computer storage medium.
Background technique
Infiltration with computer technology to various aspects, all trades and professions are all computerized, many original paperys File is rewritten into computer documents.In fields such as software development, hardware development, medical treatment, internets, a large amount of need can be all generated daily The files such as electronic document, electrical form, the electronics bookcase to be stored.
Currently, computer equipment is usually that the memory module for using catalogue file to press from both sides stores file, for example, when one When a project is related to multiple files, user needs each file associated with the project being put into a public directory file In folder, however, being pressed from both sides if user can not determine which catalogue file file to be stored needs store to, it will lead to file to be stored Storage location occur mistake.In addition, needing first to find public directory file, then in public affairs when user checks some file It is browsed and is screened in the All Files of catalogue file folder altogether, to search some file, cause user's waste a large amount of Time and efforts.
Summary of the invention
The purpose of the embodiment of the present disclosure is intended at least can solve above-mentioned one of technological deficiency, provides the summary of the invention portion Divide so that with brief form introduction design, the specific embodiment part below is described in detail by these designs.The hair Bright content part is not intended to identify the key features or essential features of claimed technical solution, is intended to be used to limit The range of the technical solution of required protection.
On the one hand, a kind of file memory method is provided, comprising:
Obtain the request stored at least one file to be stored;
According to request, determine that node location of each file to be stored in corresponding file tree, node location are The subfile node of target father file node in file tree or the root file node in file tree;
Each file to be stored is stored respectively to corresponding node location.
On the one hand, a kind of file storage device is provided, comprising:
Module is obtained, for obtaining the request stored at least one file to be stored;
Determining module, for determining node position of each file to be stored in corresponding file tree according to request It sets, the subfile node or the root file node in file tree that node location is the target father file node in file tree;
Memory module, for being stored each file to be stored respectively to corresponding node location.
On the one hand, a kind of electronic equipment is provided, including memory, processor and storage on a memory and can handled The computer program run on device, processor realize above-mentioned file memory method when executing described program.
On the one hand, a kind of computer readable storage medium is provided, is stored with computer on computer readable storage medium Program, the program realize above-mentioned file memory method when being executed by processor.
The file memory method that the embodiment of the present disclosure provides, by according to get at least one file to be stored into The request of row storage, determines node location of each file to be stored in corresponding file tree, and by each wait store File is stored respectively to corresponding node location, node location be the target father file node in file tree subfile node or Root file node in file tree, allows to associated file organization at a file tree, thus easily to each File is managed, and storage location mistake caused by the incidence relation between file can not be not only determined to avoid user, And some file searched can be quickly and accurately positioned to according to file tree, search efficiency is greatly improved.
The additional aspect of the embodiment of the present disclosure and advantage will be set forth in part in the description, these will be retouched from following Become obvious in stating, or is recognized by the practice of the disclosure.
Detailed description of the invention
In conjunction with attached drawing and refer to following specific embodiments, the above and other feature, advantage of each embodiment of the disclosure and Aspect will be apparent.In attached drawing, the same or similar appended drawing reference indicates the same or similar element.It should manage Solution attached drawing is schematically that original part and element are not necessarily drawn to scale.
Fig. 1 is the flow diagram of the file memory method of the embodiment of the present disclosure;
Fig. 2 is the file tree schematic diagram that the file of the embodiment of the present disclosure stores;
Fig. 3 a, Fig. 3 b and Fig. 3 c are the file tree signal of the embodiment of the present disclosure stored to root file section point Figure;
Fig. 4 is the basic structure schematic diagram of the file storage device of the embodiment of the present disclosure;
Fig. 5 is the detailed construction schematic diagram of the file storage device of the embodiment of the present disclosure;
Fig. 6 is the structural schematic diagram of the electronic equipment of the embodiment of the present disclosure.
Specific embodiment
Embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the certain of the disclosure in attached drawing Embodiment, it should be understood that, the disclosure can be realized by various forms, and should not be construed as being limited to this In the embodiment that illustrates, providing these embodiments on the contrary is in order to more thorough and be fully understood by the disclosure.It should be understood that It is that being given for example only property of the accompanying drawings and embodiments effect of the disclosure is not intended to limit the protection scope of the disclosure.
It should be appreciated that each step recorded in disclosed method embodiment can execute in a different order, And/or parallel execution.In addition, method implementation may include additional step and/or omit the step of execution is shown.This public affairs The range opened is not limited in this respect.
Terms used herein " comprising " and its deformation are that opening includes, i.e., " including but not limited to ".Term "based" It is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " indicates " at least one other embodiment ";Term " some embodiments " expression " at least some embodiments ".The correlation of other terms is fixed Justice provides in will be described below.
It is noted that the concepts such as " first " that refers in the disclosure, " second " are only used for carrying out device, module or unit It distinguishes, is not intended to limit these devices, module or unit one and is set to different devices, module or unit, be also not intended to limit The sequence or relation of interdependence of function performed by these fixed devices, module or unit.
It is noted that referred in the disclosure "one", the modification of " multiple " be schematically and not restrictive this field It will be appreciated by the skilled person that being otherwise construed as " one or more " unless clearly indicate otherwise in context.
The being merely to illustrate property of title of the message or information that are interacted between multiple devices in disclosure embodiment Purpose, and be not used to limit the range of these message or information.
To keep the purposes, technical schemes and advantages of the embodiment of the present disclosure clearer, below in conjunction with attached drawing to the disclosure Embodiment is described in further detail.
File memory method, device, electronic equipment and the computer storage medium that the embodiment of the present disclosure provides, it is intended to solve The technical problem as above of the prior art.
Below with specifically embodiment to the technical solution of the embodiment of the present disclosure and the technical solution of the embodiment of the present disclosure Above-mentioned technical problem how is solved to be described in detail.These specific embodiments can be combined with each other below, for identical Or similar concept or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, to embodiment of the disclosure It is described.
An embodiment of the present disclosure provides a kind of file memory method, and this method is executed by computer equipment, the calculating Machine equipment can be terminal or server.Terminal can be bench device or mobile terminal.Server can be independent Physical server, physical server cluster or virtual server.
As shown in Figure 1, this method comprises:
Step S110 obtains the request stored at least one file to be stored.
Specifically, when user by computer equipment at least one file to be stored (such as 1,2,5 etc.) into When row storage, the request stored at least one file to be stored can be sent to computer equipment.Correspondingly, it calculates Machine equipment obtains the request stored at least one file to be stored.
Step S120 determines node location of each file to be stored in corresponding file tree according to request, section Point is set to the subfile node of the target father file node in file tree or the root file node in file tree.
It specifically, can basis after computer equipment gets the request stored at least one file to be stored The request determines node location of each file to be stored in corresponding file tree.Wherein, which can be The subfile node of target father file node in file tree, the root file node being also possible in file tree.
For example, determining that file to be stored K belongs to established file tree T1, and its node location in file tree T1 For the subfile node of target father file node C, i.e. node location of the file to be stored K in its corresponding file tree is target The subfile node of father file node.In another example determining that file to be stored K is not belonging to any established file tree (such as file tree T1, file tree T2) can create a file tree T3 at this time, and determine that file to be stored K is this document tree The root file node of T3, i.e. node location of the file to be stored K in its corresponding file tree are root file nodes.
Step S130 stores each file to be stored respectively to corresponding node location.
Specifically, computer equipment is determining node location of each file to be stored in corresponding file tree Afterwards, each file to be stored can be stored respectively to corresponding node location.
If the corresponding file tree of file to be stored K is file tree T1, and determines its node position in file tree T1 It is set to the subfile node of target father file node C, then using file to be stored K as the subfile section of target father file node C Point is stored, i.e., file to be stored K is mounted to below target father file node C.
If the corresponding file tree of file to be stored K is file tree T3, and determines its node position in file tree T3 It is set to root file node, then is stored file to be stored K as the root file section point of file tree T3.When other texts to be stored The corresponding file tree of part (such as file N) is file tree T3, and determines that its node location in file tree T3 is target father The subfile node of file node K is then stored file to be stored N as the subfile node of root file node K, i.e., will File to be stored N is mounted to below root file node K.
The file memory method that the embodiment of the present disclosure provides, by according to get at least one file to be stored into The request of row storage, determines node location of each file to be stored in corresponding file tree, and by each wait store File is stored respectively to corresponding node location, node location be the target father file node in file tree subfile node or Root file node in file tree, allows to associated file organization at a file tree, thus easily to each File is managed, and storage location mistake caused by the incidence relation between file can not be not only determined to avoid user, And some file searched can be quickly and accurately positioned to according to file tree, search efficiency is greatly improved.
In one possible implementation, it is stored respectively by each file to be stored to the mistake of corresponding node location Cheng Zhong needs first to detect each file to be stored, whether stored with each file to be stored of determination or Carry mistake.Wherein, identical in the detection process of each file to be stored, below by taking any file to be stored as an example, to detecting Journey is introduced, specific as follows shown:
During storing up any file to be stored to corresponding node location, in detection file storage database of record With the presence or absence of the storage record of storage file identical with the file name of any file to be stored, illustratively, lower section Storage file identical with the file name of any file to be stored is denoted as the first storage file, in which:
(1) if there is no the storages of the first storage file to record in file storage database of record: it (a) can be with It is stored any file to be stored as root file section point, that is, creates a file tree, and the file to be stored is made It is stored for the root file section point of the new files tree.In other words, when there is no first in file storage database of record The storage of storage file records, and stores any file to be stored as root file section point, and the first storage file is and appoints The identical storage file of the file name of one file to be stored.It (b) can be using any file to be stored as its corresponding text The subfile node of respective objects father file node in part tree is stored, i.e., is mounted to any file to be stored accordingly Target father file node below.In other words, when the storage that the first storage file is not present in file storage database of record Record, stores any file to be stored as the subfile node of corresponding target father file node.
(2) if there are the storage of the first storage file record in file storage database of record: if (c) first The father file node of storage file is sky, i.e., first storage file is stored as the root file section point of file tree, then may be used It is stored using the root file section point by any file to be stored as this document tree, i.e., more according to any file to be stored New first storage file, namely the first storage file is replaced using any file to be stored.If (d) father of the first storage file File node is non-empty, i.e. there are father file node (such as father file node H) namely the first storage files for the first storage file It is to be stored as the subfile node of father file node H, then database of record can be stored based on file, according to this One file to be stored updates first storage file, i.e., replaces first storage file using any file to be stored.
Wherein, according to the file tree formed during foregoing description as shown in Fig. 2, include two file trees in Fig. 2, In, file A, file B, file D and file C are a file tree (being denoted as file tree T1), and in this document tree T1, file A is Root file node, file B are the father file node of file C, and file A is the father file node of file B and file D;File E, text Part F, file G and file H are another file (being denoted as file tree T2), and in this document tree T2, file E is root file node, File F is the father file node of file G and file H, and file E is the father file node of file F.
In one possible implementation, using any file to be stored as the son of corresponding target father file node During file section point is stored, need further to detect any file to be stored, with determine this it is any to Whether storage file is on the store path of target father file node.Wherein, specific detection process are as follows:
Firstly, determining the routing information (i.e. store path) of target father file node, wherein routing information includes target father File node, target father file node file tree root file node and the corresponding file of target father file node Each file node between the root file node of tree.
Specifically, by taking the file tree T1 in Fig. 2 as an example, if target father file node is file C, any file to be stored For file K, then the routing information of target father file node C be include target father file node (i.e. file C), target father file section The root file section of the corresponding file tree of the root file node (i.e. file A) and target father file node of the file tree of point Each file node of each file node (i.e. file B) between point, the i.e. routing information of target father file node C are file A, file B and file C.
Secondly, whether after the routing information for determining target father file node detecting in the routing information includes root According to the file node that the first storage file is formed, that is, detect in the routing information with the presence or absence of with any file to be stored K's The identical storage file of file name.
Wherein, (1) is if include the file node formed according to the first storage file in routing information, i.e., in routing information In the presence of storage file identical with the file name of any file to be stored K, then the is updated according to any file to be stored K One storage file updates the first storage file according to any file to be stored K, namely utilizes any file to be stored K Replace the first storage file.(2) if in routing information not including the file node formed according to the first storage file, i.e. path Storage file identical with the file name of any file to be stored K is not present in information, then makees any file to be stored K Subfile node for corresponding target father file node (file C) is stored, i.e., is mounted to any file to be stored K Corresponding target father file node (file C) is below.
In one possible implementation, when any file to be stored is the root file node of any file tree, In It, cannot be direct during any file to be stored is stored as the subfile node of corresponding target father file node It is carried out according to the storing process of above-mentioned any file to be stored.Because if directly according to above-mentioned any file to be stored Storing process stored, be easy to form two file trees into a rings, such as user U1 makees the file A in file tree T1 Subfile node for the file node G of file tree T2 is stored, and user U2 is using the file E in file tree T2 as file The subfile node for setting the file node C of T1 is stored, and file tree T1 and file tree T2 will form a closed loop at this time, is such as schemed Shown in 3c, to destroy the tree structure of file tree.So when detecting user U1 by file A (the root text in file tree T1 Part node) as other any file trees (such as file tree T2) some father file node (such as file G) subfile section When point is stored, following storing process can be executed:
Firstly, by the root file section of other file trees in addition to the root file node (i.e. file A) of any file tree Point carries out locking processing, wherein after carrying out locking processing to the root file section point of other file trees, neither allows other texts The root file node of part tree is stored as the subfile node of any file node in any file tree, do not allow yet by The subfile node of any file tree is stored as the subfile node of the root file node in other file trees, to prevent This any two file tree forms a closed loop.
Secondly, being carried out the root file node of any file tree as the subfile node of corresponding target father file node Storage.For example, being deposited the root file node A of file tree T1 as the subfile node of the father file node G of file tree T2 File tree T1 is mounted to the file G of file tree T2 in the following, as shown in Figure 3b by storage.In another example by the root file of file tree T2 Node E is stored as the subfile node of the father file node C of file tree T1, i.e., file tree T2 is mounted to file tree T1 File C in the following, as shown in Figure 3a.
Wherein, in the root file to other file trees in addition to the root file node (i.e. file A) of any file tree During node carries out locking processing, if it is determined that lock success to the root file node of other file trees, then can give birth to At successful prompt information is locked accordingly, to remind user to lock successfully, if it is determined that the root file section of other file trees Point locks failure, then the prompt information for locking failure can be generated, to remind user to lock failure, wherein lock failure It can also include locking the information such as the reason of failing, type of error in prompt information.
In addition, using the root file node of any file tree as the subfile node of corresponding target father file node into File tree after row storage, where any file tree and target father file node, it will form a new file tree, such as Shown in Fig. 3 a and Fig. 3 b, i.e., according to any file tree file tree corresponding with the generation of the file tree of target father file node.Its In, after generating file tree, the file tree of the generation can be returned into user, so that user checks.
Fig. 4 is a kind of structural schematic diagram for file storage device that the another embodiment of the disclosure provides, as shown in figure 4, should Device 40 may include obtaining module 41, determining module 42 and memory module 43, in which:
Module 41 is obtained, for obtaining the request stored at least one file to be stored;
Determining module 42, for determining node of each file to be stored in corresponding file tree according to request Position, the subfile node or the root file node in file tree that node location is the target father file node in file tree;
Memory module 43, for being stored each file to be stored respectively to corresponding node location.
Fig. 5 is a kind of detailed construction schematic diagram for file storage device that the another embodiment of the disclosure provides, such as Fig. 5 institute Show, which may include obtaining module 51, determining module 52, memory module 53, the first generation module 54 and second to generate Module 55.Wherein, the function that the acquisition module 51 in Fig. 5 is realized is identical as the acquisition module 41 in Fig. 4, the determination in Fig. 5 The function that module 52 is realized is identical as the determining module 42 in Fig. 4, the function and Fig. 4 that the memory module 53 in Fig. 5 is realized In memory module 43 it is identical, details are not described herein.It describes in detail below to file storage device shown in fig. 5:
Specifically, memory module 53 is specifically used for executing any one of following:
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored It is stored as root file section point, the first storage file is storage text identical with the file name of any file to be stored Part;
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored Subfile node as corresponding target father file node is stored;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is sky, is stored any file to be stored as root file section point;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is non-empty, stores database of record based on file, updates the first storage file according to any file to be stored.
Specifically, memory module 53 includes that path determines submodule 531, detection sub-module 532 and the first sub-module stored 533, in which:
Path determines submodule 531, for determining that the routing information of target father file node, routing information include target father File node, target father file node file tree root file node and the corresponding file of target father file node Each file node between the root file node of tree;
Whether detection sub-module 532 includes the file section formed according to the first storage file for determining in routing information Point;
First sub-module stored 533 does not include the file section formed according to the first storage file in routing information for working as When point, stored any file to be stored as the subfile node of corresponding target father file node.
Specifically, memory module 53 further includes the second sub-module stored 534, in which:
Second sub-module stored 534 includes the file node formed according to the first storage file in routing information for working as, The first storage file is then updated according to any file to be stored.
Specifically, when any file to be stored is the root file node of any file tree, memory module 53 includes locking Submodule 535 and third sub-module stored 536, in which:
Submodule 535 is locked, for the root file section to other file trees in addition to the root file node of any file tree Point carries out locking processing;
Third sub-module stored 536, for using the root file node of any file tree as corresponding target father file section The subfile node of point is stored.
It specifically, further include the first generation module 54, in which:
First generation module 54, for according to any file tree text corresponding with the generation of the file tree of target father file node Part tree.
It specifically, further include the second generation module 55, in which:
Second generation module 55, for generating and adding when determination locks successfully the root file node of other file trees Lock successful prompt information;Or for generating and locking when determining that the root file node to other file trees locks failure The prompt information of failure.
The device that the embodiment of the present disclosure provides, by according to being stored at least one file to be stored of getting Request, determines node location of each file to be stored in corresponding file tree, and each file to be stored is distinguished It stores to corresponding node location, node location is in the subfile node or file tree of the target father file node in file tree Root file node, allow to associated file organization into a file tree, thus easily to each file carry out Management, can not determine storage location mistake caused by the incidence relation between file not only to avoid user, but also can be with It is quickly and accurately positioned to some file searched according to file tree, search efficiency is greatly improved.
It should be noted that the present embodiment is device item embodiment corresponding with above-mentioned method item embodiment, this reality Applying example can work in coordination implementation with above method item embodiment.The relevant technical details mentioned in above method item embodiment are at this In embodiment still effectively, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technologies mentioned in the present embodiment are thin Section is also applicable in above method item embodiment.
Below with reference to Fig. 6, it illustrates the structural representations for the electronic equipment 600 for being suitable for being used to realize the embodiment of the present disclosure Figure.Terminal device in the embodiment of the present disclosure can include but is not limited to such as mobile phone, laptop, digital broadcasting and connect Receive device, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle Carry navigation terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.The electronics that Fig. 6 goes out Equipment is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
Electronic equipment includes memory and processor, wherein processor here is properly termed as processing described in lower section Device 601, memory include read-only memory (ROM) 602, random access storage device (RAM) 603 and storage dress hereinafter At least one in 608 is set, specific as follows shown:
As shown in fig. 6, electronic equipment 600 may include processing unit (such as central processing unit, graphics processor etc.) 601, random access can be loaded into according to the program being stored in read-only memory (ROM) 602 or from storage device 608 Program in memory (RAM) 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with electronic equipment Various programs and data needed for 600 operations.Processing unit 601, ROM 602 and RAM 603 pass through the phase each other of bus 604 Even.Input/output (I/O) interface 605 is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 606 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 607 of dynamic device etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.Communication device 609, which can permit electronic equipment 600, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 6 shows tool There is the electronic equipment 600 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608 It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining the request stored at least one file to be stored;According to request, Determine node location of each file to be stored in corresponding file tree;Each file to be stored is stored respectively to phase The node location answered, the subfile node or the root file in file tree that node location is the target father file node in file tree Node.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in the embodiment of the present disclosure involved module or unit can be realized by way of software, can also be with It is realized by way of hardware.Wherein, module or the title of unit are not constituted to the unit itself under certain conditions It limits, is also described as " when detecting the predetermined live event of generation, obtaining predetermined live event pair for example, obtaining module The module for at least one event handling mode answered ".
Function described herein can be executed at least partly by one or more hardware logic components.Example Such as, without limitation, the hardware logic component for the exemplary type that can be used include: field programmable gate array (FPGA), specially With integrated circuit (ASIC), Application Specific Standard Product (ASSP), system on chip (SOC), complex programmable logic equipment (CPLD) etc. Deng.
In the context of the disclosure, machine readable media can be tangible medium, may include or is stored for The program that instruction execution system, device or equipment are used or is used in combination with instruction execution system, device or equipment.Machine can Reading medium can be machine-readable signal medium or machine-readable storage medium.Machine readable media can include but is not limited to electricity Son, magnetic, optical, electromagnetism, infrared or semiconductor system, device or equipment or above content any conjunction Suitable combination.The more specific example of machine readable storage medium will include the electrical connection of line based on one or more, portable meter Calculation machine disk, hard disk, random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM Or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage facilities or Any appropriate combination of above content.
According to one or more other embodiments of the present disclosure, a kind of file memory method is provided, comprising:
Obtain the request stored at least one file to be stored;
According to request, node location of each file to be stored in corresponding file tree is determined;
Each file to be stored is stored respectively to corresponding node location, node location is target father's text in file tree Root file node in the subfile node or file tree of part node.
In one possible implementation, any file to be stored is stored up to corresponding node location, including following One:
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored It is stored as root file section point, the first storage file is storage text identical with the file name of any file to be stored Part;
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored Subfile node as corresponding target father file node is stored;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is sky, is stored any file to be stored as root file section point;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is non-empty, stores database of record based on file, updates the first storage file according to any file to be stored.
In one possible implementation, using any file to be stored as the Ziwen of corresponding target father file node Part node is stored, comprising:
Determine that the routing information of target father file node, routing information include target father file node, target father file section It is each between the root file node of the corresponding file tree of the root file node and target father file node of the file tree of point A file node;
Determine in routing information whether include the file node formed according to the first storage file;
If not including, carried out any file to be stored as the subfile node of corresponding target father file node Storage.
In one possible implementation, further includes:
If including the file node formed according to the first storage file in routing information, according to any file to be stored Update the first storage file.
It in one possible implementation, will when any file to be stored is the root file node of any file tree Any file to be stored is stored as the subfile node of corresponding target father file node, comprising:
Locking processing is carried out to the root file section point of other file trees in addition to the root file node of any file tree;
It is stored the root file node of any file tree as the subfile node of corresponding target father file node.
In one possible implementation, using the root file node of any file tree as corresponding target father file After the subfile node of node is stored, further includes:
According to any file tree file tree corresponding with the generation of the file tree of target father file node.
In one possible implementation, in the root to other file trees in addition to the root file node of any file tree File section point carries out after locking processing, further includes:
When determination locks successfully the root file node of other file trees, generates and lock successful prompt information;Or Person,
When determining that the root file node to other file trees locks failure, the prompt information for locking failure is generated.
According to one or more other embodiments of the present disclosure, a kind of file storage device is provided, comprising:
Module is obtained, for obtaining the request stored at least one file to be stored;
Determining module, for determining node position of each file to be stored in corresponding file tree according to request It sets;
Memory module, for being stored each file to be stored respectively to corresponding node location, node location is file The subfile node of target father file node in tree or the root file node in file tree.
In one possible implementation, memory module is specifically used for executing any one of following:
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored It is stored as root file section point, the first storage file is storage text identical with the file name of any file to be stored Part;
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored Subfile node as corresponding target father file node is stored;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is sky, is stored any file to be stored as root file section point;
When in file storage database of record there are the storage of the first storage file record, and the father of the first storage file File node is non-empty, stores database of record based on file, updates the first storage file according to any file to be stored.
In one possible implementation, memory module includes that path determines that submodule, detection sub-module are deposited with first Store up submodule;
Path determines submodule, for determining that the routing information of target father file node, routing information include target father's text Part node, target father file node file tree root file node and the corresponding file tree of target father file node Root file node between each file node;
Whether detection sub-module includes the file node formed according to the first storage file for determining in routing information;
First sub-module stored does not include the file node formed according to the first storage file in routing information for working as When, it is stored any file to be stored as the subfile node of corresponding target father file node.
In one possible implementation, memory module further includes the second sub-module stored;
Second sub-module stored includes the file node formed according to the first storage file in routing information for working as, then The first storage file is updated according to any file to be stored.
In one possible implementation, it when any file to be stored is the root file node of any file tree, deposits Storing up module includes locking submodule and third sub-module stored;
Submodule is locked, is clicked through for the root file section to other file trees in addition to the root file node of any file tree Row locking processing;
Third sub-module stored, for using the root file node of any file tree as corresponding target father file node Subfile node is stored.
It in one possible implementation, further include the first generation module;
First generation module, for according to any file tree file corresponding with the generation of the file tree of target father file node Tree.
It in one possible implementation, further include the second generation module;
Second generation module, for generating and locking when determination locks successfully the root file node of other file trees Successful prompt information;Or it is lost for generating to lock when determining that the root file node to other file trees locks failure The prompt information lost.
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.
Although this is not construed as requiring these operations with institute in addition, depicting each operation using certain order The certain order that shows executes in sequential order to execute.Under certain environment, multitask and parallel processing may be advantageous 's.Similarly, although containing several specific implementation details in being discussed above, these are not construed as to this public affairs The limitation for the range opened.Certain features described in the context of individual embodiment can also be realized in combination single real It applies in example.On the contrary, the various features described in the context of single embodiment can also be individually or with any suitable The mode of sub-portfolio is realized in various embodiments.
Although having used specific to this theme of the language description of structure feature and/or method logical action, answer When understanding that theme defined in the appended claims is not necessarily limited to special characteristic described above or movement.On on the contrary, Special characteristic described in face and movement are only to realize the exemplary forms of claims.

Claims (10)

1. a kind of file memory method characterized by comprising
Obtain the request stored at least one file to be stored;
According to the request, node location of each file to be stored in corresponding file tree, the node position are determined It is set to the subfile node of the target father file node in the file tree or the root file node in the file tree;
Each file to be stored is stored respectively to corresponding node location.
2. the method according to claim 1, wherein storing up any file to be stored to corresponding node location, Including any one of following:
When there is no the storages of the first storage file to record in file storage database of record, by any file to be stored It is stored as root file section point, first storage file is identical with the file name of any file to be stored Storage file;
It, will be described any wait store when the storage record that first storage file is not present in file storage database of record File is stored as the subfile node of corresponding target father file node;
When in file storage database of record there are the storage of first storage file record, and first storage file Father file node be sky, stored any file to be stored as root file section point;
When in file storage database of record there are the storage of first storage file record, and first storage file Father file node be non-empty, database of record is stored based on the file, updated according to any file to be stored described in First storage file.
3. according to the method described in claim 2, it is characterized in that, using any file to be stored as corresponding target father The subfile node of file node is stored, comprising:
Determine the routing information of the target father file node, the routing information includes the target father file node, described The root of the root file node of the file tree of target father file node and the corresponding file tree of the target father file node Each file node between file node;
Determine in the routing information whether include the file node formed according to first storage file;
If not including, deposited any file to be stored as the subfile node of corresponding target father file node Storage.
4. according to the method described in claim 3, it is characterized by further comprising:
If include in the routing information according to first storage file formed file node, according to it is described it is any to Storage file updates first storage file.
5. according to the described in any item methods of claim 2-4, which is characterized in that when any file to be stored is any text When the root file node of part tree, deposited any file to be stored as the subfile node of corresponding target father file node Storage, comprising:
Locking processing is carried out to the root file section point of other file trees in addition to the root file node of any file tree;
It is stored the root file node of any file tree as the subfile node of corresponding target father file node.
6. according to the method described in claim 5, it is characterized in that, using the root file node of any file tree as phase After the subfile node for the target father file node answered is stored, further includes:
According to any file tree file tree corresponding with the generation of the file tree of the target father file node.
7. according to the method described in claim 5, it is characterized in that, in addition to the root file node of any file tree The root file section point of other file trees carries out after locking processing, further includes:
When determination locks successfully the root file node of other file trees, generates and lock successful prompt information;Or Person,
When determining that the root file node to other file trees locks failure, the prompt information for locking failure is generated.
8. a kind of file storage device characterized by comprising
Module is obtained, for obtaining the request stored at least one file to be stored;
Determining module, for determining node position of each file to be stored in corresponding file tree according to the request It sets, the node location is the subfile node of the target father file node in the file tree or the root text in the file tree Part node;
Memory module, for being stored each file to be stored respectively to corresponding node location.
9. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor realizes claim 1-7 described in any item file storages when executing described program Method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes claim 1-7 described in any item file memory methods when the program is executed by processor.
CN201910810550.2A 2019-08-29 2019-08-29 File storage method and device, electronic equipment and computer storage medium Active CN110515909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910810550.2A CN110515909B (en) 2019-08-29 2019-08-29 File storage method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910810550.2A CN110515909B (en) 2019-08-29 2019-08-29 File storage method and device, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN110515909A true CN110515909A (en) 2019-11-29
CN110515909B CN110515909B (en) 2022-05-13

Family

ID=68629332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910810550.2A Active CN110515909B (en) 2019-08-29 2019-08-29 File storage method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN110515909B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125017A (en) * 2019-12-26 2020-05-08 深圳前海环融联易信息科技服务有限公司 Data storage method and device based on tree structure and computer equipment
CN113238646A (en) * 2021-04-20 2021-08-10 北京易华录信息技术股份有限公司 Energy-saving storage method and device of optical storage cluster

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719141A (en) * 2009-12-24 2010-06-02 成都市华为赛门铁克科技有限公司 File processing method and system based on directory object
CN101799820A (en) * 2010-02-08 2010-08-11 深圳市同洲电子股份有限公司 Flash memory, file system mounted method and device, data management method and device
CN102722368A (en) * 2012-05-21 2012-10-10 北京广利核***工程有限公司 Plug-in software designing method based on document tree and message pump
CN106970958A (en) * 2017-03-17 2017-07-21 浙江大华技术股份有限公司 A kind of inquiry of stream file and storage method and device
CN107783988A (en) * 2016-08-26 2018-03-09 阿里巴巴集团控股有限公司 The locking method and equipment of a kind of directory tree
CN107807787A (en) * 2016-09-08 2018-03-16 北京京东尚科信息技术有限公司 A kind of distributed data storage method and system
CN108021339A (en) * 2017-11-03 2018-05-11 网宿科技股份有限公司 A kind of method of disk read-write, equipment and computer-readable recording medium
CN109271361A (en) * 2018-08-13 2019-01-25 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Distributed storage method and system for massive small files

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719141A (en) * 2009-12-24 2010-06-02 成都市华为赛门铁克科技有限公司 File processing method and system based on directory object
CN101799820A (en) * 2010-02-08 2010-08-11 深圳市同洲电子股份有限公司 Flash memory, file system mounted method and device, data management method and device
CN102722368A (en) * 2012-05-21 2012-10-10 北京广利核***工程有限公司 Plug-in software designing method based on document tree and message pump
CN107783988A (en) * 2016-08-26 2018-03-09 阿里巴巴集团控股有限公司 The locking method and equipment of a kind of directory tree
CN107807787A (en) * 2016-09-08 2018-03-16 北京京东尚科信息技术有限公司 A kind of distributed data storage method and system
CN106970958A (en) * 2017-03-17 2017-07-21 浙江大华技术股份有限公司 A kind of inquiry of stream file and storage method and device
CN108021339A (en) * 2017-11-03 2018-05-11 网宿科技股份有限公司 A kind of method of disk read-write, equipment and computer-readable recording medium
CN109271361A (en) * 2018-08-13 2019-01-25 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Distributed storage method and system for massive small files

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125017A (en) * 2019-12-26 2020-05-08 深圳前海环融联易信息科技服务有限公司 Data storage method and device based on tree structure and computer equipment
CN111125017B (en) * 2019-12-26 2023-10-13 深圳前海环融联易信息科技服务有限公司 Data storage method and device based on tree structure and computer equipment
CN113238646A (en) * 2021-04-20 2021-08-10 北京易华录信息技术股份有限公司 Energy-saving storage method and device of optical storage cluster
CN113238646B (en) * 2021-04-20 2024-04-09 北京易华录信息技术股份有限公司 Energy-saving storage method and device for optical storage cluster

Also Published As

Publication number Publication date
CN110515909B (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN109086409B (en) Microservice data processing method and device, electronic equipment and computer readable medium
US11036767B2 (en) System and method for providing database abstraction and data linkage
US9026901B2 (en) Viewing annotations across multiple applications
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
WO2018201895A1 (en) Interface code generation method, apparatus, terminal device and medium
CN107644286A (en) Workflow processing method and device
CN109447635A (en) Information storage means and device for block chain
CN110196889A (en) Data processing method, device, electronic equipment and storage medium
US20160048703A1 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
CN110019080A (en) Data access method and device
CN108846753A (en) Method and apparatus for handling data
CN109241722A (en) For obtaining method, electronic equipment and the computer-readable medium of information
US11797567B1 (en) Rapid hyperledger onboarding platform
CN110489971A (en) The data set management of safety
CN110515909A (en) File storage method and device, electronic equipment and computer storage medium
CN110515968A (en) Method and apparatus for output information
CN115168166A (en) Method, device and equipment for recording business data change and storage medium
CN110109983A (en) A kind of method and apparatus operating Redis database
CN114239511A (en) Method and apparatus for filling data
CN110378660A (en) Stock processing method, apparatus, electronic equipment and computer readable storage medium
CN109766392A (en) Data processing method and device
WO2023124910A1 (en) Data processing method and apparatus, and electronic device and storage medium
US20230207072A1 (en) System and method for managing clinical trial data using blockchain network scheme
EP1593053A1 (en) Managing different representations of information
CN109816455A (en) Method and apparatus for handling information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder