Summary of the invention
In order to solve the problems referred to above that exist in the prior art, the object of the present invention is to provide a kind of file packing form that possesses the Version Control ability.
The technical scheme that the present invention adopted is:
A kind of file packing form that possesses the Version Control ability is made up of file data and data directory, and said file data is as the carrier of file in the bag, and said data directory comprises and wraps interior off-set value, the file identification information of file in file data in each version.
As the further improvement of technique scheme, every cover file packing form comprises a cover file data, also comprises one or more sets data directories; Further, file set in the bag of the corresponding particular version of every suit data directory makes this document packing form can between a plurality of versions, control and switch, and selects the suitable version of opening.
As the further improvement of technique scheme, said file data and data directory can save as single file, or are divided into many parts of file storage.The content of file data and data directory can be stored in the local file; Or in the database; Or deriving from the automatic network transmission under certain agreement support, the storage mode of file data and data directory can be in above-mentioned several kinds one or more, and does not limit.
Further, said data directory is made up of a plurality of index entries, the corresponding relation of said index entry include file sign and off-set value.File identification is used for file of unique identification, and off-set value is the relative position of file identification respective file in file data.
Further, do not comprise data directory in the file data, the relevant any information of the unfolding mode of include file not yet.
The invention has the beneficial effects as follows: after adopting the present invention; The file that is bundled in the whole literature kit possesses a plurality of versions; And can switch the version of file in whole bag or the bag at any time, in packet format, the historical information that each file upgrades all is able to preserve; And in the update package process, the file that before occurred in the version need not to repeat to upgrade.
Embodiment
The present invention proposes a kind of file packing form that possesses the Version Control ability with reference to Fig. 1, this document packing form is made up of file data and data directory, and every cover file packing form comprises a cover file data, also comprises one or more sets data directories.As shown in Figure 1, described file data is as the carrier of file in the bag, for depositing of file in wrapping provides the place, and the file that the inside can stored number not be limit.Said data directory comprises interior off-set value, the file identification information of file in file data of bag in each version; As shown in Figure 1; Data directory is made up of a plurality of index entries; The sign and the off-set value that comprise respective file in each index entry, multinomial index entry can be formed a sets of data index, and the index entry in every sets of data index is corresponding one by one with file in the file data; Every suit data directory is represented a different version in the packet format, reads the file content of different editions, need use the data directory of different editions; Packet format is realized reading file in the bag of different editions through the data directory of different editions.Further, client only needs a sets of data index to get final product the data in the reading of data library file, need not to store the corresponding data directory of all versions; Client only needs file in the bag of the index of respective version in can read data files, and the data directory of other versions that file data is corresponding can be in client stores, thereby realizes maintaining secrecy of other version informations of file in client.
The storage mode of described file data and data directory does not limit, and can save as single file, or is divided into many parts of file storage.Its content can be kept in the local file, or in the database, or derive from the automatic network transmission under certain agreement support.The storage of the data directory of file data and different editions can be accomplished to separate fully; Do not comprise data directory in the file data; The also relevant any information of the unfolding mode of include file not, client can't directly read database under the prerequisite of index information not knowing.
File packing form of the present invention comprises packing, renewal, three kinds of operations of Version Control operation in the practical application operating process.Packing is responsible for the filename of needs is written in the bag according to packet format; Renewal process will increase file appending newly in bag; Version Control can be switched the version number of packet format, reads the file of any version before upgrading.
Described packing operation is accomplished through strapping tool, and strapping tool is accepted following input: 1. the file directory of required packing or listed files; 2. the version number of the back literature kit of packing; 3. the way of output and outgoing position; Strapping tool reads corresponding file from disk and generates corresponding literature kit according to input information.The literature kit of its generation is by file data and two ingredients of data directory; File data provides the place of data storing for file in the bag; The data that comprise file in all bags in it; Index then is the inlet of file in the visit current version bag, can find the position of file in file data in the bag by it.
Described renewal process is accomplished through refresh routine, and refresh routine is from the network download update package, and the content in the update package is appended in the literature kit that is updated.Update package manufacturing process is the same with packing process, and update package is identical with the target packet format on form.The identical file of content again that once occurred in the version before can identifying before upgrading can be specified the file that this part is not repeated to write file data, and only write the index of these files when making update package.With in the file file appending packet format in the bag that increases newly or revise, its mode of appending is: the update package file data directly appends in the client file data back-end packet format through renewal process; The data directory of update package merges with the data directory that is updated bag, and it is write in a new data directory, and this data directory is for upgrading the data directory of back literature kit version.If in later release, increase the identical file of content in the database, then can repeat to add the information in the database Already in, and only need new index information to point to legacy data regional.
The version of whole packet format is switched in the support of described Version Control process, and method is to replace the corresponding data directory of packet format to indicated release, so can read out the All Files in the indicated release.The version of single file in the bag is switched in the support of Version Control process, and method provides the off-set value in the corresponding version number of the file index entry in this bag, so can read out file in the specified packet in the indicated release.
After adopting the present invention; The file that is bundled in the whole literature kit possesses a plurality of versions; And can switch the version of file in whole bag or the bag at any time, in the time of need the version in the packet format being switched to old version, only need provide the bag version corresponding data directory; When reading in the single bag of particular version file, the index information of file in this bag only need be provided; In packet format, the historical information that each file upgrades all is able to preserve simultaneously, and in the update package process, the file that before occurred in the version need not to repeat to upgrade.After software client adopts the present invention, make that the gray scale issuing function of issue is achieved on a small scale, certain customers can upgrade to grayscale version in advance, treat all clients version so far of can upgrading after it is stablized.Simultaneously, after software product was confronted with a grave question, the version before packet format can switch at any time switched the expense that version need not the Network Transmission differential file, thereby reduced the loss that causes because of software defect.
The above is merely preferential embodiment of the present invention, as long as realize that with basic identical means the technical scheme of the object of the invention all belongs within protection scope of the present invention.