CN103645905B - A kind of incremental data acquisition method and device - Google Patents

A kind of incremental data acquisition method and device Download PDF

Info

Publication number
CN103645905B
CN103645905B CN201310714015.XA CN201310714015A CN103645905B CN 103645905 B CN103645905 B CN 103645905B CN 201310714015 A CN201310714015 A CN 201310714015A CN 103645905 B CN103645905 B CN 103645905B
Authority
CN
China
Prior art keywords
path
increment
file
incremental data
default
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
Application number
CN201310714015.XA
Other languages
Chinese (zh)
Other versions
CN103645905A (en
Inventor
张剑鹏
王奔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Beijing Guodiantong Network Technology Co Ltd
Beijing China Power Information Technology Co Ltd
Original Assignee
State Grid Corp of China SGCC
Beijing China Power Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, Beijing China Power Information Technology Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201310714015.XA priority Critical patent/CN103645905B/en
Publication of CN103645905A publication Critical patent/CN103645905A/en
Application granted granted Critical
Publication of CN103645905B publication Critical patent/CN103645905B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

This application discloses a kind of incremental data acquisition method and device, methods described includes: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 embodiment of the present application is when realizing that incremental data is obtained, user is only needed to pre-set source file path, increment relative path and destination path, realized using these paths and the corresponding incremental data in these paths is obtained, thus the incremental data got is placed 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, improve the acquisition efficiency of incremental data, the manually operated mistake brought of user is reduced simultaneously, improve the accuracy rate of incremental data.

Description

A kind of incremental data acquisition method and device
Technical field
The application is related to software design technology field, more particularly to a kind of incremental data acquisition method and device.
Background technology
Currently, after software project is reached the standard grade, the optimization demand and problem of project constantly occur, it is necessary to by software project The file data for occurring incremental update carries out increment packing, that is, obtains delta package.
In the prior art, it usually needs technical staff carries out duplication acquisition to incremental data by hand, thus obtains incremental number According to.
But the flow of incremental data acquisition can be increased in this scheme, the efficiency that incremental data is obtained thus is reduced, simultaneously Packing easily error by hand, the accuracy rate for causing incremental data to obtain is relatively low.
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.
Brief description of the drawings
In order to illustrate more clearly of the technical scheme in the embodiment of the present application, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present application, for For those of ordinary skill in the art, without having to pay creative labor, it can also be obtained according to these accompanying drawings His accompanying drawing.
A kind of flow chart for incremental data acquisition method embodiment one that Fig. 1 provides for the application;
A kind of partial process view for incremental data acquisition method embodiment two that Fig. 2 provides for the application;
A kind of partial process view for incremental data acquisition method embodiment three that Fig. 3 provides for the application;
Fig. 4 is another part flow chart of the embodiment of the present application three;
Fig. 5 is the another partial process view of the embodiment of the present application three;
A kind of structural representation for incremental data acquisition device example IV that Fig. 6 provides for the application;
A kind of part-structure schematic diagram for incremental data acquisition device embodiment five that Fig. 7 provides for the application;
A kind of part-structure schematic diagram for incremental data acquisition device embodiment six that Fig. 8 provides for the application;
Fig. 9 is another part structural representation of the embodiment of the present application six;
Figure 10 is the another part-structure schematic diagram of the embodiment of the present application six.
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.

Claims (6)

1. a kind of incremental data acquisition method, it is characterised in that 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, including:Determine the increment text under the increment destination path Part, with default dos command copy mode, obtains incremental data, to ensure file modified date according to the delta file Accurately;
The incremental data is placed in the corresponding position of default destination path;
Wherein, the default source file path is the path where software project file;
The increment relative path is the relative path for needing to carry out the file or folder of incremental data acquisition, and, it is described to increase Amount relative path is arranged in a configuration file;
It is described that incremental data is obtained according to the delta file with default dos command copy mode, including:
Whether the type for judging the delta file is Java file types, if it is, the delta file is compiled, is obtained To increment class file, with default dos command copy mode, the increment class file is obtained as incremental data, otherwise, with pre- If dos command copy mode, obtain the delta file and be used as incremental data;The increment class file includes class class texts Part and its inner classes class files.
2. according to the method described in claim 1, it is characterised in that it is described according to default source file path and increment with respect to road Footpath, generates increment destination path, including:
Judge the path type of the increment relative path;
When the increment relative path is folder path type, the sub-folder obtained under the increment relative path is relative Path and subfile relative path are relative with the sub-folder relative path and subfile respectively by default source file path 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 destination path.
3. according to the method described in claim 1, it is characterised in that in the type of the delta file be Java file types When, 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 placed in pre- If in the corresponding position of destination path.
4. a kind of incremental data acquisition device, it is characterised in that 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;
Wherein, the default source file path is the path where software project file;
The increment relative path is the relative path for needing to carry out the file or folder of incremental data acquisition, and, it is described to increase Amount relative path is arranged in a configuration file;
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 data to be obtained according to the delta file, To ensure the accurate of file modified date;
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, triggering First increment acquisition module, otherwise, triggers the second increment acquisition module;
First increment acquisition module, for the delta file to be compiled, obtains increment class file, is ordered with default DOS Copy mode is made, the increment class file is obtained and is used as incremental data;The increment class file includes class class files and its interior Category class files;
Second increment acquisition module, incremental number is used as default dos command copy mode, obtaining the delta file According to.
5. device according to claim 4, it is characterised in that the coordinates measurement unit includes:
Type judgment sub-unit, the path type for judging the increment relative path is text in the increment relative path When part presss from both sides 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 subfile phase under the increment relative path To path, default source file path is subjected to group of paths with the sub-folder relative path and subfile relative path respectively Close, obtain increment destination path;
Second combination of paths subelement, for default source file path and the increment relative path to be carried out into combination of paths, Obtain increment destination path.
6. device according to claim 4, it is characterised in that also include:
Source file processing unit, for judging that the type of the delta file is Java texts in the file type judge module During part type, 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.
CN201310714015.XA 2013-12-20 2013-12-20 A kind of incremental data acquisition method and device Active CN103645905B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310714015.XA CN103645905B (en) 2013-12-20 2013-12-20 A kind of incremental data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310714015.XA CN103645905B (en) 2013-12-20 2013-12-20 A kind of incremental data acquisition method and device

Publications (2)

Publication Number Publication Date
CN103645905A CN103645905A (en) 2014-03-19
CN103645905B true CN103645905B (en) 2017-08-08

Family

ID=50251129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310714015.XA Active CN103645905B (en) 2013-12-20 2013-12-20 A kind of incremental data acquisition method and device

Country Status (1)

Country Link
CN (1) CN103645905B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547644B (en) * 2015-09-21 2020-11-20 伊姆西Ip控股有限责任公司 Incremental backup method and equipment
CN105868361A (en) * 2016-03-29 2016-08-17 中国银行股份有限公司 Data updating method and device
CN107291439B (en) * 2016-04-13 2020-06-16 阿里巴巴集团控股有限公司 Target incremental data construction method and device
CN108647268A (en) * 2018-04-28 2018-10-12 国网湖南省电力有限公司 Increment updating method for distribution network planning data integration
CN112559019A (en) * 2019-09-10 2021-03-26 联易软件有限公司 Updating method and device of incremental file
CN112269795B (en) * 2020-10-31 2022-05-13 武汉中海庭数据技术有限公司 NDS data rapid testing and verifying method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354708A (en) * 2008-07-29 2009-01-28 四川大学 Remote file rapid synchronization method
CN102331957A (en) * 2011-09-28 2012-01-25 华为技术有限公司 File backup method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1294514C (en) * 2001-08-20 2007-01-10 信息中心科技有限公司 Efficient computer file backup system and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354708A (en) * 2008-07-29 2009-01-28 四川大学 Remote file rapid synchronization method
CN102331957A (en) * 2011-09-28 2012-01-25 华为技术有限公司 File backup method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《linux c编程-实现文件夹的递归拷贝》;karry_vcent;《http://blog.csdn.net/k_linux_man/article/details/6709625》;20110822;正文第1页 *
《Object-C 学习笔记(二十五)--- 文件操作(写文件/读文件/复制文件)》;dragonzard;《http://blog.csdn.net/dragonzard/article/details/17415603》;20131229;正文第2页 *

Also Published As

Publication number Publication date
CN103645905A (en) 2014-03-19

Similar Documents

Publication Publication Date Title
CN103645905B (en) A kind of incremental data acquisition method and device
CN104573122B (en) Oracle database migration tool for migrating from AIX platform to K-UX platform
CN103064666B (en) One software distribution method by all kinds of means and system
CN103914564B (en) Method and system for updating and warehousing urban pipelines on basis of ArcGIS (geographic information system)
CN102368216B (en) Process implementation method based on automatic project building
CN103617155A (en) On-line commenting method and system for DWG file under WEB
CN102541533B (en) Method and equipment for page display
US20130159365A1 (en) Using Distributed Source Control in a Centralized Source Control Environment
CN103198074A (en) Page design method and system for dynamic publishing website
JP2014191672A (en) Program and version management method
GB2503486A (en) Managing changes to files
CN107729230A (en) A kind of WEB automatic test devices and method of testing based under control scheme
JP2002503000A (en) Systems and methods for developing websites
EP3418918A1 (en) Generation and graphical display of data transform provenance metadata
CN103077255B (en) Identification method and system for 3D (three-dimensional) model of nuclear power station
CN104054051A (en) Manipulating Source Code Patches
CN104572471A (en) Index-based Java software code clone detection method
Michels et al. Oxpath-based data acquisition for dblp
CN105975258A (en) Data dictionary management method and system
CN106843935A (en) A kind of method and system for automatically updating static file version number
CN107608704A (en) A kind of XML configuration file update method, system, medium and device
CN103744678A (en) Method for determining static function call relations based on register transfer language
CN106155665A (en) Accordance puts to the proof system and method
JP6839360B2 (en) Display program, display method and display device
CN102682038A (en) Database change method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15

Co-patentee after: STATE GRID CORPORATION OF CHINA

Patentee after: BEIJING CHINA POWER INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15

Co-patentee before: State Grid Corporation of China

Patentee before: BEIJING CHINA POWER INFORMATION TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20190724

Address after: 100085 Building 32-3-4108-4109, Pioneer Road, Haidian District, Beijing

Co-patentee after: STATE GRID CORPORATION OF CHINA

Patentee after: BEIJING GUODIANTONG NETWORK TECHNOLOGY Co.,Ltd.

Address before: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15

Co-patentee before: State Grid Corporation of China

Patentee before: BEIJING CHINA POWER INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right