CN104408044A - File access method and system - Google Patents

File access method and system Download PDF

Info

Publication number
CN104408044A
CN104408044A CN201410571640.8A CN201410571640A CN104408044A CN 104408044 A CN104408044 A CN 104408044A CN 201410571640 A CN201410571640 A CN 201410571640A CN 104408044 A CN104408044 A CN 104408044A
Authority
CN
China
Prior art keywords
storage
file
adapter
read
memory location
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410571640.8A
Other languages
Chinese (zh)
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.)
BEIJING UFIDA SOFTWARE CO LTD
Original Assignee
BEIJING UFIDA SOFTWARE 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 UFIDA SOFTWARE CO LTD filed Critical BEIJING UFIDA SOFTWARE CO LTD
Priority to CN201410571640.8A priority Critical patent/CN104408044A/en
Publication of CN104408044A publication Critical patent/CN104408044A/en
Pending legal-status Critical Current

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

Abstract

The invention relates to a file access method and system. The configuration parameters of a storage server are set in advance according to requirements, wherein the configuration parameters comprise a storage adapter parameter and a storage rule parameter; when a file is stored, firstly, a corresponding storage rule is determined according to the attribute of the file, then, a corresponding storage adapter is obtained according to the storage rule, the file is stored on a storage location in the storage server corresponding to the adapter, and meanwhile, a file ID (Identity) and an adapter ID corresponding to the file ID are stored in a storage location table; and when the file is read, only the corresponding adapter ID needs to be looked up according to the file ID in the storage location table, and then, the file is read on the storage location of the storage server corresponding to the corresponding storage adapter. The method and the system can simultaneously support the compatibility requirements of various file storage ways (databases, file systems, FTP (File Transfer Protocol) and the like), and the corresponding storage way can be selected according to requirements.

Description

A kind of file access method and system
Technical field
The invention belongs to technical field of data storage, be specifically related to a kind of file access method and system.
Background technology
Along with the development of infotech and China's informatization are deeply promoted, the scope of business that government information management system covers is more and more extensive, and the data type of management becomes increasingly complex, data volume increases more and more faster.
For Chaoyang District, Beijing City agriculture committee financial indicator, in order to strengthen the supervision and check to rural area financial transaction, user requires often to open the scanned picture that electronic certificate all will preserve original document annex, and can consult at any time in systems in which.According to preresearch estimates, system is newly-increased attachment data amount 300-400 GB every year.If annex picture is kept at database, along with the quick growth speed of response of server of voucher attachment data amount can be slack-off gradually, storage, the backup pressure of database self also can be very large, are unfavorable for that system later stage O&M ensures.For the ease of strengthening the extendability of system, user also requires that system can the annex storage mode such as supporting database, file system, FTP.By analysis, existing annex storage means can not meet the compliance simultaneously supporting multiple accessories storage mode mostly, needs the storage to document annex, backup and access mechanism to carry out special design.
Summary of the invention
For the defect existed in prior art, the object of this invention is to provide a kind of file access method and system, the classification store and management to file can be realized as required by the method and system.
For reaching above object, disclosed in embodiment of the present invention, technical scheme is: a kind of file access method, comprises the following steps:
Arrange the configuration parameter of storage server, described configuration parameter comprises storage adapter parameter and storage rule parameter, and storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server; Storage rule parameter is used for the corresponding relation between description document attribute and storage adapter;
Client sends file to storage server and stores or read requests;
The file that storage server receives client transmission stores or read requests, and carries out storage or the reading of file according to described request; Wherein, storage server carries out file storage according to the file storage resource request of client and comprises:
Determine the storage rule corresponding with it according to the attribute of file to be stored, and determine the storage adapter corresponding with this storage rule according to the storage rule determined;
File to be stored is stored into the memory location in the storage server corresponding to the storage adapter determined, and after the storage completing file to be stored, the Adapter ID of file ID and the storage adapter corresponding with it is saved in the table of memory location;
Storage server carries out file reading according to the file read request of client and comprises:
File ID according to file to be read searches the Adapter ID corresponding with it in the table of memory location, determines corresponding storage adapter according to Adapter ID;
The memory location of file ID in the storage server corresponding to the storage adapter determined according to file to be read obtains described file to be read, and the file after obtaining is sent to client.
Optionally, method as above, described storage adapter parameter comprises the storage mode of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file; Described storage rule parameter comprises the Adapter ID of the storage adapter of file attribute corresponding to the number of storage rule, the rule ID of each storage rule, each storage rule and correspondence.
Optionally, method as above, described storage server comprises home server and/or cloud server; The storage mode of described file comprises database purchase mode, file system storage mode and FTP storage mode.
Optionally, method as above, described storage adapter comprises the first storage adapter and the second storage adapter; Storage rule is used for the corresponding relation between description document attribute and the first storage adapter;
Carry out file storage, if the storage rule corresponding with it cannot be determined according to the attribute of file to be stored, then file to be stored is stored into the memory location in the storage server corresponding to the second storage adapter;
When carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
Optionally, method as above, when carrying out file and reading, described method also comprises:
If the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, and described file to be read cannot be obtained according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, then storage server returns information to client, points out described file to be read not exist.
Optionally, method as above, after obtaining file to be read, described method also comprises: modify to described file to be read and preserve; Described amendment comprises renewal and deletes.
A kind of file access system, comprises client and storage server, and described client is used for sending file to storage server and stores or read requests; Described storage server comprises:
Parameter setting module, for arranging the configuration parameter of storage server; Described configuration parameter comprises storage adapter parameter and storage rule parameter, and storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server; Described storage rule parameter is used for the corresponding relation between description document attribute and storage adapter;
Request receiving module, the file sent for receiving client stores or read requests;
When carrying out file and storing, described storage server also comprises:
First matching module, for determining the storage rule corresponding with it according to the attribute of file to be stored, and determines the storage adapter corresponding with this storage rule according to the storage rule determined;
File storage module, for being stored into the memory location in the storage server corresponding to the storage adapter determined by file to be stored;
Logging modle, for after the storage completing file to be stored, is saved in the table of memory location by the Adapter ID of file ID and the storage adapter corresponding with it;
When carrying out file and reading, described storage server also comprises:
Second matching module, searches the Adapter ID corresponding with it for the file ID according to file to be read, determines corresponding storage adapter according to Adapter ID in the table of memory location;
File read module, for the memory location in the storage server corresponding to the storage adapter determined at the second matching module, reads file to be read according to the file ID of file to be stored;
File send module, for being sent to client by the file to be read obtained.
Optionally, system as above, described storage adapter parameter comprises the storage mode of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file; Described storage rule parameter comprises the Adapter ID of the storage adapter of file attribute corresponding to the number of storage rule, the rule ID of each storage rule, each storage rule and correspondence.
Optionally, described in system as above, storage server comprises home server and/or cloud server; The storage mode of described file comprises library storage mode, file system storage mode and FTP storage mode.
Optionally, described storage adapter comprises the first storage adapter and the second storage adapter; Storage rule is used for the corresponding relation between description document attribute and the first storage adapter;
Described file storage module, also for carrying out file storage, if cannot determine the storage rule corresponding with it according to the attribute of file to be stored, is then stored into the memory location in the storage server corresponding to the second storage adapter by file to be stored;
Described file read module, also for when carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
Optionally, when carrying out file and reading, described storage server also comprises:
Reminding module, for the Adapter ID corresponding with it cannot be searched at the file ID according to file to be read in the table of memory location, and when cannot obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, storage server returns information to client, does not exist to point out described file to be read.
Optionally, described client also comprises:
File modification module, for after acquisition file to be read, modifies to described file to be read, and amended file is saved in storage server; Described amendment comprises renewal and deletes.
Beneficial effect of the present invention is: adopt file access method and system disclosed in embodiment of the present invention, the compliance simultaneously supporting multiple document storage mode (library, file system, FTP etc.) can be realized, and can automatically select corresponding storage mode according to custom rule.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of a kind of file access method in the embodiment of the present invention;
Fig. 2 is the structured flowchart of a kind of file access system in the embodiment of the present invention
Fig. 3 be in the embodiment of the present invention storage server complete configuration parameter arrange after schematic diagram;
Fig. 4 is the schematic diagram carrying out file storage in the embodiment of the present invention;
Fig. 5 is the schematic diagram carrying out file reading in the embodiment of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
Fig. 1 shows the process flow diagram of a kind of file access method in the specific embodiment of the invention, and the method can comprise the following steps:
Step 100: the configuration parameter that storage server is set;
In the present embodiment, described configuration parameter comprises storage adapter parameter and storage rule parameter.
In order to realize supporting multiple document storage mode simultaneously, enable user according to storing the store and management needing to carry out file, the file memory method in the embodiment of the present invention introduces above-mentioned storage adapter and storage rule.Storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server.Wherein, described storage adapter is virtual adapter, and each storage adapter points to the concrete memory location of a storage server.Storage adapter parameter in the present embodiment comprises the storage mode (type of adapter) of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file.Storage server is used for storage file, and the storage server in the present embodiment comprises home server and/or cloud server; The storage mode of described file comprises database purchase mode (be kept at by file and specify in event data table, can carry out structuralized query to file), file system storage mode (being kept at by file in the local file directory of specifying or remote file sharing catalogue) and FTP storage mode (file is saved in long-range ftp server).That is, the file storage in the present embodiment can be stored in client this locality, also can be stored in cloud server by the mode of FTP.
Described storage parameter of regularity is used for the corresponding relation between description document attribute and storage adapter, between file class (file attribute) and storage adapter being can be man-to-man relation, also can be many-to-one relation, namely a class file can only a corresponding storage adapter, but multiclass file can corresponding same adapter.Described file attribute can refer to the type (as pdf file, jpg file) of file, size or other classification form.Such as: described storage rule can be: " file being less than 1MB is kept at memory location corresponding to storage adapter A, and the file being greater than 1MB is kept at memory location corresponding to storage adapter B " or " file of pdf type is saved in memory location corresponding to storage adapter C ".
In the application of reality, user can carry out the setting of its storage server configuration parameter according to actual needs, can select storage mode and the storage format of the file of memory location corresponding to each storage adapter.The storage number of adapter and the number of storage rule all can set as required, and such as need configuration 1 ~ N number of storage adapter and 1 ~ M storage rule, wherein, N and M is positive integer.
In addition, in actual applications, consider in the process of the configuration parameter that storage server is set, the attribute of all files can not be considered, also just corresponding storage adapter can not all be configured for the file of every attribute, therefore, in the present embodiment, described storage adapter comprises the first storage adapter and the second storage adapter, what storage rule described is corresponding relation between file attribute and the first storage adapter, second storage adapter is default storage adapter, this adapter is used for when carrying out file and storing, if the storage rule corresponding with it cannot be determined according to the attribute of file to be stored, then described file to be stored is saved in memory location corresponding to the second storage adapter.Default storage adapter must be enabled in the present embodiment.That is, if the attribute of file is in self-defining storage rule, then can determine first storage adapter corresponding with it according to file attribute, if the attribute of file does not exist in self-defined storage rule, then file is corresponding with the second storage adapter.
In the present embodiment, described storage adapter parameter can adopt the set-up mode shown in following table.
Field Type Whether major key
Adapter ID VARchar Be
Type of adapter VARchar
Adapter position parameter VARchar
Whether give tacit consent to adapter char
Whether enable char
Wherein, Adapter ID is the unique identification of storage adapter, and type of adapter is the storage mode of the memory location file that storage adapter is corresponding, the memory location in storage server of adapter position parameter corresponding to storage adapter.
Described storage rule can adopt the set-up mode shown in following table.
Field Type Whether major key
Rule ID VARchar Be
Rule name VARchar
Regular expression VARchar
Corresponding Adapter ID VARchar
Whether enable char
Wherein, rule ID is the unique identification of a storage rule, and rule name is the file attribute that a storage rule is corresponding, and regular expression is the description to file attribute, and corresponding Adapter ID is the mark of the storage adapter that storage rule is corresponding.
In the present embodiment, after completing the arranging of configuration parameter of storage server, can, by creating the list of adapter list Sum fanction in storage server, storage adapter parameter and storage rule be respectively put in the list of adapter class table Sum fanction for subsequent use.
Step S200: client sends file to storage server and stores or read requests;
Client as required, sends file storage resource request or file read request to storage server, and the file that storage server receives client transmission stores or after read requests, carries out storage or the reading of file according to described request.
In the present embodiment, when described request is file storage resource request, storage server carries out file storage according to the file storage resource request of client and comprises the following steps:
Step S201: determine the storage rule corresponding with it according to the attribute of file to be stored, and determine the storage adapter corresponding with this storage rule according to the storage rule determined;
Step S202: file to be stored is stored into the memory location in the storage server corresponding to the storage adapter determined;
Step S203: after the storage completing file to be stored, is saved in the table of memory location by the Adapter ID of file ID and the storage adapter corresponding with it;
First, according to the mode of determination file attribute selected in storage rule (as according to file size determination file attribute, or confirm file attribute according to file type) confirm the attribute of file to be stored, afterwards according to the attribute of file, the storage rule corresponding to this file attribute is searched in list of rules, and determine the first storage adapter corresponding to storage rule of finding, finally file to be stored is stored into the memory location in the corresponding multipair storage server of answering of the first storage adapter.
In the present embodiment, after the storage completing position to be stored, the file ID (unique identification information of file) of file to be stored and the Adapter ID of first storage adapter corresponding with it are saved in the table of memory location, so that the reading of subsequent file.In the present embodiment, described memory location table can adopt the form in following table.
Field Type Whether major key
File ID VARchar Be
Corresponding Adapter ID VARchar
Creation-time DATE
Update time DATE
In addition, carrying out file storage, if the attribute according to file to be stored cannot determine the storage rule corresponding with it, then file to be stored is stored into the memory location in the storage server corresponding to the second storage adapter (default storage adapter).
In the present embodiment, when described request is file read request, storage server carries out file reading according to the file read request of client and comprises the following steps:
Step S204: the file ID according to file to be read searches the Adapter ID corresponding with it in the table of memory location, determines corresponding storage adapter according to Adapter ID;
Step S205: the memory location of file ID in the storage server corresponding to the storage adapter determined according to file to be read obtains described file to be read;
Step S206: the file after obtaining is sent to client.
Due to when file is stored in storage server, the Adapter ID of the file ID of file and first storage adapter corresponding to it is saved in during memory location shows, therefore, when carrying out file and reading, the Adapter ID corresponding with it can be found in the table of memory location according to the file ID of file to be read, thus determine and the first storage adapter corresponding to file to be read, corresponding file to be read is obtained afterwards according to the memory location of file ID in the storage server corresponding to the first storage adapter determined, and the file to be read got is sent to client, complete the reading of file.
In addition, when carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
If the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, and described file to be read cannot be obtained according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, then storage server returns information to client, points out described file to be read not exist.
Client is after getting file to be read, and user can modify to described file to be read and preserve as required; Described amendment comprises renewal and deletes.
Corresponding to the embodiment of the file access method shown in Fig. 1, a kind of file access system is additionally provided in the embodiment of the present invention, as shown in Figure 2, this system comprises client 100 and storage server 200, and described client 100 stores or read requests for sending file to storage server; Described storage server 200 comprises:
Parameter setting module 201, for arranging the configuration parameter of storage server; Described configuration parameter comprises storage adapter parameter and storage rule, and storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server; Described storage rule is used for the corresponding relation between description document attribute and storage adapter.
In the present embodiment, described storage adapter parameter comprises the storage mode of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file; Described storage server comprises home server and/or cloud server; The storage mode of described file comprises database purchase mode, file system storage mode and FTP storage mode.Described storage adapter comprises the first storage adapter and the second storage adapter; Storage rule is used for the corresponding relation between description document attribute and the first storage adapter.
Request receiving module 202, the file sent for receiving client stores or read requests;
When carrying out file and storing, described storage server also comprises:
First matching module 203, for determining the storage rule corresponding with it according to the attribute of file to be stored, and determines the storage adapter corresponding with this storage rule according to the storage rule determined;
File storage module 204, for file to be stored being stored into the memory location in the storage server corresponding to the storage adapter determined, also for carrying out file storage, if the attribute according to file to be stored cannot determine the storage rule corresponding with it, then file to be stored is stored into the memory location in the storage server corresponding to the second storage adapter;
Logging modle 205, for after the storage completing file to be stored, is saved in the table of memory location by the Adapter ID of file ID and the storage adapter corresponding with it;
When carrying out file and reading, described storage server also comprises:
Second matching module 206, searches the Adapter ID corresponding with it for the file ID according to file to be read, determines corresponding storage adapter according to Adapter ID in the table of memory location;
File read module 207, for the memory location in the storage server corresponding to the storage adapter determined at the second matching module, file to be read is obtained according to the file ID of file to be stored, also for when carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
File send module 208, for being sent to client by the file to be read obtained.
In addition, in the present embodiment, when carrying out file and reading, described storage server can also comprise reminding module, described reminding module, for the Adapter ID corresponding with it cannot be searched at the file ID according to file to be read in the table of memory location, and when cannot obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, storage server returns information to client, does not exist to point out described file to be read.
In the present embodiment, described client can also comprise:
File modification module, for after acquisition file to be read, modifies to described file to be read, and amended file is saved in storage server; Described amendment comprises renewal and deletes.
Below in conjunction with specific embodiment, the method and system that the embodiment of the present invention provides is further described.
Embodiment
First, the configuration parameter of storage server is set.In the present embodiment, the configuration of adaptor parameters is as shown in the table:
As can be seen from table, the number of storage adapter is 2, Adapter ID be 1 storage adapter be the first storage adapter, i.e. default storage adapter, its memory location corresponding in storage server server that to be IP address be " 10.11.18.55 ", the storage mode of this server file is that DB and database mode store, the name of the database stored is called " testdb ", near corresponding in this database, storage list name is called " TABLE1 ", Adapter ID be 2 storage adapter be the first storage adapter, the memory location in storage server of its correspondence is that under D dish, name is called in the file of " ins directory 1 ", Adapter ID be 3 storage adapter be the second storage adapter (default storage adapter), the memory location of the storage adapter of its correspondence is that under D dish, name is called in the file of " ins directory 2 ".Above-mentioned configuration parameter after the setup, is stored in the adapter list in storage server internal memory with for subsequent use by above-mentioned storage adapter parameter.
In the present embodiment, the configuration of storage rule parameter is as following table:
As can be seen from table, storage rule is 2, the file that size that what first storage rule described is is less than 1MB and Adapter ID be 1 storage adapter corresponding, be more than or equal to 1MB and the file being less than or equal to 10MB and Adapter ID be 2 storage adapter corresponding.After accomplishing the setting up, above-mentioned configuration parameter is saved in the list of rules in storage server internal memory for subsequent use.
In the present embodiment, the list of rules in the storage server internal memory after literary composition becomes configuration parameter to arrange and adapter list state are as shown in Figure 3.
After completing the arranging of above-mentioned configuration parameter, adopt the method provided in the embodiment of the present invention to carry out the flow process of file storage and (do not draw default storage adapter in the figure) as shown in bold portion in Fig. 4:
1. client sends the storage resource request of file to be stored (in the present embodiment, file to be stored is annex f1) to storage server; Request comprises size and the file ID (file attribute namely in the present embodiment) of file to be stored;
2. storage server receives the storage resource request of the file to be stored that client sends;
3. in list of rules, search the storage rule of coupling according to the attribute of file to be stored, and find corresponding storage adapter according to the storage rule found;
In the present embodiment, in the present embodiment, the size of annex f1 is 2MB, and document size is greater than 1MB,
The storage rule corresponding with it is rule 2, then determine that corresponding storage adapter ID is 2 according to rule 2, then annex f1 is saved in the server file catalogue (D: ins directory) of specifying.While preserving file, a record can be increased preserve storage information in the table of memory location, comprise the file ID of annex f1, corresponding storage adapter ID, creation-time, modification time etc.
If the size of annex f1 is greater than 10MB, then question paper attribute cannot determine the storage rule corresponding with it, now then file to be stored is stored into the default storage adapter (memory location in corresponding storage server.
Adopt the method provided in the embodiment of the present invention to carry out the flow process of file reading and (do not draw default storage adapter in the figure) as shown in solid line in Fig. 5:
1. client sends the storage resource request of file to be read (in the present embodiment, file to be stored is annex f1) to storage server; Request comprises size and the file ID of file to be read, and size is 2M, and file ID is 01 literary composition;
2. storage server receives the read requests of the file to be read that client sends;
3. the ID searching the adapter corresponding with it according to file ID in the table of memory location is 2, memory location afterwards in the storage server of Adapter ID corresponding to the storage adapter of 2 and server file catalogue D: obtain annex f1 in ins directory, and the file after obtaining is sent to client.
Each embodiment in this instructions all adopts relevant mode to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realized in said method embodiment is that the hardware that can carry out instruction relevant by program has come, described program can be stored in computer read/write memory medium, here the alleged storage medium obtained, as: ROM/RAM, magnetic disc, CD etc.It will be understood by those skilled in the art that method and system of the present invention is not limited to the embodiment described in embodiment, specific descriptions above, just in order to explain object of the present invention, are not for limiting the present invention.Those skilled in the art's technical scheme according to the present invention draws other embodiment, and belong to technological innovation scope of the present invention equally, protection scope of the present invention is by claim and equivalents thereof.

Claims (12)

1. a file access method, comprises the following steps:
Arrange the configuration parameter of storage server, described configuration parameter comprises storage adapter parameter and storage rule parameter, and storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server; Storage rule parameter is used for the corresponding relation between description document attribute and storage adapter;
Client sends file to storage server and stores or read requests;
The file that storage server receives client transmission stores or read requests, and carries out storage or the reading of file according to described request; Wherein, storage server carries out file storage according to the file storage resource request of client and comprises:
Determine the storage rule corresponding with it according to the attribute of file to be stored, and determine the storage adapter corresponding with this storage rule according to the storage rule determined;
File to be stored is stored into the memory location in the storage server corresponding to the storage adapter determined, and after the storage completing file to be stored, the Adapter ID of file ID and the storage adapter corresponding with it is saved in the table of memory location;
Storage server carries out file reading according to the file read request of client and comprises:
File ID according to file to be read searches the Adapter ID corresponding with it in the table of memory location, determines corresponding storage adapter according to Adapter ID;
The memory location of file ID in the storage server corresponding to the storage adapter determined according to file to be read obtains described file to be read, and the file after obtaining is sent to client.
2. the method for claim 1, is characterized in that: described storage adapter parameter comprises the storage mode of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file; Described storage rule parameter comprises the Adapter ID of the storage adapter of file attribute corresponding to the number of storage rule, the rule ID of each storage rule, each storage rule and correspondence.
3. method as claimed in claim 2, it is characterized in that, described storage server comprises home server and/or cloud server; The storage mode of described file comprises library storage mode, file system storage mode and FTP storage mode.
4. the method as described in one of claims 1 to 3, is characterized in that, described storage adapter comprises the first storage adapter and the second storage adapter; Storage rule parameter is used for the corresponding relation between description document attribute and the first storage adapter;
Carry out file storage, if the storage rule corresponding with it cannot be determined according to the attribute of file to be stored, then file to be stored is stored into the memory location in the storage server corresponding to the second storage adapter;
When carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
5. method as claimed in claim 4, is characterized in that: when carrying out file and reading, described method also comprises:
If the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, and described file to be read cannot be obtained according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, then storage server returns information to client, points out described file to be read not exist.
6. method as claimed in claim 4, it is characterized in that, after obtaining file to be read, described method also comprises: modify to described file to be read and preserve; Described amendment comprises renewal and deletes.
7. a file access system, comprises client and storage server, and described client is used for sending file to storage server and stores or read requests; It is characterized in that, described storage server comprises:
Parameter setting module, for arranging the configuration parameter of storage server; Described configuration parameter comprises storage adapter parameter and storage rule, and storage adapter parameter is for describing the corresponding relation of storage adapter and its memory location in storage server; Described storage rule is used for the corresponding relation between description document attribute and storage adapter;
Request receiving module, the file sent for receiving client stores or read requests;
When carrying out file and storing, described storage server also comprises:
First matching module, for determining the storage rule corresponding with it according to the attribute of file to be stored, and determines the storage adapter corresponding with this storage rule according to the storage rule determined;
File storage module, for being stored into the memory location in the storage server corresponding to the storage adapter determined by file to be stored;
Logging modle, for after the storage completing file to be stored, is saved in the table of memory location by the Adapter ID of file ID and the storage adapter corresponding with it;
When carrying out file and reading, described storage server also comprises:
Second matching module, searches the Adapter ID corresponding with it for the file ID according to file to be read, determines corresponding storage adapter according to Adapter ID in the table of memory location;
File read module, for the memory location in the storage server corresponding to the storage adapter determined at the second matching module, obtains file to be read according to the file ID of file to be stored;
File send module, for being sent to client by the file to be read obtained.
8. system as claimed in claim 7, is characterized in that: described storage adapter parameter comprises the storage mode of memory location in storage server corresponding to the number of storage adapter, the Adapter ID of each storage adapter, each storage adapter and described memory location file; Described storage rule parameter comprises the Adapter ID of the storage adapter of file attribute corresponding to the number of storage rule, the rule ID of each storage rule, each storage rule and correspondence.
9. system as claimed in claim 7, it is characterized in that, described storage server comprises home server and/or cloud server; The storage mode of described file comprises database purchase mode, file system storage mode and FTP storage mode.
10. the system as described in one of claim 7 to 9, is characterized in that, described storage adapter comprises the first storage adapter and the second storage adapter; Storage rule is used for the corresponding relation between description document attribute and the first storage adapter;
Described file storage module, also for carrying out file storage, if cannot determine the storage rule corresponding with it according to the attribute of file to be stored, is then stored into the memory location in the storage server corresponding to the second storage adapter by file to be stored;
Described file read module, also for when carrying out file and reading, if the file ID according to file to be read cannot search the Adapter ID corresponding with it in the table of memory location, then obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read.
11. systems as claimed in claim 10, is characterized in that: when carrying out file and reading, described storage server also comprises:
Reminding module, for the Adapter ID corresponding with it cannot be searched at the file ID according to file to be read in the table of memory location, and when cannot obtain described file to be read according to the memory location of file ID in the storage server corresponding to the second storage adapter of file to be read, storage server returns information to client, does not exist to point out described file to be read.
12. systems stated as claim 7, is characterized in that: described client also comprises:
File modification module, for after acquisition file to be read, modifies to described file to be read, and amended file is saved in storage server; Described amendment comprises renewal and deletes.
CN201410571640.8A 2014-10-23 2014-10-23 File access method and system Pending CN104408044A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410571640.8A CN104408044A (en) 2014-10-23 2014-10-23 File access method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410571640.8A CN104408044A (en) 2014-10-23 2014-10-23 File access method and system

Publications (1)

Publication Number Publication Date
CN104408044A true CN104408044A (en) 2015-03-11

Family

ID=52645676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410571640.8A Pending CN104408044A (en) 2014-10-23 2014-10-23 File access method and system

Country Status (1)

Country Link
CN (1) CN104408044A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104766027A (en) * 2015-03-25 2015-07-08 深圳市金立通信设备有限公司 Data access method
CN104766026A (en) * 2015-03-25 2015-07-08 深圳市金立通信设备有限公司 Terminal
CN105338073A (en) * 2015-10-20 2016-02-17 浪潮集团有限公司 File directory processing method, server and system
CN105592162A (en) * 2016-01-20 2016-05-18 歌尔声学股份有限公司 Uploading method and system based on multi-type files
CN105653692A (en) * 2015-12-30 2016-06-08 北京奇艺世纪科技有限公司 File storage method and apparatus based on non-relational database
WO2016101662A1 (en) * 2014-12-26 2016-06-30 华为技术有限公司 Data processing method and relevant server
CN109002554A (en) * 2018-08-09 2018-12-14 佛山长意云信息技术有限公司 A kind of file management method, device, computer equipment and storage medium
CN109743337A (en) * 2019-03-20 2019-05-10 中国核动力研究设计院 The lower dress means of communication in nuclear safe level DCS system based on Transmission Control Protocol
CN110474959A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 Data interactive method, device, computer equipment and storage medium
CN111881087A (en) * 2020-07-30 2020-11-03 北京浪潮数据技术有限公司 File management operation method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5287500A (en) * 1991-06-03 1994-02-15 Digital Equipment Corporation System for allocating storage spaces based upon required and optional service attributes having assigned piorities
CN101556557A (en) * 2009-05-14 2009-10-14 浙江大学 Object file organization method based on object storage device
CN103620549A (en) * 2011-06-20 2014-03-05 微软公司 Storage media abstraction for uniform data storage
CN103914456A (en) * 2012-12-31 2014-07-09 北京中交兴路信息科技有限公司 Data storage method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5287500A (en) * 1991-06-03 1994-02-15 Digital Equipment Corporation System for allocating storage spaces based upon required and optional service attributes having assigned piorities
CN101556557A (en) * 2009-05-14 2009-10-14 浙江大学 Object file organization method based on object storage device
CN103620549A (en) * 2011-06-20 2014-03-05 微软公司 Storage media abstraction for uniform data storage
CN103914456A (en) * 2012-12-31 2014-07-09 北京中交兴路信息科技有限公司 Data storage method and system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016101662A1 (en) * 2014-12-26 2016-06-30 华为技术有限公司 Data processing method and relevant server
CN104766026A (en) * 2015-03-25 2015-07-08 深圳市金立通信设备有限公司 Terminal
CN104766027A (en) * 2015-03-25 2015-07-08 深圳市金立通信设备有限公司 Data access method
CN105338073A (en) * 2015-10-20 2016-02-17 浪潮集团有限公司 File directory processing method, server and system
CN105653692B (en) * 2015-12-30 2019-06-21 北京奇艺世纪科技有限公司 A kind of file memory method and device based on non-relational database
CN105653692A (en) * 2015-12-30 2016-06-08 北京奇艺世纪科技有限公司 File storage method and apparatus based on non-relational database
CN105592162A (en) * 2016-01-20 2016-05-18 歌尔声学股份有限公司 Uploading method and system based on multi-type files
CN105592162B (en) * 2016-01-20 2019-05-17 歌尔股份有限公司 Method for uploading and system based on polymorphic type file
CN109002554A (en) * 2018-08-09 2018-12-14 佛山长意云信息技术有限公司 A kind of file management method, device, computer equipment and storage medium
CN109743337A (en) * 2019-03-20 2019-05-10 中国核动力研究设计院 The lower dress means of communication in nuclear safe level DCS system based on Transmission Control Protocol
CN109743337B (en) * 2019-03-20 2021-03-02 中核控制系统工程有限公司 TCP protocol-based download communication method in nuclear security level DCS system
CN110474959A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 Data interactive method, device, computer equipment and storage medium
CN110474959B (en) * 2019-07-12 2023-02-03 平安普惠企业管理有限公司 Data interaction method and device, computer equipment and storage medium
CN111881087A (en) * 2020-07-30 2020-11-03 北京浪潮数据技术有限公司 File management operation method and related device

Similar Documents

Publication Publication Date Title
CN104408044A (en) File access method and system
US8924365B2 (en) System and method for range search over distributive storage systems
CN104750681B (en) A kind of processing method and processing device of mass data
CN102629247B (en) Method, device and system for data processing
US20120265836A1 (en) File sharing system and file sharing method
CN106407303A (en) Data storage method and apparatus, and data query method and apparatus
CN105488043A (en) Data query method and system based on Key-Value data blocks
CN107911461B (en) Object processing method in cloud storage system, storage server and cloud storage system
CN109284273B (en) Massive small file query method and system adopting suffix array index
CN101504670A (en) Data operation method, system, client terminal and data server
CN107704202B (en) Method and device for quickly reading and writing data
CN104516974A (en) Management method and device for file system directory entry
CN101944124A (en) Distributed file system management method, device and corresponding file system
US8380663B2 (en) Data integrity in a database environment through background synchronization
US9081784B2 (en) Delta indexing method for hierarchy file storage
CN105404634A (en) Key-Value data block based data management method and system
CN104239377A (en) Platform-crossing data retrieval method and device
US20140019454A1 (en) Systems and Methods for Caching Data Object Identifiers
CN105338073A (en) File directory processing method, server and system
CN103870557A (en) Database-based electronic file storage system
CN106484694B (en) Full-text search method and system based on distributed data base
CN104636368A (en) Data retrieval method and device and server
WO2020215580A1 (en) Distributed global data deduplication method and device
CN103365987A (en) Clustered database system and data processing method based on shared-disk framework
CN102193988A (en) Method and system for retrieving node data in graphic database

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150311

RJ01 Rejection of invention patent application after publication