The content of the invention
Technical problems to be solved in this application are to provide a kind of incremental data acquisition method and device, existing to solve
Need by hand to carry out incremental data duplication acquisition in technology, thus the flow that increase incremental data is obtained reduces incremental data
The technical problem of the efficiency of acquisition, meanwhile, solve in the prior art, it is necessary to carry out duplication acquisition, appearance to incremental data by hand
Technical problem that is error-prone, causing the accuracy rate of incremental data acquisition relatively low.
This application provides a kind of incremental data acquisition method, including:
According to default source file path and increment relative path, increment destination path is generated;
According to the increment destination path, incremental data is obtained;
The incremental data is placed in the corresponding position of default destination path.
The above method, it is preferred that described according to default source file path and increment relative path, generation increment target road
Footpath, including:
Judge the path type of the increment relative path;
When the increment relative path is folder path type, the sub-folder under the increment relative path is obtained
Relative path and subfile relative path, by default source file path respectively with the sub-folder relative path and subfile
Relative path carries out combination of paths, obtains increment destination path;
Otherwise, default source file path and the increment relative path are subjected to combination of paths, obtain increment target road
Footpath.
The above method, it is preferred that described according to the increment destination path, obtains incremental data, including:
Determine the delta file under the increment destination path;
With default dos command copy mode, incremental data is obtained according to the delta file.
The above method, it is preferred that described with default dos command copy mode, increment is obtained according to the delta file
Data, including:
Whether the type for judging the delta file is Java file types, if it is, the delta file is compiled
Translate, obtain increment class file, with default dos command copy mode, obtain the increment class file as incremental data, it is no
Then, with default dos command copy mode, obtain the delta file and be used as incremental data.
The above method, it is preferred that when the type of the delta file is Java file types, methods described also includes:
According to default source file operational order, the corresponding source file of the delta file is obtained, the source file is put
In the corresponding position of default destination path.
Present invention also provides a kind of incremental data acquisition device, including:
Coordinates measurement unit, for according to default source file path and increment relative path, generating increment destination path;
Data capture unit, for according to the increment destination path, obtaining incremental data;
Data setting unit, for the incremental data to be placed in the corresponding position of default destination path.
Said apparatus, it is preferred that the coordinates measurement unit includes:
Type judgment sub-unit, the path type for judging the increment relative path, in the increment relative path
During for folder path, otherwise triggering first path combination subelement, triggers the second combination of paths subelement;
First path combines subelement, for obtaining sub-folder relative path and Ziwen under the increment relative path
Part relative path, walking along the street is entered by default source file path with the sub-folder relative path and subfile relative path respectively
Footpath is combined, and obtains increment destination path;
Second combination of paths subelement, for default source file path and the increment relative path to be carried out into group of paths
Close, obtain increment destination path.
Said apparatus, it is preferred that the data capture unit includes:
Increment determination subelement, for determining the delta file under the increment destination path;
Increment obtains subelement, for default dos command copy mode, incremental number to be obtained according to the delta file
According to.
Said apparatus, it is preferred that the increment, which obtains subelement, to be included:
File type judge module, for judging whether the type of the delta file is Java file types, if it is,
The first increment acquisition module is triggered, otherwise, the second increment acquisition module is triggered;
First increment acquisition module, for the delta file to be compiled, obtains increment class file, with default
Dos command copy mode, obtains the increment class file and is used as incremental data;
Second increment acquisition module, increment is used as default dos command copy mode, obtaining the delta file
Data.
Said apparatus, it is preferred that also include:
Source file processing unit, for judging that the type of the delta file is in the file type judge module
During Java file types, according to default source file operational order, the corresponding source file of the delta file is obtained, by the source
File is placed in the corresponding position of default destination path.
A kind of incremental data acquisition method and device provided from such scheme, the application, by using default
After source file path and increment relative path generation increment destination path, incremental number is got according to the increment destination path
According to, and then the incremental data is placed in the corresponding position of default destination path, realize the acquisition to incremental data.The application
When realizing that incremental data is obtained, user is only needed to pre-set source file path, increment relative path and destination path, this
Application is realized using these paths and the corresponding incremental data in these paths is obtained, and thus puts the incremental data got
In destination path correspondence position, the project of incremental update, which carries out incremental data and replicates acquisition, to be treated to any one without user,
Thus the flow for obtaining incremental data is not only reduced, the acquisition efficiency of incremental data is improved, while reducing the manually operated band of user
The mistake come, improves the accuracy rate of incremental data.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only some embodiments of the present application, rather than whole embodiments.It is based on
Embodiment in the application, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of the application protection.
With reference to Fig. 1, a kind of flow chart of the incremental data acquisition method embodiment one provided for the application, methods described should
For being obtained to the data that updating occurs in software project file such as operating system etc., wherein, methods described can include with
Lower step:
Step 101:According to default source file path and increment relative path, increment destination path is generated.
Wherein, the default source file path refers to path where software project file, such as C:\project.The software
Item file includes multiple files and file, and these files and file exist with tree.The increment is with respect to road
Footpath refers to need to carry out incremental data acquisition(Packing)File or folder where relative path, such as .. 11
SS.java, the path is the relative path for needing to carry out the file SS.java of incremental data acquisition.Wherein, the increment phase
Path can be configured by configuration file, that is to say, that the increment relative path is configured in a file in advance, example
Such as, it would be desirable to carry out the file path information configuration of incremental data acquisition into files.txt, the files.txt is configuration
File.
It should be noted that can be by by the source file path and the increment relative path in the step 101
The mode of combination of paths is carried out, increment destination path is obtained.For example, by source file path C:Project and increment with respect to road
Footpath .. 11 SS.java carry out combination of paths, obtain path such as:C:Project 11 SS.java, the path is institute
Increment destination path is stated, the increment destination path is to need to carry out the absolute road where the file destination of incremental data acquisition
Footpath.
Step 102:According to the increment destination path, incremental data is obtained.
Wherein, in the step 102, because the increment destination path is to need to carry out the target text of incremental data acquisition
Absolute path where part, thus, can navigate to the file destination by the increment destination path, thus obtain incremental number
According to.
Step 103:The incremental data is placed in the corresponding position of default destination path.
Wherein, the default destination path refers to the path placed required for incremental data, that is to say, that getting increasing
Measure after data, store the path of the incremental data.The corresponding position of the default destination path can be the default mesh
Path under in file under position or the path.
A kind of incremental data acquisition method embodiment one provided from such scheme, the application, by using default
Source file path and increment relative path generation increment destination path after, get incremental number according to the increment destination path
According to, and then the incremental data is placed in the corresponding position of default destination path, realize the acquisition to incremental data.The application
Embodiment one only needs user to pre-set source file path, increment relative path and purpose road when realizing that incremental data is obtained
Footpath, the embodiment of the present application one is realized using these paths and the corresponding incremental data in these paths is obtained, and thus will
The incremental data got is placed in destination path correspondence position, treats that the project of incremental update is carried out to any one without user
Incremental data, which is replicated, to be obtained, and is thus not only reduced the flow for obtaining incremental data, is improved the acquisition efficiency of incremental data, subtract simultaneously
The manually operated mistake brought of few user, improves the accuracy rate of incremental data.
In addition, the embodiment of the present application passes through to multiple source file paths, its correspondence increment relative path and default purpose road
Footpath is configured, and then can realize to the acquisition of the batch incremental datas of multiple source files, it is to avoid user enters to data repeatedly
Row replicates the situation for obtaining reduction operating efficiency, improves the efficiency of batch incremental data acquisition.
With reference to Fig. 2, the flow of step 101 described in a kind of incremental data acquisition method embodiment two provided for the application
Figure, wherein, the step 101 can be realized by following steps:
Step 111:Judge the path type of the increment relative path, be folder path in the increment relative path
During type, step 112 is performed, otherwise, step 114 is performed.
Wherein, the path type of the increment relative path can be folder path type, or file path
Type, for example, increment relative path .. 11 SS.java be file path type, increment relative path .. 11 22
For folder path type.
Step 112:The sub-folder relative path and subfile relative path under the increment relative path are obtained, is performed
Step 113.
Wherein, refer in the step 112, it is relative to the increment when the increment relative path is folder path
The corresponding file in path carries out recursive operation, all sub-folders and subfile under this document folder is traversed, thus, to this
A little file and the corresponding relative path of subfile are obtained, for example, increment relative path .. 11 22 it is corresponding
Sub-folder relative path and subfile relative path are:.. 11 22 33 grades and .. 11 22 SS.java etc..
Step 113:By default source file path respectively with the sub-folder relative path and subfile relative path
Combination of paths is carried out, increment destination path is obtained.
Wherein, in the step 113, the source file path and the sub-folder relative path are subjected to combination of paths
When, the corresponding increment destination path of the sub-folder relative path is obtained, the source file path is relative with the subfile
When path carries out combination of paths, the corresponding increment destination path of the subfile relative path is obtained.For example:By source file path
C:Project and increment relative path .. 11 22 33 be combined, obtain path C:\project\\11\\22\\33
For the corresponding increment destination path of the sub-folder relative path;By source file path C:Project and increment with respect to road
Footpath .. 11 22 SS.java carry out combination of paths, obtain path such as:C:\project\\11\\22\\SS.java.
Step 114:Default source file path and the increment relative path are subjected to combination of paths, increment target is obtained
Path.
Wherein, refer in the step 114, when the increment relative path is file path, by the source file road
Footpath and the increment relative path carry out combination of paths, obtain increment destination path, for example, by source file path C:\project
And increment relative path .. 11 SS.java carry out combination of paths, obtain increment destination path such as:C:\project\\11\\
SS.java。
With reference to Fig. 3, the flow of step 102 described in a kind of incremental data acquisition method embodiment three provided for the application
Figure, wherein, the step 102 can be accomplished by the following way:
Step 121:Determine the delta file under the increment destination path.
Wherein, refer in the step 121, the file under the increment destination path is defined as to need to carry out incremental number
According to the delta file of acquisition.
Step 122:With default dos command copy mode, incremental data is obtained according to the delta file.
Wherein, the dos command copy mode refers to, line number can be entered to the delta file by what user pre-set
According to the order copy mode of the operations such as duplication, such as Ctrl+C modes.This mode will not change quilt when carrying out data duplication
The modification date of file is replicated, is service where follow-up determination software project thus, it is possible to ensure the accurate of file modified date
Whether the file in device updates offer foundation, to determine that FileVersion provides foundation etc..
Based on the implementation of above-mentioned steps 102, incremental data is obtained according to the delta file in the step 122
When, incremental data can be obtained by different way when delta file type is different by judging the type of delta file, such as scheme
It is the implementation process figure of the step 122 shown in 4, the step 122 may comprise steps of:
Step 401:Whether the type for judging the delta file is Java file types, if it is, step 402 is performed,
Otherwise, step 404 is performed.
Step 402:The delta file is compiled, increment class file is obtained, step 403 is performed.
Wherein, the step 402 refers to, when the delta file is java class files, it is necessary to by the java class files
It is compiled, obtains class class files and its inner classes class files as increment class file.
Step 403:With default dos command copy mode, obtain the increment class file and be used as incremental data.
Specifically, the step 403 can be accomplished by the following way:
The increment class file is replicated with default dos command copy mode, the increment class file that may be copied to is as increasing
Amount data are obtained.
Step 404:With default dos command copy mode, obtain the delta file and be used as incremental data.
It should be noted that because the delta file may be that java class files can also be non-java class files, by
This, scheme is performed before in the embodiment of the present application, and user can pre-set a source file operational order, to decide whether
Duplication operation is carried out to the corresponding source file of delta file of java class files.Therefore, it is the embodiment of the present application three with reference to Fig. 5
Partial process view, wherein, judge in the step 401 delta file for java class files i.e. the delta file belong to
When Java file types, methods described can also include:
Step 405:According to default source file operational order, the corresponding source file of the delta file is obtained, will be described
Source file is placed in the corresponding position of default destination path.
Wherein, the step 405 refers to, the corresponding source file of incremental data is carried out into acquisition is placed in default destination path
In correspondence position, during ensureing that version problem occurs in file in subsequent server, can trace back to be prestored to this preset
Source file old version in destination path correspondence position.
For example, the embodiment of the present application can be realized by performing class, the execution class pre-sets source file path, default mesh
If path, copy mode such as dos command copy mode and delta file be java class files when whether carry out answering for source file
The information such as system, and increment relative path is set in configuration file, for example:
listedFilesPath:″D:\\MyEclipse6.6\\workspace\\test\\src\\construct\\
files.txt″;// Profile Path
srcPath:″D:\\MyEclipse6.6\\workspace\\Sotower\\″;// source file path
tarpath:″D:\\lddy\\″;// preset destination path
copyMode:″2″;// copy mode, 1 is java, and 2 be dos
isCopySrc=″1″.// source file whether is replicated, 1 is to replicate
Increment relative path is set in configuration file files.txt:
WebContent\reportFiles\lddy\LDDY_H12_C.raq;// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_C.raq files
WebContent\reportFiles\lddy\LDDY_H12_1.raq;// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_1.raq files
WebContent\reportFiles\lddy\LDDY_H12_2.raq.// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_1.raq files
Afterwards, above-mentioned execution class is performed, is realized to the acquisition of incremental data in the source file path and in the increment
Acquisition to its source file when the corresponding delta file of data is java class files, afterwards in the corresponding file of default destination path
Folder is lower it can be seen that the incremental data got, realizes the embodiment of the present application purpose.
With reference to Fig. 6, a kind of structural representation of the incremental data acquisition device example IV provided for the application, the dress
Put and be applied to obtain the data that updating occurs in software project file such as operating system etc., wherein, described device can be wrapped
Include:
Coordinates measurement unit 601, for according to default source file path and increment relative path, generation increment target road
Footpath.
Wherein, the default source file path refers to path where software project file, such as C:\project.The software
Item file includes multiple files and file, and these files and file exist with tree.The increment is with respect to road
Footpath refers to need to carry out incremental data acquisition(Packing)File or folder where relative path, such as .. 11
SS.java, the path is the relative path for needing to carry out the file SS.java of incremental data acquisition.Wherein, the increment phase
Path can be configured by configuration file, that is to say, that the increment relative path is configured in a file in advance, example
Such as, it would be desirable to carry out the file path information configuration of incremental data acquisition into files.txt, the files.txt is configuration
File.
It should be noted that the coordinates measurement unit 601 can be by by the source file path and the increment phase
The mode of combination of paths is carried out to path, increment destination path is obtained.For example, by source file path C:Project and increment phase
Combination of paths is carried out to the SS.java of path .. 11, path is obtained such as:C:Project 11 SS.java, the path is
For the increment destination path, the increment destination path be need to carry out it is exhausted where the file destination of incremental data acquisition
To path.
Data capture unit 602, for according to the increment destination path, obtaining incremental data.
Wherein, in the data capture unit 602, because the increment destination path is to need to carry out incremental data acquisition
File destination where absolute path, thus, the file destination can be navigated to by the increment destination path, thus obtained
Incremental data.
Data setting unit 603, for the incremental data to be placed in the corresponding position of default destination path.
Wherein, the default destination path refers to the path placed required for incremental data, that is to say, that getting increasing
Measure after data, store the path of the incremental data.The corresponding position of the default destination path can be the default mesh
Path under in file under position or the path.
A kind of incremental data acquisition device example IV provided from such scheme, the application, by using default
Source file path and increment relative path generation increment destination path after, get incremental number according to the increment destination path
According to, and then the incremental data is placed in the corresponding position of default destination path, realize the acquisition to incremental data.The application
Example IV only needs user to pre-set source file path, increment relative path and purpose road when realizing that incremental data is obtained
Footpath, the embodiment of the present application four is realized using these paths and the corresponding incremental data in these paths is obtained, and thus will
The incremental data got is placed in destination path correspondence position, treats that the project of incremental update is carried out to any one without user
Incremental data, which is replicated, to be obtained, and is thus not only reduced the flow for obtaining incremental data, is improved the acquisition efficiency of incremental data, subtract simultaneously
The manually operated mistake brought of few user, improves the accuracy rate of incremental data.
In addition, the embodiment of the present application passes through to multiple source file paths, its correspondence increment relative path and default purpose road
Footpath is configured, and then can realize to the acquisition of the batch incremental datas of multiple source files, it is to avoid user enters to data repeatedly
Row replicates the situation for obtaining reduction operating efficiency, improves the efficiency of batch incremental data acquisition.
With reference to Fig. 7, coordinates measurement unit described in a kind of incremental data acquisition device embodiment five provided for the application
601 structural representation, wherein, the coordinates measurement unit 601 can include:
Type judgment sub-unit 611, the path type for judging the increment relative path, in the increment with respect to road
When footpath is folder path, otherwise triggering first path combination subelement 612, triggers the second combination of paths subelement 613.
Wherein, the path type of the increment relative path can be folder path type, or file path
Type, for example, increment relative path .. 11 SS.java be file path type, increment relative path .. 11 22
For folder path type.
First path combines subelement 612, for obtain sub-folder relative path under the increment relative path and
Subfile relative path, default source file path is entered with the sub-folder relative path and subfile relative path respectively
Row combination of paths, obtains increment destination path.
Wherein, sub-folder of the first path combination subelement 612 in the case where obtaining the increment relative path is relative
When path and subfile relative path, refer to, when the increment relative path is folder path, to the increment relative path
Corresponding file carries out recursive operation, traverses all sub-folders and subfile under this document folder, thus, a little to this
File and the corresponding relative path of subfile are obtained, for example, increment relative path .. 11 22 corresponding Ziwen
Part presss from both sides relative path and subfile relative path is:.. 11 22 33 grades and .. 11 22 SS.java etc..
Wherein, first path combination subelement 612 by default source file path respectively with the sub-folder
Relative path and subfile relative path carry out combination of paths, when obtaining increment destination path, refer to, by the source file path
When carrying out combination of paths with the sub-folder relative path, the corresponding increment target road of the sub-folder relative path is obtained
Footpath, when the source file path and the subfile relative path are carried out into combination of paths, obtains the subfile relative path pair
The increment destination path answered.For example:By source file path C:Project and increment relative path .. 11 22 33 carry out
Combination, obtains path C:Project 11 22 33 be the corresponding increment destination path of the sub-folder relative path;Will
Source file path C:Project and increment relative path .. 11 22 SS.java carry out combination of paths, obtain path such as:
C:\project\\11\\22\\SS.java。
Second combination of paths subelement 613, for default source file path and the increment relative path to be entered into walking along the street
Footpath is combined, and obtains increment destination path.
Wherein, the second combination of paths subelement 613 refers to, will when the increment relative path is file path
The source file path and the increment relative path carry out combination of paths, obtain increment destination path, for example, by source file road
Footpath C:Project and increment relative path .. 11 SS.java carry out combination of paths, obtain increment destination path such as:C:\
project\\11\\SS.java。
With reference to Fig. 8, data capture unit described in a kind of incremental data acquisition device embodiment six provided for the application
602 structural representation, wherein, the data capture unit 602 can include:
Increment determination subelement 621, for determining the delta file under the increment destination path.
Wherein, the increment determination subelement 621 refers to, by the file under the increment destination path be defined as needing into
The delta file that row incremental data is obtained.
Increment obtains subelement 622, for default dos command copy mode, obtaining and increasing according to the delta file
Measure data.
Wherein, the dos command copy mode refers to, line number can be entered to the delta file by what user pre-set
According to the order copy mode of the operations such as duplication, such as Ctrl+C modes.This mode will not change quilt when carrying out data duplication
The modification date of file is replicated, is service where follow-up determination software project thus, it is possible to ensure the accurate of file modified date
Whether the file in device updates offer foundation, to determine that FileVersion provides foundation etc..
Structure is realized based on above-mentioned, the increment is obtained in subelement 622 according to delta file acquisition incremental data
When, incremental data can be obtained by different way when delta file type is different by judging the type of delta file, refer to
Fig. 9, is the structural representation that increment described in the embodiment of the present application six obtains subelement 622, wherein, the increment obtains subelement
622 can include:
File type judge module 901, for judging whether the type of the delta file is Java file types, if
It is to trigger the first increment acquisition module 902, otherwise, triggers the second increment acquisition module 903;
First increment acquisition module 902, for the delta file to be compiled, obtains increment class file, with default
Dos command copy mode, obtain the increment class file and be used as incremental data;
Wherein, the first increment acquisition module 902 refers to, when the delta file is java class files, it is necessary to will
The java class files are compiled, and obtain class class files and its inner classes class files as increment class file.
Specifically, the first increment acquisition module 902 obtains the increment with default dos command copy mode
When class file is as incremental data, it can be accomplished by the following way:
The increment class file is replicated with default dos command copy mode, the increment class file that may be copied to is as increasing
Amount data are obtained.
Second increment acquisition module 903, for default dos command copy mode, obtaining the delta file conduct
Incremental data.
It should be noted that because the delta file may be that java class files can also be non-java class files, by
This, scheme is performed before in the embodiment of the present application, and user can pre-set a source file operational order, to decide whether
Duplication operation is carried out to the corresponding source file of delta file of java class files.Therefore, it is the embodiment of the present application six with reference to Figure 10
Part-structure schematic diagram, wherein, described device can also include:
Source file processing unit 904, the class for judging the delta file in the file type judge module 901
When type is Java file types, according to default source file operational order, the corresponding source file of the delta file is obtained, by institute
Source file is stated to be placed in the corresponding position of default destination path.
Wherein, the source file processing unit 904 refers to, the corresponding source file progress acquisition of incremental data is placed in pre-
If in destination path correspondence position, during ensureing that version problem occurs in file in subsequent server, can trace back to and deposit in advance
Store up the source file old version in the default destination path correspondence position.
For example, the embodiment of the present application can be realized by performing class, the execution class pre-sets source file path, default mesh
If path, copy mode such as dos command copy mode and delta file be java class files when whether carry out answering for source file
The information such as system, and increment relative path is set in configuration file, for example:
listedFilesPath:″D:\\MyEclipse6.6\\workspace\\test\\src\\construct\\
files.txt″;// Profile Path
srcPath:″D:\\MyEclipse6.6\\workspace\\Sotower\\″;// source file path
tarpath:″D:\\lddy\\″;// preset destination path
copyMode:″2″;// copy mode, 1 is java, and 2 be dos
isCopySrc=″1″.// source file whether is replicated, 1 is to replicate
Increment relative path is set in configuration file files.txt:
WebContent\reportFiles\lddy\LDDY_H12_C.raq;// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_C.raq files
WebContent\reportFiles\lddy\LDDY_H12_1.raq;// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_1.raq files
WebContent\reportFiles\lddy\LDDY_H12_2.raq.// need to carry out incremental data acquisition
The increment relative path of LDDY_H12_1.raq files
Afterwards, above-mentioned execution class is performed, is realized to the acquisition of incremental data in the source file path and in the increment
Acquisition to its source file when the corresponding delta file of data is java class files, afterwards in the corresponding file of default destination path
Folder is lower it can be seen that the incremental data got, realizes the embodiment of the present application purpose.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight
Point explanation be all between difference with other embodiment, each embodiment identical similar part mutually referring to.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that
A little key elements, but also other key elements including being not expressly set out, or also include be this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged
Except also there is other identical element in the process including the key element, method, article or equipment.
A kind of incremental data acquisition method provided herein and device are described in detail above, herein should
The principle and embodiment of the application are set forth with specific case, the explanation of above example is only intended to help and managed
Solve the present processes and its core concept;Simultaneously for those of ordinary skill in the art, according to the thought of the application,
It will change in embodiment and application, in summary, this specification content should not be construed as to this Shen
Limitation please.