CN106293993A - Avoid the method and device repeating to process file - Google Patents
Avoid the method and device repeating to process file Download PDFInfo
- Publication number
- CN106293993A CN106293993A CN201510244008.7A CN201510244008A CN106293993A CN 106293993 A CN106293993 A CN 106293993A CN 201510244008 A CN201510244008 A CN 201510244008A CN 106293993 A CN106293993 A CN 106293993A
- Authority
- CN
- China
- Prior art keywords
- file
- processed
- file destination
- destination
- catalogue
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention provides a kind of method and device avoided and repeat to process file.The method includes: judge under target directory, whether the file destination of storage is processed file, and backup directory storage has processed file according to backup directory;If file destination is processed file, the most do not process file destination;If file destination is not processed file, then process file destination.The embodiment of the present invention stores the most processed file by backup directory; before file destination is processed; first judge that this file destination is whether in backup directory; if in backup directory; the most do not process this file destination; if not in backup directory; then process this file destination; effectively prevent and repeat identical file to process, compared to prior art, it is not necessary to set up data base; avoid frequently accessing connection exception or the failure that data base causes; in addition, it is not necessary that delete the most processed file, increase range of application.
Description
Technical field
The present embodiments relate to field of software development, particularly relate to a kind of side avoiding and repeating to process file
Method and device.
Background technology
In software development process, needing to process the file under catalogue, the file under this catalogue can
Interface document between Neng Shi our company different system, it is also possible to software or artificial output result, has
Time only need to process the file of not processed mistake under this catalogue without processing the most processed file.
In order to avoid the file under catalogue repeats process, prior art provides two kinds of methods: 1)
In data base, set up task list, in task list, set up a record for each file, record this article
The process state of part, knows the process state of pending file by accessing data base, if pending literary composition
The not processed mistake of part, then process this pending file, if pending file is the most processed, the most not
Pending file is processed.2) the most processed file is deleted, it is ensured that the file under this catalogue
The most not processed mistake.
For method 1), owing to the file under this catalogue is in real-time change, frequently accessing data base will cause
Connect abnormal or failure;For method 2), if the file under this catalogue has other purposes, then will after deleting
Cause other lost usefulnesses of this document, cause bigger application limitation.
Summary of the invention
The embodiment of the present invention provides a kind of method and device avoiding repeating processing file, different to avoid connecting
Normal or failed, improve range of application.
One aspect of the embodiment of the present invention is to provide a kind of method avoided and repeat to process file, including:
Judge under target directory, whether the file destination of storage is processed file according to backup directory, described
Backup directory storage has processed file;
If described file destination is processed file, the most do not process described file destination;
If described file destination is not processed file, then process described file destination.
Another aspect of the embodiment of the present invention is to provide a kind of device avoided and repeat to process file, including:
According to backup directory, judge module, for judging under target directory, whether the file destination of storage is
Processing file, described backup directory storage has processed file;
Processing module, if being processed file for described file destination, does not the most process described file destination;
If described file destination is not processed file, then process described file destination.
What the embodiment of the present invention provided avoids repeating the method and device of process file, is deposited by backup directory
Store up the most processed file, before file destination is processed, first judge that this file destination is
No in backup directory, if in backup directory, the most do not process this file destination, if not at backup directory
In, then process this file destination, effectively prevent and repeat identical file to process, compared to existing skill
Art, it is not necessary to set up data base, it is to avoid the connection that frequently access data base causes is abnormal or failed, it addition,
Need not delete the most processed file, increase range of application.
Accompanying drawing explanation
The method flow diagram avoiding repeating to process file that Fig. 1 provides for the embodiment of the present invention;
The method flow diagram avoiding repeating to process file that Fig. 2 provides for another embodiment of the present invention;
The structure chart avoiding repeating to process the device of file that Fig. 3 provides for the embodiment of the present invention;
The structure chart avoiding repeating to process the device of file that Fig. 4 provides for another embodiment of the present invention.
Detailed description of the invention
The method flow diagram avoiding repeating to process file that Fig. 1 provides for the embodiment of the present invention.The present invention is real
Execute example in order to avoid repeating the file under catalogue to process, it is provided that avoid the side repeating to process file
Method, the method specifically comprises the following steps that
Step S101, foundation backup directory judge under target directory, whether the file destination of storage is processed
File, described backup directory storage has processed file;
Under target directory, storage has multiple file, stores in backup directory by processed file, by
The file under target directory quantity of documents under real-time change, specially target directory increases in real time.
Such as, under target directory, storage has 10 files, and these 10 files are the most processed, then by these 10
File stores under backup directory, after target directory newly increases 90 files, and 90 newly increased
File and former 10 files are stored concurrently in this target directory, and this target directory currently coexists and contains 100
Individual file, when processing 100 files, needs to travel through this 100 files, by each file
As file destination, it is judged that whether each file destination is stored in backup directory, if the storage of this file destination
In backup directory, then this file destination is processed file, if not this file destination in backup directory,
Then this file destination is newly-increased file.
If the described file destination of step S102 is processed file, the most do not process described file destination;
In order to avoid repeating to process file, do not carry out any process when file destination is processed file and grasp
Make, continue to judge next file destination.
If the described file destination of step S103 is not processed file, then process described file destination.
When file destination is not processed file, when being newly-increased file, this file destination is processed
Operation.
The embodiment of the present invention stores the most processed file by backup directory, is entering file destination
Row process before, first judge this file destination whether in backup directory, if in backup directory, the most not
Process this file destination, if not in backup directory, then process this file destination, effectively prevent same
One file repeat process, compared to prior art, it is not necessary to set up data base, it is to avoid frequently access number
The connection caused according to storehouse is abnormal or failed, in addition, it is not necessary that delete the most processed file, increases
Range of application.
The method flow diagram avoiding repeating to process file that Fig. 2 provides for another embodiment of the present invention.Upper
On the basis of stating embodiment, described judge that the file destination that stores under target directory is whether according to backup directory
Include for processed file: judge whether described backup directory stores and the file of described file destination
The file that name is identical, if existing, the most described file destination is processed file, if not existing, then described
File destination is not processed file.
When judging under target directory, whether the file destination of storage is processed file according to backup directory, tool
Body can by judging whether backup directory stores the file identical with the filename of described file destination,
If existing, then illustrating that this file destination is processed file, if not existing, then this file destination being described not
It it is processed file.
Described backup directory includes processing successful catalogue and processing unsuccessfully catalogue, and described process success catalogue is deposited
Containing the successful processed file of process, described process failure catalogue storage has the processed literary composition processed unsuccessfully
Part;If described file destination is not processed file, then, after processing described file destination, also wrap
Include: if processing the success of described file destination, then successfully create under catalogue and described target is civilian described process
The processed file that the filename of part is identical;If processing the failure of described file destination, then lose described process
Lose the processed file that under catalogue, establishment is identical with the filename of described file destination;Wherein, described locate
The size of reason file is 0 byte.
The embodiment of the present invention is preferred, backup directory is divided into processes successfully catalogue with process unsuccessfully catalogue,
Such as when 10 files original in target directory being processed, if the process operation to file performs into
Merit, then store this document and process successfully catalogue, be specially processes successfully under catalogue establishment one and
The file that the filename of this document is identical;If the process operation to file performs failure, then this document is deposited
Storage to processing unsuccessfully catalogue, is specially processing unsuccessfully establishment one and the file famous prime minister of this document under catalogue
Same file.
After target directory newly increases 90 files, judge file destination according to the method for above-described embodiment
When being not processed file, this file destination execution is processed operation, if processing the success of described file destination,
Then create the processed file identical with the filename of described file destination under successful catalogue described process,
And the size of processed file is 0 byte;If processing the failure of described file destination, then lose described process
Lose the processed file that under catalogue, establishment is identical with the filename of described file destination, and processed file
Size is 0 byte.
As in figure 2 it is shown, its concrete steps of method avoiding repeating to process file that the embodiment of the present invention provides
As follows:
File destination in step S201, traversal target directory;
Step S202, judge to process whether successfully catalogue and processing unsuccessfully exists and this file destination under catalogue
File of the same name, if being carried out step S203, otherwise performs step S204;
Step S203, file destination is not performed process operation;
Step S204, to file destination execution process operation.
The embodiment of the present invention processes successfully catalogue and process unsuccessfully catalogue by being divided into by backup directory, and
Process successfully catalogue or process and unsuccessfully create and file size identical with the filename of file destination under catalogue and be
The processed file of 0 byte, saves memory space while making a distinction processed file.
On the basis of above-described embodiment, also include: empty described backup directory, to described target directory
All file destinations of lower storage re-start process.
Such as, under target directory, current 100 files are the most processed completes, and also optional execution is grasped as follows
Make: owning under emptying described backup directory, specially delete processing success catalogue and processing failed catalogue
100 files current under target directory are re-started process by file successively.
Described process includes: resolves described file destination, and is stored in and business system by described file destination
The data base that system is relevant.
The embodiment of the present invention by emptying backup directory, and under target directory storage all file destinations
Re-start process, improve the reliability to file process and motility.
The structure chart avoiding repeating to process the device of file that Fig. 3 provides for the embodiment of the present invention.The present invention
The method that the device avoiding repeating to process file of embodiment offer can perform to avoid repeating to process file is real
Execute the handling process that example provides, as shown in Figure 3, it is to avoid the device 30 repeating to process file includes judging mould
Block 31 and processing module 32, wherein, it is judged that module 31 is for judging under target directory according to backup directory
Whether the file destination of storage is processed file, and described backup directory storage has processed file;Process
If module 32 is processed file for described file destination, the most do not process described file destination;If it is described
File destination is not processed file, then process described file destination.
The embodiment of the present invention stores the most processed file by backup directory, is entering file destination
Row process before, first judge this file destination whether in backup directory, if in backup directory, the most not
Process this file destination, if not in backup directory, then process this file destination, effectively prevent same
One file repeat process, compared to prior art, it is not necessary to set up data base, it is to avoid frequently access number
The connection caused according to storehouse is abnormal or failed, in addition, it is not necessary that delete the most processed file, increases
Range of application.
The structure chart avoiding repeating to process the device of file that Fig. 4 provides for another embodiment of the present invention.?
On the basis of above-described embodiment, it is judged that whether module 31 is specifically for judging to have stored in described backup directory
The file identical with the filename of described file destination, if existing, the most described file destination is processed literary composition
Part, if not existing, the most described file destination is not processed file.
Described backup directory includes processing successful catalogue and processing unsuccessfully catalogue, and described process success catalogue is deposited
Containing the successful processed file of process, described process failure catalogue storage has the processed literary composition processed unsuccessfully
Part;The device 30 repeating to process file is avoided also to include file creation module 33, file creation module 33
If for processing the success of described file destination, then successfully create under catalogue and described target is civilian described process
The processed file that the filename of part is identical;If processing the failure of described file destination, then lose described process
Lose the processed file that under catalogue, establishment is identical with the filename of described file destination;Wherein, described locate
The size of reason file is 0 byte.
Avoid the device 30 repeating to process file also to include emptying module 34, empty module 34 for emptying
Described backup directory;Processing module 32 is additionally operable to all file destination weights of storage under described target directory
Newly process.
Described process includes: resolves described file destination, and is stored in and business system by described file destination
The data base that system is relevant.
The device avoiding repeating to process file of embodiment of the present invention offer can be specifically for performing above-mentioned figure
1 embodiment of the method provided, here is omitted for concrete function.
The embodiment of the present invention processes successfully catalogue and process unsuccessfully catalogue by being divided into by backup directory, and
Process successfully catalogue or process and unsuccessfully create and file size identical with the filename of file destination under catalogue and be
The processed file of 0 byte, saves memory space while making a distinction processed file;Logical
Cross and empty backup directory, and all file destinations of storage under target directory are re-started process, improve
Reliability and motility to file process.
In sum, the embodiment of the present invention stores the most processed file by backup directory, right
Before file destination processes, first judge this file destination whether in backup directory, if backup mesh
In record, the most do not process this file destination, if not in backup directory, then process this file destination, effectively
Avoid and repeat identical file to process, compared to prior art, it is not necessary to set up data base, it is to avoid
The connection that frequently access data base causes is abnormal or failed, in addition, it is not necessary that delete the most processed
File, increases range of application;Successfully catalogue and process unsuccessfully catalogue is processed by being divided into by backup directory,
And processing successfully catalogue or process and unsuccessfully create under catalogue identical with the filename of file destination and file is big
Little is the processed file of 0 byte, saves memory space while making a distinction processed file;
By emptying backup directory, and all file destinations of storage under target directory are re-started process, carry
The high reliability to file process and motility.
In several embodiments provided by the present invention, it should be understood that disclosed apparatus and method,
Can realize by another way.Such as, device embodiment described above is only schematically,
Such as, the division of described unit, it is only a kind of logic function and divides, actual can have additionally when realizing
Dividing mode, the most multiple unit or assembly can in conjunction with or be desirably integrated into another system, or
Some features can be ignored, or does not performs.Another point, shown or discussed coupling each other or
Direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, device or unit or communication link
Connect, can be electrical, machinery or other form.
The described unit illustrated as separating component can be or may not be physically separate, makees
The parts shown for unit can be or may not be physical location, i.e. may be located at a place,
Or can also be distributed on multiple NE.Can select according to the actual needs part therein or
The whole unit of person realizes the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit,
Can also be that unit is individually physically present, it is also possible to two or more unit are integrated in a list
In unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ hardware adds software
The form of functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer
In read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, including some fingers
Make with so that a computer equipment (can be personal computer, server, or the network equipment etc.)
Or processor (processor) performs the part steps of method described in each embodiment of the present invention.And it is aforementioned
Storage medium include: USB flash disk, portable hard drive, read only memory (Read-Only Memory, ROM),
Random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various permissible
The medium of storage program code.
Those skilled in the art are it can be understood that arrive, for convenience and simplicity of description, only with above-mentioned respectively
The division of functional module is illustrated, and in actual application, can above-mentioned functions be divided as desired
Join and completed by different functional modules, the internal structure of device will be divided into different functional modules, with
Complete all or part of function described above.The specific works process of the device of foregoing description is permissible
With reference to the corresponding process in preceding method embodiment, do not repeat them here.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, rather than right
It limits;Although the present invention being described in detail with reference to foregoing embodiments, this area common
Skilled artisans appreciate that the technical scheme described in foregoing embodiments still can be modified by it,
Or the most some or all of technical characteristic is carried out equivalent;And these amendments or replacement, and
The essence not making appropriate technical solution departs from the scope of various embodiments of the present invention technical scheme.
Claims (10)
1. the method avoiding repeating to process file, it is characterised in that including:
Judge under target directory, whether the file destination of storage is processed file according to backup directory, described
Backup directory storage has processed file;
If described file destination is processed file, the most do not process described file destination;
If described file destination is not processed file, then process described file destination.
Method the most according to claim 1, it is characterised in that described foundation backup directory judges mesh
Whether the file destination of the lower storage of heading record is processed file, including:
Judge whether described backup directory stores the file identical with the filename of described file destination,
If existing, the most described file destination is processed file, if not existing, the most described file destination is not
Process file.
Method the most according to claim 2, it is characterised in that described backup directory includes being processed into
Merit catalogue and processes unsuccessfully catalogue, described process success catalogue storage has and processes successful processed file,
Described process unsuccessfully catalogue storage and have the processed file processed unsuccessfully;
If described file destination is not processed file, then, after processing described file destination, also wrap
Include:
If processing the success of described file destination, then successfully create under catalogue and described target is civilian described process
The processed file that the filename of part is identical;
If processing the failure of described file destination, then unsuccessfully create under catalogue and described target is civilian described process
The processed file that the filename of part is identical;
Wherein, the size of described processed file is 0 byte.
Method the most according to claim 3, it is characterised in that also include:
Empty described backup directory, all file destinations of storage under described target directory are re-started place
Reason.
5. according to the method described in any one of claim 1-4, it is characterised in that described process includes:
Resolve described file destination, and described file destination is stored in the data base relevant to operation system.
6. avoid the device repeating to process file for one kind, it is characterised in that including:
According to backup directory, judge module, for judging under target directory, whether the file destination of storage is
Processing file, described backup directory storage has processed file;
Processing module, if being processed file for described file destination, does not the most process described file destination;
If described file destination is not processed file, then process described file destination.
The device avoiding repeating to process file the most according to claim 6, it is characterised in that described
Whether judge module is specifically for judging to store in described backup directory and the filename of described file destination
Identical file, if existing, the most described file destination is processed file, if not existing, the most described mesh
Mark file is not processed file.
The device avoiding repeating to process file the most according to claim 7, it is characterised in that described
Backup directory includes processing successful catalogue and processing unsuccessfully catalogue, and described process success catalogue storage has process
Successful processed file, described process failure catalogue storage has the processed file processed unsuccessfully;
The described device avoiding repeating process file also includes:
File creation module, if for processing the success of described file destination, then processing successfully catalogue described
The processed file that lower establishment is identical with the filename of described file destination;
If processing the failure of described file destination, then unsuccessfully create under catalogue and described target is civilian described process
The processed file that the filename of part is identical;
Wherein, the size of described processed file is 0 byte.
The device avoiding repeating to process file the most according to claim 8, it is characterised in that also wrap
Include:
Empty module, be used for emptying described backup directory;
Described processing module is additionally operable to all file destinations of storage under described target directory are re-started place
Reason.
10. repeat to process the device of file, its feature according to avoiding described in any one of claim 6-9
Being, described process includes: resolves described file destination, and is stored in and business by described file destination
The data base that system is relevant.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510244008.7A CN106293993A (en) | 2015-05-13 | 2015-05-13 | Avoid the method and device repeating to process file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510244008.7A CN106293993A (en) | 2015-05-13 | 2015-05-13 | Avoid the method and device repeating to process file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106293993A true CN106293993A (en) | 2017-01-04 |
Family
ID=57630983
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510244008.7A Pending CN106293993A (en) | 2015-05-13 | 2015-05-13 | Avoid the method and device repeating to process file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106293993A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108345664A (en) * | 2018-02-02 | 2018-07-31 | 网易(杭州)网络有限公司 | A kind of method of file synchronization, medium, system and electronic equipment |
CN112347052A (en) * | 2020-11-04 | 2021-02-09 | 深圳集智数字科技有限公司 | File matching method and related device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101833489A (en) * | 2010-05-06 | 2010-09-15 | 北京邮电大学 | Method for file real-time monitoring and intelligent backup |
US20120233172A1 (en) * | 2011-03-07 | 2012-09-13 | Aptare, Inc. | System to catalog and search point-in-time instances of a file system |
CN103713972A (en) * | 2014-01-02 | 2014-04-09 | 浪潮(北京)电子信息产业有限公司 | Incremental backup system and method |
CN104503864A (en) * | 2014-11-20 | 2015-04-08 | 北京世纪高蓝科技有限公司 | Method and device for file backup based on local area network |
-
2015
- 2015-05-13 CN CN201510244008.7A patent/CN106293993A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101833489A (en) * | 2010-05-06 | 2010-09-15 | 北京邮电大学 | Method for file real-time monitoring and intelligent backup |
US20120233172A1 (en) * | 2011-03-07 | 2012-09-13 | Aptare, Inc. | System to catalog and search point-in-time instances of a file system |
CN103713972A (en) * | 2014-01-02 | 2014-04-09 | 浪潮(北京)电子信息产业有限公司 | Incremental backup system and method |
CN104503864A (en) * | 2014-11-20 | 2015-04-08 | 北京世纪高蓝科技有限公司 | Method and device for file backup based on local area network |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108345664A (en) * | 2018-02-02 | 2018-07-31 | 网易(杭州)网络有限公司 | A kind of method of file synchronization, medium, system and electronic equipment |
CN112347052A (en) * | 2020-11-04 | 2021-02-09 | 深圳集智数字科技有限公司 | File matching method and related device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10776396B2 (en) | Computer implemented method for dynamic sharding | |
CN102707990B (en) | Container based processing method and device | |
US7685459B1 (en) | Parallel backup | |
US20100312749A1 (en) | Scalable lookup service for distributed database | |
CN103248711A (en) | File uploading method and server | |
US8140537B2 (en) | Block level tagging with file level information | |
CN103984641B (en) | A kind of memory space recovery method and its device based on simplify configuration technology | |
CN103473277A (en) | Snapshot method and device for file systems | |
CN105653630A (en) | Data migration method and apparatus for distributed database | |
US20170083406A1 (en) | Method and apparatus for incremental backup | |
CN107423301B (en) | Data processing method, related equipment and storage system | |
CN103246549B (en) | A kind of method and system of data conversion storage | |
CN103678337A (en) | Data eliminating method, device and system | |
CN105528454A (en) | Log treatment method and distributed cluster computing device | |
CN113568566A (en) | Method, host device and storage server for seamless migration of simple storage service by using index object | |
US10223205B2 (en) | Disaster recovery data sync | |
CN105656970A (en) | RAID (Redundant Array of Independent Disk) card configuring method and system and relevant device | |
US11231859B2 (en) | Providing a RAID resiliency set from a plurality of storage devices | |
CN105279020A (en) | Task scheduling method and system | |
CN104915462A (en) | File management method and system | |
CN106293993A (en) | Avoid the method and device repeating to process file | |
CN104517067A (en) | Method, device and system for data access | |
CN107818113B (en) | Method and device for determining file access position | |
CN106293509A (en) | Date storage method and system | |
CN106682199B (en) | Method and device for realizing automatic expansion of Mongos cluster |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170104 |