A kind of integrated mirror image document generating method, test method and device
Technical field
The invention belongs to a kind of communication equipment field more particularly to integrated mirror image document generating method, test method and dresses
It sets.
Background technology
In the production link of data communications equipment, startup image file BOOT IMAGE (starting image file) is needed to burn
FLASH (flash memory) is recorded, then upgrades other systems image file again, such as (Operating System, write a Chinese character in simplified form operating system
For:OS) (Field Programmable Gate Array, are abbreviated as IMAGE, field programmable gate array:FPGA)IMAGE、
Complex Programmable Logic Devices (Complex Programmable Logic Device, CPLD) IMAGE.Wherein, it is being
It unites before image upgrade (programming), is required for the programming for first completing to start mirror image.
Art methods so that burning BOOT IMAGE and the separation of system image Files step increase operational sequence
And time cost, limit the flexibility of test.
Invention content
The embodiment of the present invention is designed to provide a kind of integrated mirror image document generating method, test method and device, with
Solve the problems, such as that prior art complex procedures, production cost are high.
The embodiment of the present invention is achieved in that on the one hand an embodiment of the present invention provides a kind of integrated mirror image file generateds
Method the described method comprises the following steps:
The parameter created needed for the integrated image file is obtained, the parameter includes:The capacity of flash memory starts mirror image text
The size of part, the size of system image file;Validity judgement is made to the parameter;When judging result is legal, institute is integrated
It states startup image file and the system image file obtains the integrated image file.
On the other hand, to be tested when generation an embodiment of the present invention provides a kind of integrated image file test method
When integrated image file includes two or more, the method includes:
Burning startup file is read, includes in the burning startup file:Burning integrate image file sequence parameter and
Characterisitic parameter to be tested after burning;The burning of first integrated image file is completed according to the sequence, and in burning
After complete the test of the characteristic;The test result of recording characteristic carries out next integrated mirror according to the sequence parameter
As the burning and characteristic test of file;Until completing the survey of all integrated image files recorded in the burning startup file
Examination, exports all test results of record.
The third aspect, the embodiment of the present invention additionally provide a kind of device of integrated image file test, including:
Starting module includes in the burning startup file for reading burning startup file:Burning integrates image file
Sequence and burning after characteristic to be tested;
Control module, the burning for completing first integrated image file according to the sequence, and call test module
The test of the characteristic to be tested is completed after burning;Test module, the instruction for receiving control module are completed
After integrated mirror image burning file, the test of characteristic is carried out;Logging modle, for recording the test data generated in test module;
The control module is additionally operable to burning and characteristic test according to the next integrated image file of the sequential control;Until complete
At the test of all integrated image files recorded in the burning startup file.
The advantageous effect packet of a kind of integrated mirror image document generating method provided in an embodiment of the present invention, test method and device
It includes:The burning process for reducing the prior art, has saved production cost, has improved production efficiency.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some
Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these
Figure obtains other attached drawings.
Fig. 1 is a kind of flow chart of integrated mirror image document generating method provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of integrated image file test method provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of integrated image file test device provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of a kind of integrated mirror image file generated provided in an embodiment of the present invention and test system;
Fig. 5 is a kind of flow chart of integrated mirror image document generating method provided in an embodiment of the present invention.
Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In order to illustrate technical solutions according to the invention, below legal specific embodiment illustrate.
Embodiment one
It is a kind of flow chart of integrated (COMPACT) image file generation method provided by the invention as shown in Figure 1, it is described
Integrated mirror image document generating method is the important link in a kind of data communications equipment image file integrated approach of the present invention, it is
The precondition that automation burning and test is carried out in subsequent embodiment two, the described method comprises the following steps:
In a step 102, the parameter created needed for the integrated image file is obtained.
The parameter includes:The capacity of flash memory, size, the size of system image file for starting image file.Wherein, it dodges
The capacity deposited is wanted the amount of physical memory size of the target flash of burning by the integrated image file.
At step 104, validity judgement is made to the parameter.
The validity judgement will want the size of the image file in programming to flash memory primarily directed to future, judge the size
Whether range is within the capacity of flash memory.
In step 106, when judging result is legal, the startup image file and the system image file are integrated
Obtain the integrated image file.
Preferably, the integrated image file includes:Each image file is when being burnt in flash memory, corresponding storage
Location.
The embodiment of the present invention has done association process by that will start image file and system image file, and has been packaged generation
Integrated image file disposably completes the burning work of image file in flash memory.It overcomes in the prior art, needs to start
Image file and system image file carry out the complex procedures problem that burning is brought stage by stage, and further from integrated image file
The legitimacy for generating source control burning, to simplify the compatibility issue being likely encountered when follow-up burning flash memory.
In the preferred embodiment for combining the present embodiment, the validity judgement specifically includes:
The compatibility between the version number and the version number of the system image file for starting image file is verified, if
It is illegal that verification, which does not conform to validity judgement result described in rule,.Whether the capacity for verifying the flash memory disclosure satisfy that startup mirror image
The requirement of file and system image file size, if it is illegal that verification, which does not conform to validity judgement result described in rule,.If described
It is legal that the requirement of the compatible and described file size is all verified, then the validity judgement result is legal.
In the preferred embodiment for combining the present embodiment, the parameter of input includes the size of at least two system image files
When with version number, the method further includes:
When judging result is legal, it is more that startup image file is packaged generation with the multiple system image file respectively
A integrated image file.
The preferred embodiment gives the method for disposably inputting and obtaining multiple integrated image files, improves integrated mirror
As the convenience of file generated.
Embodiment two
It is illustrated in figure 2 a kind of flow chart of integrated image file test method provided in an embodiment of the present invention, it can by Fig. 2
Know, the applicable environment of the present embodiment is:When the integrated image file to be tested generated includes two or more, described two
A or more than two integrated image files can be start image file and system image file a variety of groups of different editions
It closes, and the generation of integrated image file can be realized using embodiment one.The test method of this implementation specifically includes:
In step 202, burning startup file is read.
Include in the burning startup file:It is to be tested after the sequence parameter of the integrated image file of burning and burning
Characterisitic parameter.
Further include in the burning startup file:The startup image file of burning is waited in each integrated image file in a flash memory
Storage address and wait for the storage address of the system image file of burning in a flash memory.
In step 204, the burning of first integrated image file is completed according to the sequence, and complete after burning
At the test of the characteristic.
The test can be completed in virtual environment, can also be completed in the environment of veneer.
Preferably, the test method includes that (Personal Computer, are abbreviated as a PC:) and one PC
Block testing single-board, the PC read institute for storing the integrated image file and burning startup file when carrying out burning
State burning startup file, and according to the parameter recorded in the burning startup file by the integrated mirror image burning file to described
On testing single-board.Then, test instruction is sent to the testing single-board by PC, and is completed in test by the testing single-board
Hold.
In step 206, the test result of recording characteristic carries out next integrated image file according to the sequence parameter
Burning and characteristic test.
Wherein, when burning or characteristic test fail, failure cause and corresponding integrated mirror are recorded in error log
As short title or version numbers.
In a step 208, defeated until completing the test of all integrated image files recorded in the burning startup file
Go out all test results of record.
Preferably, by all test results of above-mentioned PC output records.In order to reduce testing cost, usual testing single-board is not
Too many direct human-computer interaction function can be designed, it will usually complete to interact based on the PC.For example, the institute of the output record
Have test result, above-mentioned PC is usually sent to by serial ports by the testing single-board come complete record and show.
In the present embodiment, after the completion of integrated image file is produced, it can automatically realize and start image file and be
The burning and test of multiple combinations, more efficient compared with the prior art between system image file, further improves automation.
Embodiment three
In embodiments of the present invention, a kind of device 30 of integrated image file test, the integrated image file are provided
For realizing the method for above-described embodiment two, which specifically includes the device 30 of burning and test:
Starting module 301 includes in the burning startup file for reading burning startup file:Burning integrates mirror image
Characteristic to be tested after the sequence of file and burning.
Control module 303, the burning for completing first integrated image file according to the sequence, and call test mould
Block completes the characteristic test to be tested after burning.
Test module 305, the instruction for receiving control module carry out characteristic after completing to integrate mirror image burning file
Test.
Logging modle 307, for recording the test data generated in test module.
The control module 303 is additionally operable to the burning according to the next integrated image file of the sequential control and characteristic
Test, until completing the test of all integrated image files recorded in the burning startup file.
Example IV
A kind of data communications equipment image file integrated system provided in an embodiment of the present invention, the system comprises:
Integrated mirror image file creating apparatus 10, for obtaining the parameter created needed for the integrated image file, the ginseng
Number includes:The capacity of flash memory, size, the size of system image file for starting image file.The parameter is sentenced as legitimacy
It is disconnected.When judging result is legal, startup image file and system image file are packaged and generate the integrated image file.
Image file test device 30 is integrated, for reading burning startup file, includes in the burning startup file:It burns
Characterisitic parameter to be tested after the sequence parameter of the integrated image file of record and burning.First collection is completed according to the sequence
It is mirrored into the burning of file, and completes the test of the characteristic after burning.The test result of recording characteristic, according to described
Sequence parameter carries out the burning and characteristic test of next integrated image file.Until completing to record in the burning startup file
All integrated image files test, export all test results of record.
Network 20, the network 20 can show as Ethernet according to specific circumstances, internet or Serial Port Line are constituted
Link net.Such as:It is mirrored into burning file in 10 (PC of work) sum aggregate of integrated mirror image file creating apparatus and test fills
When setting in a LAN, the network 20 is Ethernet.
Preferably, in a certain optional, control module 303, starting module 301, logging modle in Fig. 4
307 and display module 309 when belonging to the integrated mirror image file creating apparatus 10, such as:Belong to a PC, i.e., the described collection
It is specially a PC to be mirrored into file creating apparatus 10.
Embodiment five
The present embodiment five is that the mistake of mirror image document creation is integrated in conjunction with description under specific environment based on the basis of embodiment one
Journey schematic diagram, as shown in figure 5, the present embodiment is to consider a less realization method of influence factor in specific implementation, wherein simultaneously
The version compatibility that considers start image file and system image file, still, embodiment disclosed on the basis of ability are not removed
Field technique personnel are readily able to expect being related to the realization method of version compatibility, specifically include:
In step 401, user creates the parameter integrated needed for image file by working computer input.
The parameter includes:Equipment flash memory (FLASH) capacity;Image file quantity n, the image file quantity n include
Start image file (BOOT IMAGE) and system image file (IMAGE-2~IMAGE-n);BOOT IMAGE are on the server
Storage road pass through and its storage address on a flash;The storage roads of IMAGE-2 on the server pass through and its on a flash
Storage address;So on up to the store paths of image file IMAGE-n on the server and its storage on a flash
Location.
In step 402, each image file length is obtained.
In step 403, validity judgement is done to parameter described in step 401.
The validity judgement specifically includes:If the storage base address of either image file described in step 401 is more than
The storage address of either image file described in FLASH capacity or step 401 is more than plus this image file length scale
FLASH capacity or each image file occupied space overlapping, then be considered as input parameter it is illegal, execute step 410 exit mirror image
File creation process.
In step 404, a new integrated image file is created, file size is equal to FLASH capacity.
In step 405, the file store path provided according to step 401 input reads BOOT IMAGE.
In a step 406, BOOT IMAGE contents step 405 read are according to specified storage address and step 402
Integrated mirror is written as file in this document length of acquisition.
In step 407, it is successively read system image file IMAGE-2 according to file store path on the server provided
Until IMAGE-n.
In a step 408, the image file content that step 407 is read is inputted according to step 401 in specified FLASH and is deposited
The respective file size write-in for storing up address and step 402 acquisition integrates image file.
In step 409, integrated image file is burned in FLASH by burning piece device.
The integrated image file of the generation can pass through the general FLASH burnt in the burned testing single-board of piece device or production
FLASH in product.When such production equipment, just only need to weld FLASH and no longer need the mirror images such as burning IMAGE-n literary
Part.
Those of ordinary skill in the art be further appreciated that implement the method for the above embodiments be can
It is completed with instructing relevant hardware by program, the program can be stored in a computer read/write memory medium
In, described storage medium, including ROM/RAM, disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
All any modification, equivalent and improvement etc., should all be included in the protection scope of the present invention made by within refreshing and principle.