CN104462536B - A kind of file access method and device - Google Patents
A kind of file access method and device Download PDFInfo
- Publication number
- CN104462536B CN104462536B CN201410817742.3A CN201410817742A CN104462536B CN 104462536 B CN104462536 B CN 104462536B CN 201410817742 A CN201410817742 A CN 201410817742A CN 104462536 B CN104462536 B CN 104462536B
- Authority
- CN
- China
- Prior art keywords
- storage
- file destination
- initial
- file
- moment
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
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 invention discloses a kind of file access method and device, a kind of file access method includes the following steps:Receive the access request for file destination;Determine the initial memory device and initial storage moment T1 of the file destination;According to the initial memory device of the file destination, the cold storage server that there is correspondence with the initial memory device is further determined that;Obtain the vernier moment T2 of the cold storage server;According to the magnitude relationship of T1 and T2, the current storage devices of the file destination are determined;According to the current storage devices of identified file destination, access to the file destination.The technical solution provided using the embodiment of the present invention does not need chargeable heat storage server resource, improves the access speed of file of the actual storage in cold storage server if file destination has had migrated in cold storage server.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of file access method and device.
Background technology
The video source file that the editor of video website or external user upload, is stored in storage server, production clothes
Be engaged in device access video source file, and it is carried out the video productions such as transcoding, editor, audit processing after, could generate can be at end
Hold the video resource played out.In practical applications, recent video source file, visit capacity is bigger, and early stage regards
The visit capacity of frequency source file is less.So storage server is usually divided into hot storage server and cold storage server, and will
The initial storage server of video source file is as hot storage server, the video source document in the hot storage server of periodic monitoring
Part moves to the video source file of early stage from hot storage server in cold storage server, i.e., in hot storage server
Only retain recent video source file.Video source file is subjected to cold and hot separation storage, is primarily due to take compared to cold storage
Business device, hot storage server need to handle more access requests, and general configuration is higher, and maintenance cost is also higher, to video source
File is done after cold and hot separation storage processing, it is possible to reduce maintenance cost.
Video source file is stored using this cold and hot separation storage mode so that when having video production demand, video source document
The initial storage path of part and actual storage path may be not consistent, so production server is visited to video source file
When asking, it can first go in corresponding hot storage server to search, if do not looked into according to the initial storage path of the video source file
It finds, then goes in the cold storage server made an appointment to search.
This access method the problem is that, even if video source file is not stored in hot storage server, production
Server is also required to arrive first and be searched in hot storage server, and search procedure consumes hot storage server resource, reduces
To the access speed of the video source file.
Invention content
To solve the above problems, the embodiment of the invention discloses a kind of file access method and devices.Technical solution is as follows:
A kind of file access method, including:
Receive the access request for file destination;
Determine the initial memory device and initial storage moment T1 of the file destination;Wherein, the initial memory device
For hot storage server, the initial storage moment is:The storage moment on initial memory device;
According to the initial memory device of the file destination, further determine that has correspondence with the initial memory device
Cold storage server;
The vernier moment T2 of the cold storage server is obtained, the vernier moment of the cold storage server is:This is cold to deposit
It stores up in server, there is the initial storage moment of the file at initial storage moment the latest;
According to the magnitude relationship of T1 and T2, the current storage devices of the file destination are determined;
According to the current storage devices of identified file destination, access to the file destination.
In a kind of specific implementation mode of the present invention, the magnitude relationship according to T1 and T2 determines the target text
The current storage devices of part, including:
Judge whether T1 is more than T2;
If it is, determining that the current storage devices of the file destination are:The initial memory device of the file destination;
Otherwise, it determines the current storage devices of the file destination are:It is set with the initial storage where the file destination
The standby cold storage server with correspondence.
In a kind of specific implementation mode of the present invention, the current storage devices of file destination determined by the basis,
It accesses to the file destination, including:
In the case where the current storage devices of identified file destination are initial memory device, the target text is determined
The currently stored path of part is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the target text is determined
The currently stored path of part is:The mark of the cold storage server is replaced first in the initial storage path of the file destination
The path of beginning storage device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage
Initial memory device is included at least in path to identify;During file migration, the bibliographic structure one in hot and cold storage server
It causes.
In a kind of specific implementation mode of the present invention, storage catalogue name of the file destination in initial memory device
In title, storage time information of the file destination on the initial memory device is carried;
The initial storage moment T1 of the determination file destination, including:
Obtain the initial storage routing information of the file destination;
From the initial storage routing information of the file destination, the storage catalogue title of this document is extracted;
According to preset storage catalogue naming rule, the storage catalogue title extracted is parsed, determines the mesh
Mark the initial storage moment T1 of file.
In a kind of specific implementation mode of the present invention, the preset storage catalogue naming rule is depositing according to file
The moment is stored up, file is stored according to time, month, day part catalogue.
A kind of file access device, including:
Access request receiving module, for receiving the access request for file destination;
First determining module, the initial memory device for determining the file destination and initial storage moment T1;Wherein,
The initial memory device is hot storage server, and the initial storage moment is:The storage moment on initial memory device;
The initial storage of second determining module, the file destination for being determined according to first determining module is set
It is standby, further determine that the cold storage server that there is correspondence with the initial memory device;
Vernier moment acquisition module, the vernier moment for obtaining the cold storage server that second determining module determines
The vernier moment of T2, the cold storage server is:In the cold storage server, with the file at initial storage moment the latest
The initial storage moment;
Third determining module determines the current storage devices of the file destination for the magnitude relationship according to T1 and T2;
File access module is used for the current storage devices according to file destination determined by the third determining module,
It accesses to the file destination.
In a kind of specific implementation mode of the present invention, the third determining module, including:
Judging submodule, for judging whether T1 is more than T2;
First determination sub-module, in the case where the judging result of the judging submodule is to be, determining the mesh
Mark file current storage devices be:The initial memory device of the file destination;
Second determination sub-module, in the case where the judging result of the judging submodule is no, determining the mesh
Mark file current storage devices be:With the initial memory device where the file destination there is the cold storage of correspondence to take
Business device.
In a kind of specific implementation mode of the present invention, the file access module is specifically used for:
In the case where the current storage devices of identified file destination are initial memory device, the target text is determined
The currently stored path of part is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the target text is determined
The currently stored path of part is:The mark of the cold storage server is replaced first in the initial storage path of the file destination
The path of beginning storage device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage
Initial memory device is included at least in path to identify;During file migration, the bibliographic structure one in hot and cold storage server
It causes.
In a kind of specific implementation mode of the present invention, first determining module, including:
Initial storage routing information obtains submodule, for the storage mesh in the file destination in initial memory device
It records in title, carries the file destination in the case of storage time information on the initial memory device, obtain the target
The initial storage routing information of file;
Storage catalogue title extracting sub-module, for from the initial storage routing information of the file destination, extraction should
The storage catalogue title of file;
Initial storage moment determination sub-module is used for according to preset storage catalogue naming rule, the storage to extracting
Directory name is parsed, and determines the initial storage moment T1 of the file destination.
In a kind of specific implementation mode of the present invention, the preset storage catalogue naming rule is depositing according to file
The moment is stored up, file is stored according to time, month, day part catalogue.
The technical solution that the embodiment of the present invention is provided, after receiving the access request for file destination, it may be determined that
The initial memory device of the file destination and initial storage moment.Because the initial memory device of each file is heat storage clothes
Be engaged in device, and hot storage server and cold storage server have correspondence, by the correspondence, may further determine with
The corresponding cold storage server of the initial memory device.File in cold storage server is migrated from hot storage server
It arrives, after the completion of each migration task, the vernier moment of cold storage server will be arranged in the cold storage server, tool
Have the initial storage moment of the file at initial storage moment the latest, thus by the initial storage moment of file destination with it is identified
The vernier moment of cold storage server is compared, it may be determined that the current storage devices of the file destination, to according to target
The current storage devices of file, access to it.The technical solution provided using the embodiment of the present invention, if file destination
It has had migrated in cold storage server, has then passed through the current storage devices of identified file destination, so that it may to target text
Part accesses, and need not arrive initial memory device, i.e., is searched in hot storage server, do not need chargeable heat storage service in this way
Device resource improves the access speed of file of the actual storage in cold storage server.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of implementing procedure figure of file access method in the embodiment of the present invention;
Fig. 2 is video production system structural schematic diagram in the embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of file access device in the embodiment of the present invention.
Specific implementation mode
It is provided for the embodiments of the invention a kind of file access method first to illustrate, this method may include following
Step:
Receive the access request for file destination;
Determine the initial memory device and initial storage moment T1 of the file destination;Wherein, the initial memory device
For hot storage server, the initial storage moment is:The storage moment on initial memory device;
According to the initial memory device of the file destination, further determine that has correspondence with the initial memory device
Cold storage server;
The vernier moment T2 of the cold storage server is obtained, the vernier moment of the cold storage server is:This is cold to deposit
It stores up in server, there is the initial storage moment of the file at initial storage moment the latest;
According to the magnitude relationship of T1 and T2, the current storage devices of the file destination are determined;
According to the current storage devices of identified file destination, access to the file destination.
The executive agent of above step is to the file in storage server (hot storage server or cold storage server)
The server to access e.g. during video production, needs the production to access to the video file in storage server
Server, alternatively, according to the access request of user, the access server that accesses to the file in storage server.It needs
Illustrate, storage server can be one or more server, and more hot storage servers constitute hot storage clusters, more
Cold storage server constitutes cold storage cluster.
The technical solution that the embodiment of the present invention is provided, after receiving the access request for file destination, it may be determined that
The initial memory device of the file destination and initial storage moment.Because the initial memory device of each file is heat storage clothes
Be engaged in device, and hot storage server and cold storage server have correspondence, by the correspondence, may further determine with
The corresponding cold storage server of the initial memory device.File in cold storage server is migrated from hot storage server
It arrives, after the completion of each migration task, the vernier moment of cold storage server will be arranged in the cold storage server, tool
Have the initial storage moment of the file at initial storage moment the latest, thus by the initial storage moment of file destination with it is identified
The vernier moment of cold storage server is compared, it may be determined that the current storage devices of the file destination, to according to target
The current storage devices of file, access to it.The technical solution provided using the embodiment of the present invention, if file destination
It has had migrated in cold storage server, has then passed through the current storage devices of identified file destination, so that it may to target text
Part accesses, and need not arrive initial memory device, i.e., is searched in hot storage server, do not need chargeable heat storage service in this way
Device resource improves the access speed of file of the actual storage in cold storage server.
In order to make those skilled in the art more fully understand the technical solution in the embodiment of the present invention, below in conjunction with this hair
Attached drawing in bright embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described
Embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field
The every other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention
Range.
Shown in Fig. 1, by a kind of implementing procedure figure for file access method that the embodiment of the present invention provides, this method can be with
Include the following steps:
S110:Receive the access request for file destination;
File destination is stored in storage server (hot storage server or cold storage server).With shown in Fig. 2 one
For a simple video production system, which includes storage management platform 210, production server 220, heat
Storage server 230 and cold storage server 240, when needing to produce video file, storage management platform 210 can be with
The access request for file destination is sent to production server 220, production server 220 can be to hot storage server 230
It accesses with the file stored in cold storage server 240.Production server receives the access for file destination and asks
After asking, following steps are continued to execute.
For convenience of description, to the explanation of following steps by taking video production system shown in Fig. 2 as an example.
S120:Determine the initial memory device and initial storage moment T1 of the file destination;
Wherein, the initial memory device is hot storage server, and the initial storage moment is:In initial memory device
On the storage moment.
When there is file upload, file is stored in hot storage server first, so, the initial memory device of file
It is hot storage server.In storing process, initial memory device and the initial storage moment of file can be recorded.Such as regarding
In frequency production system, storage management platform can record file initial memory device and initial storage moment, be given birth to when starting video
When production task, the initial of file destination can be carried in the access request for file destination transmitted by storage management platform
Storage device and initial storage moment, by the access request, production server can determine that the initial storage of file destination is set
The standby and initial storage moment.
Alternatively, when file is uploaded to hot storage server, the initial storage path of this document is built, on initial storage road
It can include storage device identification in diameter, can also include storage moment mark.It can in the access request for file destination
To carry the initial storage routing information, to according to the information, it may be determined that the initial memory device of file destination and initial
Store the moment.
In one embodiment of the invention, in storage catalogue title of the file destination in initial memory device,
Carry storage time information of the file destination on the initial memory device;
The method for determining the initial storage moment T1 of the file destination, may comprise steps of:
First step:Obtain the initial storage routing information of the file destination;
Second step:From the initial storage routing information of the file destination, the storage catalogue name of this document is extracted
Claim;
Third step:According to preset storage catalogue naming rule, the storage catalogue title extracted is parsed,
Determine the initial storage moment T1 of the file destination.
In practical applications, the storage catalogue of the file in storage server is stored in when can be according to the storage of file
It carves, file is stored according to time, month, day part catalogue, can also be directly storage catalogue by the storage moment of file.
If the storage catalogue of file is 2014/01/01/dd.mp4, it is known that the initial storage moment of this document is on January 1st, 2014;Or
The storage catalogue of person, file are 20140701/dd.mp4, it is known that the initial storage moment of this document is on July 1st, 2014.
It is used as storage catalogue after the storage moment of file can also be converted to specific format, extracts the storage catalogue name
After title, it is reduced to the moment further according to specific format, so that it is determined that the initial storage moment of file destination.
S130:According to the initial memory device of the file destination, further determine that with the initial memory device have pair
The cold storage server that should be related to;
Hot storage server and cold storage server have one-to-one or many-to-one correspondence, that is, a heat is deposited
It stores up server and corresponds to one cold storage server of a cold storage server or more hot storage servers correspondences.In step
After S120 determines the initial memory device of file destination, by the correspondence, it may further determine that and file destination
Initial memory device have correspondence cold storage server.
For ease of understanding, by taking video production system shown in Fig. 2 as an example, file is migrated from hot storage server to cold and is deposited
The process of storage server is briefly described.
In video production system, record has hot storage server and cold storage server in storage management platform 210
Correspondence, i.e., it is corresponding with the hot storage server of any platform when each cold storage server enables.Within the system, it deposits
Storing up the main function that management platform 210 rises is:The state of file in all hot storage servers of periodic monitoring, if prison
Measuring has more outmoded file in some hot storage server, such as the file before x months, then starts migration task, will
These outmoded files are migrated from the hot storage server where it into cold storage server corresponding with the hot storage server.
In transition process, keep cold and hot storage server bibliographic structure consistent.If there is the file of migration failure, can pass through multiple
Migration is attempted, and until All Files migrate successfully, alternatively, after repeatedly migrating trial, is still had the file that can not be migrated, then may be used
This document to be marked, migrated manually by operation personnel.
By above to the explanation of transition process it is found that it is current need to access to file destination at the time of, the mesh
Mark file may not be stored in its initial memory device, i.e., in hot storage server, it is possible to be migrated to cold storage service
On device.Production server 220 can be easy to know and identified initial storage by the interaction with storage management platform 210
Equipment has the cold storage server of correspondence.
S140:Obtain the vernier moment T2 of the cold storage server;
The vernier moment of the cold storage server is:In the cold storage server, with the initial storage moment the latest
The initial storage moment of file.
Each cold storage server, which has, enables moment and vernier moment, enables the moment and fixes, be exactly its start to receive from
At the time of hot storage server migrates the file to come, the vernier moment such as needs to be configured at the task completion to be migrated.
For ease of understanding, it is illustrated by taking the transition process described in step S130 as an example.
After storage management platform 210 starts migration task, multiple mirror back-up tools (such as rsync) can be dispatched, to symbol
The file of conjunction condition is concurrently migrated, because file is of different sizes, required migration duration is different.Only confirm
All after Successful migration, the vernier moment of cold storage server is just arranged so that the vernier moment and the cold storage in All Files
Have the initial storage moment of the file at initial storage moment the latest identical in server.The vernier moment is it can be shown that at this
In cold storage server, the initial storage moment of All Files is all not later than the vernier moment.For example, certain cold storage server
The vernier moment is on January 1st, 2014, shows that the initial storage moment of the file stored in the cold storage server is not late
On January 1st, 2014.
S150:According to the magnitude relationship of T1 and T2, the current storage devices of the file destination are determined;
As previously mentioned, the vernier moment of cold storage server it can be shown that in the cold storage server, All Files
The initial storage moment is all not later than the vernier moment.Based on this, taken by the initial storage moment T1 and cold storage of file destination
The magnitude relationship of the vernier moment T2 of business device, it may be determined that the current storage devices of file destination.
The method for determining the current storage devices of file destination may comprise steps of:
Step 1:Judge whether T1 is more than T2, if it is, executing step 2, otherwise executes step 3;
Step 2:Determine that the current storage devices of the file destination are:The initial memory device of the file destination;
Step 3:Determine that the current storage devices of the file destination are:With the initial storage where the file destination
Equipment has the cold storage server of correspondence.
S160:According to the current storage devices of identified file destination, access to the file destination.
After the current storage devices for determining file destination, the currently stored path of file destination may further determine that,
To access to file destination.
In a kind of specific implementation mode of the present invention,
In the case where the current storage devices of identified file destination are initial memory device, the target text is determined
The currently stored path of part is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the target text is determined
The currently stored path of part is:The mark of the cold storage server is replaced first in the initial storage path of the file destination
The path of beginning storage device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage
Initial memory device is included at least in path to identify;During file migration, the bibliographic structure one in hot and cold storage server
It causes.
The structure in initial storage path can be:{ storage device identification }/{ specific location of the file in storage device },
For example, the initial storage path of file is:Sh-ugc1/aa/bb/cc/aabbcc.mp4 shows this document initial storage in mark
It is in the hot storage server of sh-ugc1 to know, and the specific location in the hot storage server is aa/bb/cc.If initially deposited
It is wh-ugc1 to store up the corresponding cold storage server of equipment sh-ugc1, by executing above-mentioned steps, when determining working as file destination
When preceding storage device is initial memory device, then it can determine that the currently stored path of file destination is still sh-ugc1/aa/bb/
cc/aabbcc.mp4;When it is cold storage server to determine the current storage devices of file destination, then file destination can be determined
Currently stored path be wh-ugc1/aa/bb/cc/aabbcc.mp4, this is by the mark wh- of the cold storage server
Ugc1 replaces the path after the initial memory device mark sh-ugc1 in initial storage path.
The technical solution that the embodiment of the present invention is provided, after receiving the access request for file destination, it may be determined that
The initial memory device of the file destination and initial storage moment.Because the initial memory device of each file is heat storage clothes
Be engaged in device, and hot storage server and cold storage server have correspondence, by the correspondence, may further determine with
The corresponding cold storage server of the initial memory device.File in cold storage server is migrated from hot storage server
It arrives, after the completion of each migration task, the vernier moment of cold storage server will be arranged in the cold storage server, tool
Have the initial storage moment of the file at initial storage moment the latest, thus by the initial storage moment of file destination with it is identified
The vernier moment of cold storage server is compared, it may be determined that the current storage devices of the file destination, to according to target
The current storage devices of file, access to it.The technical solution provided using the embodiment of the present invention, if file destination
It has had migrated in cold storage server, has then passed through the current storage devices of identified file destination, so that it may to target text
Part accesses, and need not arrive initial memory device, i.e., is searched in hot storage server, do not need chargeable heat storage service in this way
Device resource improves the access speed of file of the actual storage in cold storage server.
Corresponding to above method embodiment, the embodiment of the invention also discloses a kind of file access devices, referring to Fig. 3 institutes
Show, which may include with lower module:
Access request receiving module 310, for receiving the access request for file destination;
First determining module 320, the initial memory device for determining the file destination and initial storage moment T1;Its
In, the initial memory device is hot storage server, and the initial storage moment is:In the storage on initial memory device
It carves;
Second determining module 330, the initial of the file destination for being determined according to first determining module 310 are deposited
Equipment is stored up, further determines that the cold storage server that there is correspondence with the initial memory device;
Vernier moment acquisition module 340, the trip for obtaining the cold storage server that second determining module 330 determines
Moment T2 is marked, the vernier moment of the cold storage server is:In the cold storage server, with the initial storage moment the latest
The initial storage moment of file;
Third determining module 350 determines that the currently stored of the file destination is set for the magnitude relationship according to T1 and T2
It is standby;
File access module 360, for according to the currently stored of file destination determined by the third determining module 350
Equipment accesses to the file destination.
In a kind of specific implementation mode of the present invention, the third determining module 350 may include following submodule:
Judging submodule, for judging whether T1 is more than T2;
First determination sub-module, in the case where the judging result of the judging submodule is to be, determining the mesh
Mark file current storage devices be:The initial memory device of the file destination;
Second determination sub-module, in the case where the judging result of the judging submodule is no, determining the mesh
Mark file current storage devices be:With the initial memory device where the file destination there is the cold storage of correspondence to take
Business device.
In a kind of specific implementation mode of the present invention, the file access module 360 is specifically used for:
In the case where the current storage devices of identified file destination are initial memory device, the target text is determined
The currently stored path of part is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the target text is determined
The currently stored path of part is:The mark of the cold storage server is replaced first in the initial storage path of the file destination
The path of beginning storage device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage
Initial memory device is included at least in path to identify;During file migration, the bibliographic structure one in hot and cold storage server
It causes.
In a kind of specific implementation mode of the present invention, first determining module 320 may include following submodule:
Initial storage routing information obtains submodule, for the storage mesh in the file destination in initial memory device
It records in title, carries the file destination in the case of storage time information on the initial memory device, obtain the target
The initial storage routing information of file;
Storage catalogue title extracting sub-module, for from the initial storage routing information of the file destination, extraction should
The storage catalogue title of file;
Initial storage moment determination sub-module is used for according to preset storage catalogue naming rule, the storage to extracting
Directory name is parsed, and determines the initial storage moment T1 of the file destination.
In a kind of specific implementation mode of the present invention, the preset storage catalogue naming rule is depositing according to file
The moment is stored up, file is stored according to time, month, day part catalogue.
The device that the embodiment of the present invention is provided, after receiving the access request for file destination, it may be determined that the mesh
Mark initial memory device and the initial storage moment of file.Because the initial memory device of each file is hot storage service
Device, and hot storage server and cold storage server have correspondence, by the correspondence, may further determine and be somebody's turn to do
The corresponding cold storage server of initial memory device.File in cold storage server is to migrate to obtain from hot storage server
, after the completion of each migration task, the vernier moment of cold storage server will be arranged in the cold storage server, have
The initial storage moment of the file at initial storage moment the latest, thus by the initial storage moment of file destination with it is identified cold
The vernier moment of storage server is compared, it may be determined that the current storage devices of the file destination, to according to target text
The current storage devices of part, access to it.The device provided using the embodiment of the present invention, if file destination has moved
It has been moved in cold storage server, then passes through the current storage devices of identified file destination, so that it may which file destination is carried out
It accesses, initial memory device need not be arrived, i.e., searched in hot storage server, do not need chargeable heat storage server money in this way
Source improves the access speed of file of the actual storage in cold storage server.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.
One of ordinary skill in the art will appreciate that all or part of step in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can be stored in computer read/write memory medium,
The storage medium designated herein obtained, such as:ROM/RAM, magnetic disc, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (8)
1. a kind of file access method, which is characterized in that including:
Receive the access request for file destination;
Determine the initial memory device and initial storage moment T1 of the file destination;Wherein, the initial memory device is heat
Storage server, the initial storage moment be:The storage moment on initial memory device;
According to the initial memory device of the file destination, further determine that has the cold of correspondence with the initial memory device
Storage server;
The vernier moment T2 of the cold storage server is obtained, the vernier moment of the cold storage server is:The cold storage clothes
It is engaged in device, there is the initial storage moment of the file at initial storage moment the latest;
According to the magnitude relationship of T1 and T2, the current storage devices of the file destination are determined;
According to the current storage devices of identified file destination, access to the file destination;
The magnitude relationship according to T1 and T2 determines the current storage devices of the file destination, including:
Judge whether T1 is more than T2;
If it is, determining that the current storage devices of the file destination are:The initial memory device of the file destination;
Otherwise, it determines the current storage devices of the file destination are:Have with the initial memory device where the file destination
There is the cold storage server of correspondence.
2. according to the method described in claim 1, it is characterized in that, the currently stored of file destination determined by the basis is set
It is standby, it accesses to the file destination, including:
In the case where the current storage devices of identified file destination are initial memory device, the file destination is determined
Currently stored path is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the file destination is determined
Currently stored path is:The mark of the cold storage server is replaced to initially depositing in the initial storage path of the file destination
Store up the path of device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage path
In include at least initial memory device identify;During file migration, the bibliographic structure in hot and cold storage server is consistent.
3. according to the method described in claim 1, it is characterized in that, storage mesh of the file destination in initial memory device
It records in title, carries storage time information of the file destination on the initial memory device;
The initial storage moment T1 of the determination file destination, including:
Obtain the initial storage routing information of the file destination;
From the initial storage routing information of the file destination, the storage catalogue title of this document is extracted;
According to preset storage catalogue naming rule, the storage catalogue title extracted is parsed, determines the target text
The initial storage moment T1 of part.
4. according to the method described in claim 3, it is characterized in that, the preset storage catalogue naming rule is according to file
The storage moment, file is stored according to time, month, day part catalogue.
5. a kind of file access device, which is characterized in that including:
Access request receiving module, for receiving the access request for file destination;
First determining module, the initial memory device for determining the file destination and initial storage moment T1;Wherein, described
Initial memory device is hot storage server, and the initial storage moment is:The storage moment on initial memory device;
Second determining module, the initial memory device of the file destination for being determined according to first determining module, into
One step determines the cold storage server for having correspondence with the initial memory device;
Vernier moment acquisition module, the vernier moment T2 for obtaining the cold storage server that second determining module determines,
The vernier moment of the cold storage server is:In the cold storage server, with the first of the file at initial storage moment the latest
Begin the storage moment;
Third determining module determines the current storage devices of the file destination for the magnitude relationship according to T1 and T2;
File access module, for the current storage devices according to file destination determined by the third determining module, to institute
File destination is stated to access;
The third determining module, including:
Judging submodule, for judging whether T1 is more than T2;
First determination sub-module, in the case where the judging result of the judging submodule is to be, determining the target text
The current storage devices of part are:The initial memory device of the file destination;
Second determination sub-module, in the case where the judging result of the judging submodule is no, determining the target text
The current storage devices of part are:There is the cold storage service of correspondence with the initial memory device where the file destination
Device.
6. device according to claim 5, which is characterized in that the file access module is specifically used for:
In the case where the current storage devices of identified file destination are initial memory device, the file destination is determined
Currently stored path is:The initial storage path of the file destination;
In the case where the current storage devices of identified file destination are cold storage server, the file destination is determined
Currently stored path is:The mark of the cold storage server is replaced to initially depositing in the initial storage path of the file destination
Store up the path of device identification;
File destination described in currently stored path access according to identified file destination;
Wherein, the initial storage path is determined according to the access request of the file destination received, the initial storage path
In include at least initial memory device identify;During file migration, the bibliographic structure in hot and cold storage server is consistent.
7. device according to claim 5, which is characterized in that first determining module, including:
Initial storage routing information obtains submodule, for the storage catalogue name in the file destination in initial memory device
In title, the file destination is carried in the case of the storage time information on the initial memory device, obtains the file destination
Initial storage routing information;
Storage catalogue title extracting sub-module, for from the initial storage routing information of the file destination, extracting this document
Storage catalogue title;
Initial storage moment determination sub-module is used for according to preset storage catalogue naming rule, to the storage catalogue extracted
Title is parsed, and determines the initial storage moment T1 of the file destination.
8. device according to claim 7, which is characterized in that the preset storage catalogue naming rule is according to file
The storage moment, file is stored according to time, month, day part catalogue.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410817742.3A CN104462536B (en) | 2014-12-24 | 2014-12-24 | A kind of file access method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410817742.3A CN104462536B (en) | 2014-12-24 | 2014-12-24 | A kind of file access method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104462536A CN104462536A (en) | 2015-03-25 |
CN104462536B true CN104462536B (en) | 2018-08-07 |
Family
ID=52908571
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410817742.3A Active CN104462536B (en) | 2014-12-24 | 2014-12-24 | A kind of file access method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104462536B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5504882A (en) * | 1994-06-20 | 1996-04-02 | International Business Machines Corporation | Fault tolerant data storage subsystem employing hierarchically arranged controllers |
CN101464868A (en) * | 2007-12-17 | 2009-06-24 | 鸿富锦精密工业(深圳)有限公司 | Working performance maintaining system and method for computer high-load operation system |
CN101673192A (en) * | 2009-10-26 | 2010-03-17 | 北京世纪互联宽带数据中心有限公司 | Method for time-sequence data processing, device and system therefor |
CN101741830A (en) * | 2009-11-09 | 2010-06-16 | 深圳市同洲电子股份有限公司 | Method, system, client and server for realizing multi-client data synchronization |
-
2014
- 2014-12-24 CN CN201410817742.3A patent/CN104462536B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5504882A (en) * | 1994-06-20 | 1996-04-02 | International Business Machines Corporation | Fault tolerant data storage subsystem employing hierarchically arranged controllers |
CN101464868A (en) * | 2007-12-17 | 2009-06-24 | 鸿富锦精密工业(深圳)有限公司 | Working performance maintaining system and method for computer high-load operation system |
CN101673192A (en) * | 2009-10-26 | 2010-03-17 | 北京世纪互联宽带数据中心有限公司 | Method for time-sequence data processing, device and system therefor |
CN101741830A (en) * | 2009-11-09 | 2010-06-16 | 深圳市同洲电子股份有限公司 | Method, system, client and server for realizing multi-client data synchronization |
Also Published As
Publication number | Publication date |
---|---|
CN104462536A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107391758B (en) | Database switching method, device and equipment | |
CN103167026B (en) | A kind of cloud store environmental data processing method, system and equipment | |
US8090917B2 (en) | Managing storage and migration of backup data | |
EP3495981B1 (en) | Directory deletion method and device, and storage server | |
EP2378437A1 (en) | Data synchronization methods in communication systems | |
CN108052374A (en) | A kind of method and device of deployment container micro services | |
CN106302829A (en) | A kind of information access method, device and server | |
CN104348859B (en) | File synchronisation method, device, server, terminal and system | |
CN105183389A (en) | Data hierarchical management method and device and electronic equipment | |
US20140358868A1 (en) | Life cycle management of metadata | |
CN110245145A (en) | Structure synchronization method and apparatus of the relevant database to Hadoop database | |
CN106503158A (en) | Method of data synchronization and device | |
CN103701817A (en) | Method and device for generating configuration file | |
CN108156030A (en) | The method and device that a kind of configuration strategy synchronizes | |
CN105930233A (en) | Method and system for automatically backing up data of specified public cloud account | |
CN103986779A (en) | Application data transmission method, device and terminal equipment | |
CN105005517B (en) | The storage and backup system and method for call center's recording file | |
CN102708166B (en) | Data replication method, data recovery method and data recovery device | |
CN104636218B (en) | Data reconstruction method and device | |
US11210212B2 (en) | Conflict resolution and garbage collection in distributed databases | |
CN109471901A (en) | A kind of method of data synchronization and device | |
CN106919574B (en) | Method for processing remote synchronous file in real time | |
CN104462536B (en) | A kind of file access method and device | |
CN106484312A (en) | A kind of magnetic disk of virtual machine data migration method and device | |
CN104407987B (en) | A kind of classification storage method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |