Background technology
Along with the development of electronic information technology, when upgrading device content in enormous quantities, need empty original contents earlier at present, create a thread of reading then, create a thread of writing again, device content is upgraded.
Can there be following significant drawback in above-mentioned method:
One read one and writes the burden that has increased the weight of hard disk when row upgraded during (1) simultaneously to equipment in enormous quantities.Such as upgrading 10 equipment, update content is 2G, will read 10 contents so altogether, always remembers 20G, only need read once now, altogether 2G.
(2) content is not compared, all the elements are upgraded, speed is very slow.Just changed a filename such as fresh content,, will duplicate portion again so, only needed now its rename just can according to new script more if upgrade in existing mode.
Summary of the invention
The objective of the invention is to address the above problem, a kind of method of updating contents in batch is provided, conveniently carry out equipment in enormous quantities and carry out content update.
Technical scheme of the present invention is: the present invention has disclosed a kind of method of content batch updating, and method comprises: the reading of content file also generates the content characteristic file; Generate more new script and carry out difference update; The content of while batch updating multiple devices.
The method of above-mentioned content batch updating, wherein, the batch updating program reads all the elements, according to the condition code of single file generation content file, integrates all condition code generating feature files then.
The method of above-mentioned content batch updating, wherein, the batch updating program is judged single file size earlier, if single file size less than 1M, then generates the condition code of whole file; Otherwise then get the part generating feature sign indicating number in the single file.
The method of above-mentioned content batch updating, wherein, the mode that the batch updating program generates the content file condition code be single file greater than 1M, part is closed in first half, center section and back that program is got file, and its three sections contents are merged a tag file that generates fixed sizes.
The method of above-mentioned content batch updating, wherein, batch updating program documents feature generates more new script, according to new script more equipment is carried out difference update.
The method of above-mentioned content batch updating, wherein, more the content of new script is: according to attribute and tag file comparative apparatus original file content such as redaction contents directory structure, file size, filenames, generate the update content script, upgrade operation and be divided into interpolation file, revised file, deleted file, life name file and rename folder etc.
The method of above-mentioned content batch updating, wherein, the mode of upgrading operation is: contrast characteristic's file and equipment original contents, if there is not this file in original version, program generates a script that adds file; Revised file if desired then generates the script of a revised file; If deleted file, then generate the script of a deleted file; If just filename difference is found in contrast, tag file is identical, so just generates the script of a life name; If content file is all the same, so just generate the script of rename, basic these scripts of program upgrade operation then.
The method of above-mentioned content batch updating, wherein, the batch updating program reads update content according to the content update script from hard disk, creates a thread again content is carried out batch updating to multiple devices simultaneously by the usb data line again.
The method of above-mentioned content batch updating, wherein, the batch updating program from the mode that hard disk reads update content is: thread of program creation, read the file that will upgrade according to the content update script from hard disk, be kept in the internal memory.
The method of above-mentioned content batch updating, wherein, the mode of the content of updating the equipment is: thread of program creation, in the update content write device that is kept in the internal memory.
The method of above-mentioned content batch updating, wherein, the mode that multiple devices are carried out batch updating is simultaneously:
Program is created the update content thread of respective numbers according to number of devices, and each thread only upgrades corresponding equipment.
The present invention contrasts prior art following beneficial effect: the present invention and conventional art are different, only by calculating the content characteristic file, generate the content update script, a thread reading of content, a plurality of threads carry out batch updating according to the content update script to device content.Method of the present invention has following advantage: the hard disk number of times is read in (1) minimizing.(2) calculate the content characteristic file, generate more new script, carry out content update, improved renewal speed according to the content of upgrading.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
Fig. 1 shows the process flow diagram of preferred embodiment of the method for updating contents in batch of the present invention.Seeing also Fig. 1, is the detailed description to each step among this method embodiment below.
Step S10: read the redaction content, generate the content characteristic file.
Step S11: according to redaction content and tag file, the comparative apparatus original contents generates the content update script.
Step S12: create a thread and read the content that to upgrade from hard disk and be kept at the internal memory.
Step S13: create a plurality of threads, according to the content update script batch updating is carried out in one batch facility, the corresponding equipment of each thread reads the content that will upgrade from internal memory, be updated in the equipment.
Step S14: be kept at the redaction content file on the hard disk, when generating the version feature file and upgrading, need the reading of content file.
Step S15: create in a plurality of more new thread one more new thread during batch updating, update content is write in the corresponding device according to new script more.
Step S16 a: equipment during batch updating in a plurality of equipment.
Step S17: finish right relatively more new thread after a renewal of the equipment during batch updating in a plurality of equipment is finished.