Summary of the invention
The embodiment of the invention provides a kind of file memory method and device, the lower problem of efficient when being used for solving accessed document.
First aspect of the embodiment of the invention provides a kind of file memory method, comprising:
Receive the solicited message that is used for storage file, carry file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions, are separate between described at least two dimensions;
Store described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, so that the user inquires described file by described at least two dimensions.
The file memory method that provides in conjunction with first aspect, in the possible implementation of the first, the described file of described storage, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier comprise:
Described file is stored in storage space for storage file;
The file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier and is stored in storage space for the storage corresponding relation with the corresponding relation between file identification and the folder identifier.
In conjunction with first aspect or the possible implementation of the first, in the possible implementation of the second, described method also comprises:
Receive read requests, carry the destination folder sign in the described read requests, described destination folder sign belongs to a dimension in described at least two dimensions;
According to the corresponding relation between file identification and the folder identifier, obtain at least one file destination corresponding to described destination folder sign.
Second aspect of the embodiment of the invention provides a kind of file storage device, comprising:
Receiving element, be used for receiving solicited message, described request information is used for storage file, carries described file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions, are separate between described at least two dimensions;
Processing unit is used for storing described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, so that the user inquires described file by described at least two dimensions.
In conjunction with the file storage device that second aspect provides, in the possible implementation of the first, described processing unit also is used for:
Described file is stored in storage space for storage file; The file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier and is stored in storage space for the storage corresponding relation with the corresponding relation between file identification and the folder identifier.
In conjunction with second aspect or the possible implementation of the first, in the possible implementation of the second, described receiving element also is used for:
Receive read requests, carry the destination folder sign in the described read requests, described destination folder sign belongs to a dimension in described at least two dimensions;
Correspondingly, described processing unit also is used for:
According to the corresponding relation between file identification and the folder identifier, obtain at least one file destination corresponding to described destination folder sign.
The 3rd aspect of the embodiment of the invention provides a kind of computing machine, comprises above-mentioned file storage device.
The file memory method that the embodiment of the invention provides and device, so that the user can carry out dimension to corresponding file in different dimensions, same file only need to be stored once, can be affiliated in the file of a plurality of different dimensions, realization is for same file, in different dimensions, show, be convenient to the user and manage.
Embodiment
File storage device in the various embodiments of the present invention can be functional module independently, also can be for being built in the functional module in the computing machine.The file memory method that this document memory storage is corresponding can be applied in the multiple application scenarios that needs storage file such as browser, client and operating system.
The process flow diagram of the file memory method that Fig. 1 provides for the embodiment of the invention, as shown in Figure 1, the method comprises:
101, receive the solicited message that is used for storage file.Wherein, carry file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions, are separate between described at least two dimensions.
Concrete, when user or other equipment need storage file, send solicited message to file storage device.Pre-stored in the file storage device have at least two dimensions, comprises respectively at least one file in each dimension.These two or more dimensions are statistics dimensions independent of each other, correspondingly, also are independent of each other between the file in each dimension.And, can comprise further sub-folder in the file of each dimension.The folder identifier of the following stated can be the sign of the parent folder in each dimension, also can be the sign of the sub-folder in the parent folder.
Carry the file that needs storage in the solicited message that file storage device receives, also carry the sign of the file that needs storage.Wherein, the sign of the file that carries in the solicited message can be one, also can be for a plurality of.When folder identifier was a plurality of, each folder identifier can all belong to different dimensions, also can belong to identical dimension.
102, store described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier.Execution in step 102 is in order to make the user inquire described file by described at least two dimensions.
Concrete, if the file that carries in the solicited message be designated one, after the file that then carries in solicited message is stored, the corresponding relation between the file identification of setting up this document identifies with this document folder.Thereby the user can inquire under the single dimension after having selected this document folder sign, the one or more files corresponding with this document folder sign.
If being designated of the file that carries in the solicited message is a plurality of, wherein exist a plurality of folder identifier to belong to same dimension.After the file that then carries is stored, set up respectively the file identification of this document and the corresponding relation between these folder identifier in solicited message.Thereby the user can inquire under this dimension after having selected folder identifier wherein, the one or more files corresponding with each folder identifier.
If being designated of the file that carries in the solicited message is a plurality of, wherein exist a plurality of folder identifier to belong to respectively a plurality of dimensions, after the file that then carries is stored, set up respectively the file identification of this document and the corresponding relation between these folder identifier in solicited message.Thereby the user can consult file by different dimensions.For the file under being stored in different dimensions, during the file of user under consulting these dimensions, all can find this document.
File in the embodiment of the invention is stored in file storage device and is once got final product, and is stored under the different dimensions, refer to from different dimensions in folder identifier have corresponding relation.Correspondingly, during these files in consulting these dimensions, all can find this document.
For example, comprise " department " and " date " two dimensions in the file storage device.Comprise two department's files separately in " department "; Comprise in " date " that a plurality of correspondences the file of date.No longer a plurality of correspondences the file of date in the embodiment of the invention as two parts sub-folder separately, but as dimension independently.
When the file of needs storages is certain department in one day during interim archive file, in solicited message, can carry this archive file, and corresponding folder identifier and folder identifier corresponding to this date of this department.File storage device is after receiving this solicited message, this archive file is stored, set up the corresponding relation between the file identification of this archive file folder identifier corresponding with this department, and set up the corresponding relation between the file identification of this archive file folder identifier corresponding with this date.
Thereby, when the user needs whole archive file of inquiry " department " correspondence, can consult by selecting the relevant folder in " department " dimension; When needing whole archive file of inquiry " date " correspondence, can consult by selecting the associated documents in " date " dimension.And need to be according to present storage mode, in having selected file corresponding to certain department, in sub-folder corresponding to date, only can find the archive file of this department corresponding to this date.
The file memory method that the embodiment of the invention provides, after the solicited message that receives for storage file, according to the file that carries in the solicited message and at least two folder identifier, store described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, thereby can make the user inquire described file by described at least two dimensions, effectively improve the efficient of accessed document.
Further, step 102 can be specially described file is stored in storage space for storage file; The file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier and is stored in storage space for the storage corresponding relation with the corresponding relation between file identification and the folder identifier.
File storage device is stored in storage space for storage file with above-mentioned file, and the corresponding relation of file identification and folder identifier is stored in storage space for the storage corresponding relation.Be used for the storage space of storage file and all be positioned at database for the storage space of storing corresponding relation.When the storage condition that needs revised file in different dimensions, do not need file itself is operated, only need to make amendment at relevant corresponding relation gets final product.For example, the corresponding relation of the folder identifier of newly-increased file and certain file, the perhaps corresponding relation of the folder identifier of deleted file and certain file etc.So that to utilizing mode that a plurality of dimensions consult file more flexibly and convenient.
In the various embodiments described above, optional, dimension can mark by dimension numbering and dimension name, and wherein, the dimension numbering is the identification information of a dimension of unique identification, and dimension name is the identification information of being convenient to the dimension of user's identification.
Be used for the storage space of storage corresponding relation, what specifically can store is the mapping table of folder information and actual file information.
Wherein, folder information can comprise the dimension numbering of information included in file numbering, Folder Name, higher level's file numbering, the file and affiliated dimension; The file numbering is the identification information of a file of unique identification, Folder Name is the title of being convenient to the file of user's identification, higher level's file numbering is the parent folder numbering of this document folder, if parent folder is empty, represents that then this document folder self is the top file under the root directory.
Actual file information can comprise the memory location of reference number of a document, file name and file, wherein, reference number of a document is the identification information of an actual file of unique identification, file name is the title of being convenient to the file of user's identification, and the memory location of file is that file is in the memory address of the storage space that is used for storage file.
Mapping table can be to carry out corresponding tables of data by file numbering and reference number of a document.Numbered entry in the above-mentioned information is changeless after generating, and name item is redefinable.Owing to be separate between the different dimensions, so the folder information in the different dimensions can not directly copy or movement.
Further, the implementation when needing file reading is as follows:
Receive read requests, carry the destination folder sign in the described read requests, described destination folder sign belongs to a dimension in described at least two dimensions; According to the corresponding relation between file identification and the folder identifier, obtain at least one file destination corresponding to described destination folder sign.
File storage device carries the folder identifier of destination folder in the received read requests when receiving the request that the file in the dimension in a plurality of dimensions is read.File storage device can find the target complete file corresponding with this document folder sign according to the corresponding relation of this document folder sign with file.Correspondingly, file storage device one or more file destinations that will find offer the user and get final product.Thereby the user can utilize a plurality of dimensions to carry out the reading of file destination improved efficient and the convenient degree of consulting effectively.
In addition, the file memory method by various embodiments of the present invention provide can reduce the quantity of file and the level of file effectively.For example, if need to set up m dimension, the quantity of the file in each dimension is respectively n
1, n
2... n
m, file add up to (n
1+ n
2+ ... + n
m); If adopt the storage mode of traditional single dimension, in the situation that the file of m dimension exists with the form of sub-folder, file add up to (n
1* n
2* ... * n
m).If m is 2, each dimension comprises 50 files, then utilize the file memory method that various embodiments of the present invention provide after, the quantity of file be utilize traditional storage mode number of folders 1/25; If m is 3, each dimension comprises 50 files, then, thereby after utilizing the file memory method that various embodiments of the present invention provide, the quantity of file be utilize traditional storage mode number of folders 1/833, effectively reduced the quantity of file, and more be convenient to file is searched and managed.
The file memory method that various embodiments of the present invention provide, so that the user can carry out dimension to corresponding file in different dimensions, same file only need to be stored once, can be affiliated in the file of a plurality of different dimensions, realization is for same file, in different dimensions, show, be convenient to the user and manage.
The structural representation of the file storage device that Fig. 2 provides for the embodiment of the invention, as shown in Figure 2, this document memory storage comprises: receiving element 11 and processing unit 12.
Receiving element 11, be used for receiving solicited message, described request information is used for storage file, carries described file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions, are separate between described at least two dimensions;
Processing unit 12 is used for storing described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, so that the user inquires described file by described at least two dimensions.
Further, described processing unit 12 also is used for:
Described file is stored in storage space for storage file; The file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier and is stored in storage space for the storage corresponding relation with the corresponding relation between file identification and the folder identifier.
Further, described receiving element 11 also is used for:
Receive read requests, carry the destination folder sign in the described read requests, described destination folder sign belongs to a dimension in described at least two dimensions;
Correspondingly, described processing unit 12 also is used for:
According to the corresponding relation between file identification and the folder identifier, obtain at least one file destination corresponding to described destination folder sign.
Concrete, the file storage device that the embodiment of the invention provides carries out the method for file storage, can be referring to the operation steps described in the embodiment of the method for above-mentioned correspondence, and this repeats no more.
The file storage device that various embodiments of the present invention provide, so that the user can carry out dimension to corresponding file in different dimensions, same file only need to be stored once, can be affiliated in the file of a plurality of different dimensions, realization is for same file, in different dimensions, show, be convenient to the user and manage.
The structural representation of another file storage device that Fig. 3 provides for the embodiment of the invention, as shown in Figure 3, this document memory storage comprises:
Processor 21, storer 22, bus 23 and communication interface 24.Connect by bus 23 between processor 21, storer 22 and the communication interface 24 and finish mutual communication.
Processor 21 may be monokaryon or multinuclear CPU (central processing unit) (Central Processing Unit, CPU), perhaps be specific integrated circuit (Application Specific Integrated Circuit, ASIC), perhaps for being configured to implement one or more integrated circuit of the embodiment of the invention.
Storer 22 can be the high-speed RAM storer, also can be nonvolatile memory (non-volatile memory), for example at least one magnetic disk memory.
Storer 22 is used for depositing program 221.Concrete, can comprise program code in the program 221, described program code comprises computer-managed instruction.
Processor 21 working procedures 221, to carry out:
Receive the solicited message that is used for storage file, carry file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions, are separate between described at least two dimensions;
Store described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, so that the user inquires described file by described at least two dimensions.
Concrete, the file storage device that the embodiment of the invention provides carries out the method for file storage, can be referring to the operation steps described in the embodiment of the method for above-mentioned correspondence, and this repeats no more.
The structural representation of the computing machine that Fig. 4 provides for the embodiment of the invention, as shown in Figure 4, this computing machine 1 comprises the file storage device 2 shown in Fig. 2 or Fig. 3.
Concrete, the file storage device that the embodiment of the invention provides carries out the method for file storage, can be referring to the operation steps described in the embodiment of the method for above-mentioned correspondence, and this repeats no more.
The computing machine that various embodiments of the present invention provide, so that the user can carry out dimension to corresponding file in different dimensions, same file only need to be stored once, can be affiliated in the file of a plurality of different dimensions, realization is for same file, in different dimensions, show, be convenient to the user and manage.
The structural representation of another computing machine that Fig. 5 provides for the embodiment of the invention, as shown in Figure 5, this computing machine comprises:
Processor 31, storer 32, bus 33 and communication interface 34.Connect by bus 33 between processor 31, storer 32 and the communication interface 34 and finish mutual communication.
Processor 31 may be monokaryon or multinuclear CPU (central processing unit) (Central Processing Unit, CPU), perhaps be specific integrated circuit (Application Specific Integrated Circuit, ASIC), perhaps for being configured to implement one or more integrated circuit of the embodiment of the invention.
Storer 32 can be the high-speed RAM storer, also can be nonvolatile memory (non-volatile memory), for example at least one magnetic disk memory.
Storer 32 is used for depositing program 321.Concrete, can comprise program code in the program 321, described program code comprises computer-managed instruction.
Processor 31 working procedures 321, to carry out:
Receive the solicited message that is used for storage file, carry file and at least two folder identifier in the described request information, described at least two folder identifier belong to respectively at least two dimensions;
Store described file, and the file identification of setting up described file respectively and the corresponding relation between described at least two folder identifier, so that the user inquires described file by described at least two dimensions.
Concrete, the computing machine that the embodiment of the invention provides carries out the method for file storage, can be referring to the operation steps described in the embodiment of the method for above-mentioned correspondence, and this repeats no more.
One of ordinary skill in the art will appreciate that: all or part of step that realizes above-mentioned each embodiment of the method can be finished by the relevant hardware of programmed instruction.Aforesaid program can be stored in the computer read/write memory medium.This program is carried out the step that comprises above-mentioned each embodiment of the method when carrying out; And aforesaid storage medium comprises: the various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above each embodiment is not intended to limit only in order to technical scheme of the present invention to be described; Although with reference to aforementioned each embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps some or all of technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the scope of various embodiments of the present invention technical scheme.