CN106250188A - A kind of generation method and system of system firmware image file - Google Patents

A kind of generation method and system of system firmware image file Download PDF

Info

Publication number
CN106250188A
CN106250188A CN201610619082.7A CN201610619082A CN106250188A CN 106250188 A CN106250188 A CN 106250188A CN 201610619082 A CN201610619082 A CN 201610619082A CN 106250188 A CN106250188 A CN 106250188A
Authority
CN
China
Prior art keywords
subfile
size
system firmware
file
free space
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.)
Granted
Application number
CN201610619082.7A
Other languages
Chinese (zh)
Other versions
CN106250188B (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.)
JRD Communication Shenzhen Ltd
Original Assignee
JRD Communication Shenzhen 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 JRD Communication Shenzhen Ltd filed Critical JRD Communication Shenzhen Ltd
Priority to CN201610619082.7A priority Critical patent/CN106250188B/en
Publication of CN106250188A publication Critical patent/CN106250188A/en
Application granted granted Critical
Publication of CN106250188B publication Critical patent/CN106250188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The present invention discloses the generation method and system of a kind of system firmware image file, and the method includes a subfile in extraction system firmware, obtains the file size of described subfile;Real space size and the free space size of the actual distribution of described subfile that described subfile takies is obtained according to described file size;The real space size taken plus described subfile by described subfile writing address in system firmware image file and the actual allocation of free space size of described subfile, obtain the writing address in system firmware image file of the next subfile after described subfile.By adding certain space size after the writing address of a subfile, make to leave free space between two adjacent subfiles, in system firmware escalation process, need not subfile and be copied to buffer area, avoid the situation occurring in system firmware escalation process that file is overlapping, effectively reduce the time overhead in system firmware escalation process and disk buffering expense.

Description

A kind of generation method and system of system firmware image file
Technical field
The present invention relates to computer realm, particularly relate to the generation method and system of a kind of system firmware image file.
Background technology
Introducing upgrading mode based on memory block in embedded systems, this upgrading mode is not limited by file system System, can be used for any file system, and uses the equipment that this kind of upgrading mode upgrade, the distribution on the storage device of its firmware All consistent with image file, be conducive to us to use checking routine on equipment, a check system firmware is the most damaged.
But existing system firmware image file generates method can not well support this upgrading mode, existing system Firmware mapping file generates method and is spliced one by one according to alphabetical order by file, tight between two subfiles Adjacent, if in redaction preceding subfile than in legacy version preceding subfile larger, it is necessary in legacy version rear Subfile copy out, put into buffer area, the preceding subfile of redaction could be write corresponding position, this situation It is referred to as " file is overlapping ", the time overhead in system firmware escalation process and disk buffering expense can be increased, in some instances it may even be possible to go out The situation of existing system firmware staging error.
Summary of the invention
It is an object of the invention to provide the generation method and system of a kind of system firmware image file, it is possible to avoid system There is the situation that file is overlapping in firmware upgrade process, effectively reduces the time overhead in system firmware escalation process and disk buffering Expense.
For achieving the above object, the present invention provides a kind of generation method of system firmware image file, and the method includes:
A subfile in extraction system firmware, obtains the file size of described subfile;
Real space size and the actual distribution of described subfile that described subfile takies is obtained according to described file size Free space size;
The actual sky that described subfile writing address in system firmware image file is taken plus described subfile Between size and the actual allocation of free space size of described subfile, obtain the next subfile after described subfile in system Writing address in firmware mapping file.
Wherein, a subfile in described extraction system firmware, before obtaining the file size of described subfile, bag Include:
Obtain the distribution situation of system firmware subfile, obtain described subfile at system firmware according to described distribution situation Writing address in image file.
Wherein, described real space size and the described subfile that described subfile takies is obtained according to described file size Actual allocation of free space size include:
Described system firmware subregion is divided into the burst that multiple size is identical, and the size of each burst is defined as unit and divides Sheet size, wherein, a burst is used for a subfile in storage system firmware;
Arranging the preparation rate of described subfile, wherein, the free space that described preparation rate is total in system firmware subregion is big The ratio of whole space sizes that subfiles take in little and described system firmware subregion;
It is calculated the real space that described subfile takies big according to described file size and described unit burst size Little;
According to described file size and described preparation rate, the theoretical allocation of free space being calculated described subfile is big Little;According to described theoretical allocation of free space size and described unit burst size, the reality being calculated described subfile is divided Join free space size.
Wherein, described method includes:
The accumulative remainder of definition;
The part that described theoretical allocation of free space size exceeds described actual allocation of free space size is counted described Accumulative remainder;
The actual sky that described subfile writing address in system firmware image file is taken plus described subfile Between size and the actual distribution of described subfile free space size after, including:
Judge that described subfile whether more than unit burst size, is the most then reflected by described accumulative remainder at system firmware As the writing address in file adds unit burst size, obtain the next subfile after described subfile at system firmware Writing address in image file;If it is not, execution subsequent step.
Wherein, the writing address in system firmware image file of the next subfile after described subfile is obtained described in Afterwards, including:
Judge that in described system firmware, whether whole subfiles have processed, and if so, terminate flow process;Take out if it is not, return A subfile in system firmware, obtains the step of the file size of described subfile, and continues subsequent step.
Wherein, the described preparation rate arranging described subfile includes:
Judge whether described subfile is APP file, the most then the preparation rate of described subfile is set to the first preparation Rate, if it is not, then arrange the second preparation rate by the preparation rate of described subfile;
Wherein, described first preparation rate is more than described second preparation rate.
Wherein, described it is calculated, according to described file size and described unit burst size, the reality that described subfile takies Border space size particularly as follows:
According to described file size and described unit burst size, obtain the burst number that described subfile takies, by institute State burst number and be multiplied by described unit burst size, obtain the real space size that described subfile takies;
Wherein, the real space size that described subfile takies is the integral multiple of described unit burst size.
Wherein, described according to described file size with described preparation rate, it is calculated the sky of described subfile theory distribution Free space size;Free space size according to the distribution of described subfile theory and described unit burst size, be calculated institute State the free space size of the actual distribution of subfile particularly as follows:
Described file size is multiplied by described preparation rate, obtains the free space size of described subfile theory distribution;
The free space size described subfile theory distributed, divided by described unit burst size, obtains a quotient;Will Described quotient is multiplied by described unit burst size, obtains the free space size of the actual distribution of described subfile.
On the other hand, the present invention proposes the generation system of a kind of system firmware image file, and this system includes:
Subfile acquisition module, a subfile in extraction system firmware, the file obtaining described subfile is big Little;
Computing module, for obtaining, according to described file size, real space size and the described son that described subfile takies The free space size of the actual distribution of file;
Writing address arranges module, for by described subfile writing address in system firmware image file plus institute State real space size and the actual allocation of free space size of described subfile that subfile takies, after obtaining described subfile Next subfile writing address in system firmware image file.
Wherein, described system also includes:
Complete judge module, be used for judging in described system firmware, whether whole subfiles have processed;
Operation executing module, terminates flow process for completing the judged result of judge module described in basis, or to described Ziwen Part acquisition module sends the instruction continuing executing with action.
Useful benefit: be different from the situation of prior art, the present invention, by a subfile in extraction system firmware, obtains Take the file size of described subfile;Real space size that described subfile takies and described is obtained according to described file size The free space size of the actual distribution of subfile;By described subfile writing address in system firmware image file plus institute State real space size and the actual allocation of free space size of described subfile that subfile takies, after obtaining described subfile Next subfile writing address in system firmware image file.In this way, the present invention makes system firmware reflect Between two adjacent subfiles in file, there is certain free space, in system firmware escalation process, even if newly The subfile of version is bigger than the same subfile of legacy version, it is not required that the later subfile of this subfile is copied to caching At write correspondence position behind district, can directly write direct correspondence position by the subfile of redaction, it is to avoid system firmware liter The situation that file is overlapping occurs during Ji, effectively reduces the time overhead in system firmware escalation process and disk buffering is opened Pin.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet that present system firmware mapping file generates method one embodiment;
Fig. 2 is the idiographic flow schematic diagram of step S102 in Fig. 1;
Fig. 3 is the idiographic flow schematic diagram of step S1022 in Fig. 2;
Fig. 4 is the flow chart that present system firmware mapping file generates another embodiment of method;
Fig. 5 is the flow chart that present system firmware mapping file generates another embodiment of method;
Fig. 6 is the flow chart that present system firmware mapping file generates another embodiment of method;
Fig. 7 is the high-level schematic functional block diagram that present system firmware mapping file generates system one embodiment;
Fig. 8 is the high-level schematic functional block diagram that present system firmware mapping file generates another embodiment of system;
Fig. 9 is the structural representation of generation processing means one embodiment of present system firmware mapping file.
Detailed description of the invention
For making those skilled in the art be more fully understood that technical scheme, below in conjunction with the accompanying drawings and be embodied as A kind of method and system generating system firmware image file provided by the present invention are described in further detail by mode.
Being the schematic flow sheet that present system firmware mapping file generates method one embodiment with reference to Fig. 1, Fig. 1, this is System firmware mapping file generates method and comprises the steps:
A subfile in S101, extraction system firmware, obtains the file size of described subfile.
A subfile needed in writing system firmware mapping file is taken out from the file directory of system firmware.Optional , a subfile in extraction system firmware is according to subfile discharge order in system firmware, from the literary composition of system firmware First subfile in part catalogue starts to take out corresponding subfile successively, in the catalogue that extraction system firmware is corresponding for the first time First subfile;After in first subfile writing system firmware mapping file, then from the catalogue that system firmware is corresponding Take out second subfile, until being taken out and writing system firmware image by all files in catalogue corresponding for this system firmware In file.
While a subfile in extraction system firmware, obtain the file size of described subfile.
S102, obtain real space size that described subfile takies according to described file size and described subfile is actual The free space size of distribution.
The file size of each subfile is different, the free time that the space size causing each subfile to take distributes with needs Space size is the most different.
Further, as in figure 2 it is shown, step S102 specifically includes following steps:
S1021, described system firmware subregion being divided into the burst that multiple size is identical, the size of each burst is defined as Unit burst size.
System firmware subregion is the partition holding for storage system firmware file, and the size of system firmware subregion must wait In the size of system firmware image file, system firmware image file comprises all data seeing system firmware, and system is solid The arranging situation of part image file is consistent with the arranging situation of system firmware subregion on equipment, usually through being in system development The mode that on system firmware mapping file write device, system firmware divides carrys out the system firmware on more new equipment.
System firmware subregion is divided into multiple little region, and each region is defined as burst, the size phase of each burst With, the size that each region is divided into is the size of each burst, and the size of each burst is defined as unit burst size. The concrete numerical value of unit burst size is not limited by the present embodiment, and unit burst size can total according to system firmware subregion Size is configured.
S1022, the preparation rate of described subfile is set.
The preparation rate of described subfile is defined as the allocated free space size of described subfile and system firmware Ziwen The ratio of the size of part own;If the preparation rate of each subfile is identical in system firmware subfile, then can be equivalent to system solid The ratio of the total file size of the size of free space total in part and system firmware subfile.
In the present embodiment, a kind of computational methods of the preparation rate of subfile are specific as follows:
Making the total size of the file in system firmware is S, and the size of system firmware free space is Sf, then this system firmware In the computing formula of preparation rate of subfile be: P=Sf/S.
But different due to file type in system firmware subfile, and different types of file is upgraded eight-legged essay at system firmware The probability that part size changes is the most different, then need to arrange different types of subfile different preparation rates.Generally APP The file probability that file size changes when system firmware is upgraded is relatively big, and alternative document is upgraded eight-legged essay at system firmware The probability that part size changes is less, and the alternative document except APP file is defined as ordinary file, the present embodiment neutron The another kind of computational methods of the preparation rate of file are specific as follows:
The total size making the APP file in system firmware is Sa, and total size of ordinary file is So, file system itself The size that meta data take is Sfs, and total size of system firmware subregion is X, makes the total idle sky in system firmware subregion Between size be Sf, then Sf=X-Sa-So-Sfs;The weighter factor making APP file is Fa, and the weighter factor of ordinary file is Fo, then the preparation rate making APP file is Pa, then the computing formula of Pa is: (Fa*Sf)/(Sa*Fa+So*Fo);Make ordinary file Preparation rate be Po, then the computing formula of Po is: (Fo*Sf)/(Sa*Fa+So*Fo).Wherein, the weighter factor of APP file is Fa is that Fo is big than the weighter factor of ordinary file;Weighter factor illustrates the file proportion when allocation of free space, weight because of The value of son can be configured according to the actual requirements.
Illustrating, the weighter factor Fa arranging APP file is 1.2, and the weighter factor Fo of ordinary file is 1;By right In system firmware, the distribution situation of system firmware subfile is analyzed obtaining total size Sa of APP file is 500KB, general Total size So of logical file is 200KB, and size Sfs that the meta data of file system itself take is 100KB, and system firmware divides Total size X in district is 1000KB, then size Sf that can obtain the total free space in system firmware subregion is 200KB, root Preparation rate Pa that can calculate APP file according to above-mentioned formula is 0.3, and preparation rate Po of ordinary file is 0.25.
Further, as it is shown on figure 3, step S1022 also comprises the steps:
S10221, judge whether described subfile is APP file.
S10222, the preparation rate of described subfile is set to the first preparation rate.
If the judged result in step S10221 is yes, the most described subfile is APP file, then by the standard of described subfile Standby rate is set to the first preparation rate.Preparation rate Pa of APP file is represented by the present embodiment, the most now by described subfile Preparation rate is set to Pa.According to the example above, calculated result is described, the preparation rate of described subfile is set to 0.3.
S10223, the preparation rate of described subfile is arranged the second preparation rate.
If the judged result in step S10221 is no, the most described subfile is ordinary file, then by described subfile Preparation rate is set to the second preparation rate.Preparation rate Po of ordinary file is represented by the present embodiment, the most now by described Ziwen The preparation rate of part is set to Po.According to the example above, calculated result is described, the preparation rate of described subfile is set to 0.25。
In the present embodiment, the first preparation rate is the preparation rate of APP file, and the second preparation rate is the preparation rate of ordinary file, Therefore the first preparation rate is more than the second preparation rate.
S1023, it is calculated, according to described file size and described unit burst size, the reality that described subfile takies Space size.
Obtain subfile deposit in step S1021 divide burst in, a burst can only be deposited one identical System firmware subfile, or deposit the part of an identical system firmware subfile, the son deposited in i.e. one burst File is all same system firmware subfile, even if a burst also has vacant sky after depositing system firmware subfile Between, can not be used for depositing an another system firmware subfile, the real space size that therefore system firmware subfile takies is The integral multiple of unit burst size.
Obtain concretely comprising the following steps of the real space size that described subfile takies:
File size according to the system firmware subfile taken out and the unit burst size of division, obtaining this subfile needs Burst number to be taken, is multiplied by unit burst size by the burst number obtained, and i.e. obtains the actual sky that this subfile takies Between size.
Illustrating, if the file size of the system firmware subfile taken out is 25KB, the unit burst size of division is 4KB, then this subfile needs true burst number to be 7, and the burst number obtained is multiplied by the value that unit burst size obtains 28KB, then the real space size that this subfile takies is 28KB.
S1024, according to described file size and described preparation rate, the theoretical distribution being calculated described subfile is idle empty Between size.
The corresponding preparation rate arranged in the file size of the system firmware subfile according to taking-up and step S1022, will The file size of this subfile is multiplied by corresponding preparation rate, i.e. obtains the theoretical allocation of free space size of this subfile.
Illustrating, the file size of the system firmware subfile of taking-up is 25KB, if this subfile is APP file, then The preparation rate of this subfile is 0.3, and it is 7.5KB that 25KB is multiplied by the 0.3 theoretical allocation of free space size i.e. obtaining subfile.
S1025, according to described theoretical allocation of free space size and described unit burst size, be calculated described Ziwen The actual allocation of free space size of part.
Owing to the actual allocation of free space size of system firmware subfile is also required to represent by unit burst size, it is then The actual allocation of free space size of system firmware subfile is also indicated by the unit burst size of integral multiple.
Be calculated the actual allocation of free space size of described subfile particularly as follows:
By the theoretical allocation of free space size that obtains in step S1024 divided by the unit burst divided in step S1021 Size, obtains a quotient, and this quotient is multiplied by unit burst size, and the actual allocation of free space i.e. obtaining this subfile is big Little.
Illustrate, if the theoretical allocation of free space size obtained in step S1024 is 7.5KB, step S1021 is drawn The unit burst size divided is 4KB, and the quotient that both are divided by is 1, this quotient is multiplied by unit burst size, obtains this subfile Actual allocation of free space size be 4KB.
S103, the reality that described subfile writing address in system firmware image file is taken plus described subfile Border space size and the actual allocation of free space size of described subfile, obtain the next subfile after described subfile and exist Writing address in system firmware image file.
The subfile taken out in step S101 writing address in system firmware image file is added in step S102 The real space size that this subfile obtained takies, this part is used in this subfile writing system firmware mapping file, example As, this subfile writing address in system firmware image file is A, the reality that this subfile obtained in step S102 takies Border space size is 28KB, then by A plus 28KB, having obtained second address is A+28KB, the space between A and A+28KB For the write of this subfile, this subfile is started writing system firmware mapping file from writing address A.Again by the second ground Location A+28KB is plus the actual allocation of free space size of this subfile obtained in step S102, according to the act in step S102 Example, if the actual allocation of free space size of this subfile is 4KB, then obtaining the 3rd address is A+28KB+4KB, obtains 3rd address is the writing address in system firmware image file of the next subfile after this subfile.Thus, should Leave the reality of this subfile calculated in step S102 between next subfile after subfile and this subfile to divide Join free space size.
The present embodiment can make in system firmware image file, leaves corresponding idle empty between two adjacent subfiles Between, when system firmware is upgraded, even if the file size of preceding subfile is more than with regard to Ziwen preceding in version in redaction The file size of part, it is not required that posterior subfile is copied to buffer area, it is to avoid occur in system firmware escalation process The situation that file is overlapping, effectively reduces the time overhead in system firmware escalation process and disk buffering expense.
Further, as shown in Figure 4, also comprised the steps: before step S101
S104, the distribution situation of acquisition system firmware subfile, obtaining described subfile according to described distribution situation is being Writing address in system firmware mapping file.
The distribution situation of system firmware subfile is analyzed, owing in system firmware subfile, storage has write The meta data of subfile and file system itself, the meta data of file system itself include the genus of subfile in system file Property, the length of subfile and the address location etc. of subfile;The meta data of file system itself are generally positioned at file system The beginning of system, can have an impact the writing address of subfile, need to be analyzed the distribution situation of system firmware subfile, from And obtain the space shared by meta data of file system itself, obtain system firmware subfile in system according to analytical structure Address in firmware mapping file, thus obtain described subfile writing address in system firmware image file.
Owing to a subfile in extraction system firmware is according to subfile discharge order in system firmware, from first Individual subfile starts to take out corresponding subfile successively, first Ziwen in the catalogue that extraction system firmware is corresponding for the first time Part, so the writing address that the subfile now obtained according to described distribution situation is in system firmware image file is first system System firmware subfile address in system firmware image file, the i.e. initial address of subfile, by first system firmware Ziwen Part address in system firmware image file is set to this subfile writing address in system firmware image file.If no Consider the meta data of file system itself, then this subfile writing address in system firmware image file is 0.
Further, as it is shown in figure 5, the present embodiment is in step s 103, by described subfile at system firmware reflection literary composition Real space size that writing address in part takies plus described subfile and the actual allocation of free space of described subfile After size, before obtaining the writing address in system firmware image file of the next subfile after subfile, also include Following steps:
S105, the accumulative remainder of definition.
S106, described theoretical allocation of free space size is counted beyond the part of described actual allocation of free space size Described accumulative remainder.
According to step S1025, subfile theory allocation of free space size is wanted than actual allocation of free space size A big part, then define cumulative remainder, and theoretical allocation of free space size exceeds the part of actual allocation of free space size Count this accumulative remainder.
Illustrate, if the theoretical allocation of free space size obtained in step S1024 is 7.5KB, the reality of this subfile Border allocation of free space size is 4KB, then the 3.5KB exceeded is counted cumulative remainder.
S107, judge that described accumulative remainder is whether more than unit burst size.
One by one by subfile writing system firmware mapping file, owing to, for each subfile, theoretical distribution is empty The free space size always actual big part of allocation of free space size of ratio, and for each subfile, theoretical distribution sky Free space size all can count this accumulative remainder beyond the part of actual allocation of free space size, causes accumulative remainder constantly to tire out Add, after the space counting accumulative remainder is effectively utilized and is assigned to subfile, embodiment adds accumulation remaining The size of number carries out the step judged, it is judged that whether accumulative remainder is more than unit burst size.
S108, described subfile writing address in system firmware image file is added unit burst size, The next subfile after described subfile writing address in system firmware image file.
If the judged result in step S107 is more than unit burst size for accumulative remainder, described subfile is solid in system Writing address in part image file adds unit burst size, the most in step s 103 by described subfile at system firmware Real space size and the actual distribution of described subfile that writing address in image file takies plus described subfile are empty After the size of free space, add unit burst size.Such as, step S103 is exemplified as by described subfile at system firmware Real space size and the actual distribution of described subfile that writing address in image file takies plus described subfile are empty The 3rd address obtained after the size of free space is A+28KB+4KB, if now adding up remainder is 7KB, accumulative remainder is more than unit Burst size, then add unit burst size 4KB on the basis of the 3rd address, and obtaining the 4th address is A+28KB+ 4KB+4KB, the write ground in system firmware image file of the next subfile after now the 4th address is this subfile Location.
S109, execution subsequent step.
If the judged result in step S107 is less than or equal to unit burst size, then by described Ziwen for accumulative remainder Real space size that part writing address in system firmware image file takies plus described subfile and described subfile Actual allocation of free space size after, obtain the next subfile after described subfile in system firmware image file Writing address.Such as, step S103 is exemplified as adding described subfile writing address in system firmware image file The 3rd obtained after real space size that upper described subfile takies and the actual allocation of free space size of described subfile Individual address is A+28KB+4KB, if now adding up remainder is 3.5KB, accumulative remainder less than unit burst size, then the obtained Three addresses are the writing address in system firmware image file of the next subfile after this subfile.
Further, as shown in Figure 6, the present embodiment also includes:
S1010, judge in described system firmware, whether whole subfiles have processed.
After obtaining the writing address in system firmware image file of the next subfile after this subfile, it is judged that be Subfile in system firmware has the most all processed.
S1011, end flow process.
If the judged result of step S1010 is yes, i.e. subfile in system firmware has all processed, then terminate this The production stage of system firmware image file.
S1012, the subfile returned in extraction system firmware, obtain the step of the file size of described subfile, And continue subsequent step.
If the judged result of step S1010 is no, i.e. subfile in system firmware has the most all processed, then return step Rapid S101, continues to take out a subfile needed in writing system firmware mapping file from the file directory of system firmware, Now take out corresponding subfile successively according to subfile discharge order in system firmware.
The present embodiment by after the writing address of a subfile plus certain space size so that this subfile and Default free space is left between subfile after it, in system firmware escalation process, even if the subfile of redaction Bigger than the space that the same subfile of legacy version takies, it is not required that to be copied to delay by the next subfile after this subfile Deposit district, it is to avoid system firmware escalation process occurs the situation that file is overlapping, effectively reduce in system firmware escalation process Time overhead and disk buffering expense.
It is the high-level schematic functional block diagram that present system firmware mapping file generates system one embodiment refering to Fig. 7, Fig. 7. The present embodiment includes:
Subfile acquisition module 101, a subfile in extraction system firmware, obtain the file of described subfile Size.
Computing module 102, for obtaining, according to described file size, real space size and the institute that described subfile takies State the free space size of the actual distribution of subfile.
Writing address arranges module 103, for being added by described subfile writing address in system firmware image file Go up real space size and the actual allocation of free space size of described subfile that described subfile takies, obtain described Ziwen The next subfile after part writing address in system firmware image file.
The present embodiment and step S101 in the above-mentioned embodiment of the method generating system firmware image file, S102 and S103 is corresponding, and here is omitted.
Refering to Fig. 8, the present invention generates a system embodiment of system firmware image file and also includes:
Complete judge module 104, be used for judging in described system firmware, whether whole subfiles have processed.
Operation executing module 105, terminates flow process for completing the judged result of judge module 104 described in basis, or to institute State subfile acquisition module 101 and send the instruction continuing executing with action.
If whole subfiles have processed in system firmware, then operation executing module 105 sends end flow process instruction, terminates Flow process, completes the production of this system firmware image file;If whole in system firmware, subfile is untreated completes, then operation is held Row module 105 sends the instruction continuing executing with action to subfile acquisition module 101, and subfile acquisition module 101 continues executing with A subfile in extraction system firmware, obtains the step of the file size of described subfile, herein with above-mentioned generation system One embodiment of the method for system firmware mapping file is corresponding, and here is omitted.
Refering to generation processing means one embodiment that Fig. 9, Fig. 9 are present system firmware mapping file.This generation processes Device can perform said system firmware mapping file and generate the execution step in embodiment of the method.Related content please be participated in above-mentioned The detailed description of embodiment of the method, here is omitted.
In the present embodiment, this processing means includes processor 91 and memorizer 92, and memorizer 92 couples with processor 91.
Memorizer 92 is used for storing operating system, instruction that processor 91 performs and the information that processor 91 gets and Data etc..
Processor 91 is used for performing following action:
Take out a subfile in the system firmware of storage in memorizer 92, obtain the file size of described subfile.
Real space size and the actual distribution of described subfile that described subfile takies is obtained according to described file size Free space size.The real space size that the subfile obtained is taken and the free space size of the actual distribution of subfile It is stored in memorizer 92.
The actual sky that described subfile writing address in system firmware image file is taken plus described subfile Between size and the actual allocation of free space size of described subfile, obtain the next subfile after described subfile in system Writing address in firmware mapping file.Next subfile after the subfile that will obtain is in system firmware image file Writing address is stored in memorizer 92.
Optionally, processor 91 is for obtaining the distribution of system firmware subfile from the system firmware that memorizer 92 preserves Situation, obtains described subfile writing address in system firmware image file according to described distribution situation.Ziwen will be obtained Part writing address in system firmware image file is stored in memorizer 92.
Optionally, processor 91 is for being divided into the burst that multiple size is identical, Mei Gefen by described system firmware subregion The size of sheet is defined as unit burst size, and wherein, a burst is used for a subfile in storage system firmware.Institute is set Stating the preparation rate of subfile, wherein, described preparation rate is that free space size total in system firmware subregion is solid with described system The ratio of the space size that whole subfiles take in part subregion.After processor 91 arranges the preparation rate of subfile, by arrange Preparation rate is stored in memorizer 92.Processor 91 continues to be calculated institute according to described file size and described unit burst size State the real space size that subfile takies.According to described file size and described preparation rate, it is calculated described subfile Theoretical allocation of free space size.According to described theoretical allocation of free space size and described unit burst size, it is calculated The actual allocation of free space size of described subfile.
Optionally, processor 91 is for obtaining theoretical allocation of free space size and the reality point of preservation from memorizer 92 Join free space size, and described theoretical allocation of free space size is exceeded the part of described actual allocation of free space size Count described accumulative remainder.Judge that described accumulative remainder, whether more than unit burst size, performs corresponding behaviour according to judged result Make.
Optionally, processor 91 is used for judging in described system firmware, whether whole subfiles have processed, according to judgement Result performs corresponding operating.
Optionally, processor 91 is used for judging whether described subfile is APP file, performs corresponding behaviour according to judged result Make.
The present invention by after the writing address of a subfile plus certain space size so that this subfile and its Default free space is left between subfile afterwards, in system firmware escalation process, even if the subfile ratio of redaction The space that the same subfile of legacy version takies is big, it is not required that the next subfile after this subfile is copied to caching District, it is to avoid the situation that file is overlapping occurs in system firmware escalation process, effectively reduce in system firmware escalation process time Between expense and disk buffering expense.
The foregoing is only embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every utilization is originally Equivalent structure or equivalence flow process that description of the invention and accompanying drawing content are made convert, or are directly or indirectly used in what other were correlated with Technical field, is the most in like manner included in the scope of patent protection of the present invention.

Claims (10)

1. the generation method of a system firmware image file, it is characterised in that including:
A subfile in extraction system firmware, obtains the file size of described subfile;
Real space size and the sky of the actual distribution of described subfile that described subfile takies is obtained according to described file size Free space size;
The real space taken plus described subfile by described subfile writing address in system firmware image file is big The actual allocation of free space size of little and described subfile, obtains the next subfile after described subfile at system firmware Writing address in image file.
Generation method the most according to claim 1 a, it is characterised in that subfile in described extraction system firmware, Before obtaining the file size of described subfile, including:
Obtain the distribution situation of system firmware subfile, obtain described subfile according to described distribution situation and video at system firmware Writing address in file.
Generation method the most according to claim 1, it is characterised in that described obtain described Ziwen according to described file size Real space size and the actual allocation of free space size of described subfile that part takies include:
Described system firmware subregion is divided into the burst that multiple size is identical, and it is big that the size of each burst is defined as unit burst Little, wherein, a burst is used for a subfile in storage system firmware;
The preparation rate of described subfile is set, wherein, described preparation rate be free space size total in system firmware subregion with The ratio of the space size that whole subfiles take in described system firmware subregion;
It is calculated the real space size that described subfile takies according to described file size and described unit burst size;
According to described file size and described preparation rate, it is calculated the theoretical allocation of free space size of described subfile;
According to described theoretical allocation of free space size and described unit burst size, the reality being calculated described subfile is divided Join free space size.
Generation method the most according to claim 3, it is characterised in that described method includes:
The accumulative remainder of definition;
The part that described theoretical allocation of free space size exceeds described actual allocation of free space size is counted described accumulative Remainder;
The real space taken plus described subfile by described subfile writing address in system firmware image file is big After the free space size of the actual distribution of little and described subfile, including:
Judge that described subfile whether more than unit burst size, is the most then videoed civilian by described accumulative remainder at system firmware Writing address in part adds unit burst size, obtains the next subfile after described subfile and videos at system firmware Writing address in file;If it is not, execution subsequent step.
Generation method the most according to claim 1, it is characterised in that described in obtain the next Ziwen after described subfile After part writing address in system firmware image file, including:
Judge that in described system firmware, whether whole subfiles have processed, and if so, terminate flow process;If it is not, return extraction system A subfile in firmware, obtains the step of the file size of described subfile, and continues subsequent step.
Generation method the most according to claim 3, it is characterised in that the described preparation rate arranging described subfile includes:
Judge whether described subfile is APP file, the most then the preparation rate of described subfile be set to the first preparation rate, If it is not, then the preparation rate of described subfile is arranged the second preparation rate;
Wherein, described first preparation rate is more than described second preparation rate.
Generation method the most according to claim 3, it is characterised in that described divide according to described file size and described unit Sheet size be calculated real space size that described subfile takies particularly as follows:
According to described file size and described unit burst size, obtain the burst number that described subfile takies, by described point Sheet number is multiplied by described unit burst size, obtains the real space size that described subfile takies;
Wherein, the real space size that described subfile takies is the integral multiple of described unit burst size.
Generation method the most according to claim 3, it is characterised in that described according to described file size with described preparation Rate, is calculated the free space size of described subfile theory distribution;Free space according to the distribution of described subfile theory Size and described unit burst size, be calculated the free space size of the actual distribution of described subfile particularly as follows:
Described file size is multiplied by described preparation rate, obtains the free space size of described subfile theory distribution;
The free space size described subfile theory distributed, divided by described unit burst size, obtains a quotient;By described Quotient is multiplied by described unit burst size, obtains the free space size of the actual distribution of described subfile.
9. the generation system of a system firmware image file, it is characterised in that described system includes: subfile acquisition module, A subfile in extraction system firmware, obtains the file size of described subfile;
Computing module, for obtaining, according to described file size, real space size and the described subfile that described subfile takies The free space size of actual distribution;
Writing address arranges module, for by described subfile writing address in system firmware image file plus described son Real space size that file takies and the actual allocation of free space size of described subfile, under obtaining after described subfile One subfile writing address in system firmware image file.
Generation system the most according to claim 9, it is characterised in that described system also includes:
Complete judge module, be used for judging in described system firmware, whether whole subfiles have processed;
Operation executing module, terminates flow process for completing the judged result of judge module described in basis, or obtains to described subfile Delivery block sends the instruction continuing executing with action.
CN201610619082.7A 2016-07-29 2016-07-29 A kind of generation method and system of system firmware image file Active CN106250188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610619082.7A CN106250188B (en) 2016-07-29 2016-07-29 A kind of generation method and system of system firmware image file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610619082.7A CN106250188B (en) 2016-07-29 2016-07-29 A kind of generation method and system of system firmware image file

Publications (2)

Publication Number Publication Date
CN106250188A true CN106250188A (en) 2016-12-21
CN106250188B CN106250188B (en) 2019-08-23

Family

ID=57606866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610619082.7A Active CN106250188B (en) 2016-07-29 2016-07-29 A kind of generation method and system of system firmware image file

Country Status (1)

Country Link
CN (1) CN106250188B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015817A (en) * 2017-05-25 2017-08-04 孙文现 A kind of method of equipment firmware aerial upgrade
CN107391184A (en) * 2017-07-11 2017-11-24 上海斐讯数据通信技术有限公司 Based on wireless device generation firmware method, system and firmware upgrade method, system
CN110045978A (en) * 2019-04-16 2019-07-23 杭州阿姆科技有限公司 A kind of firmware of different type SSD equipment unifies upgrade method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050257023A1 (en) * 2002-11-18 2005-11-17 Doongo Technologies, Inc. Device memory management during electronic file updating
CN1991763A (en) * 2006-01-01 2007-07-04 中兴通讯股份有限公司 Method for downloading a plurality of FPGA files by one CPU program
US20080091871A1 (en) * 2006-10-12 2008-04-17 Alan David Bennett Non-volatile memory with worst-case control data management
CN101201794A (en) * 2006-12-15 2008-06-18 中兴通讯股份有限公司 Method and system for determining EMS memory occupation of software
CN101539885A (en) * 2009-04-23 2009-09-23 大唐微电子技术有限公司 Soft ware autonomous air upgrading method of wireless communication module, device and system thereof
CN102799452A (en) * 2012-06-29 2012-11-28 深圳市安普尔科技有限公司 Method and device for upgrading system software
CN105335181A (en) * 2014-08-06 2016-02-17 中兴通讯股份有限公司 OTA upgrade realization method and terminal
CN105487888A (en) * 2015-11-26 2016-04-13 武汉光迅科技股份有限公司 Method for generating upgrade file in system upgrade and/or application upgrade

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050257023A1 (en) * 2002-11-18 2005-11-17 Doongo Technologies, Inc. Device memory management during electronic file updating
CN1991763A (en) * 2006-01-01 2007-07-04 中兴通讯股份有限公司 Method for downloading a plurality of FPGA files by one CPU program
US20080091871A1 (en) * 2006-10-12 2008-04-17 Alan David Bennett Non-volatile memory with worst-case control data management
CN101201794A (en) * 2006-12-15 2008-06-18 中兴通讯股份有限公司 Method and system for determining EMS memory occupation of software
CN101539885A (en) * 2009-04-23 2009-09-23 大唐微电子技术有限公司 Soft ware autonomous air upgrading method of wireless communication module, device and system thereof
CN102799452A (en) * 2012-06-29 2012-11-28 深圳市安普尔科技有限公司 Method and device for upgrading system software
CN105335181A (en) * 2014-08-06 2016-02-17 中兴通讯股份有限公司 OTA upgrade realization method and terminal
CN105487888A (en) * 2015-11-26 2016-04-13 武汉光迅科技股份有限公司 Method for generating upgrade file in system upgrade and/or application upgrade

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015817A (en) * 2017-05-25 2017-08-04 孙文现 A kind of method of equipment firmware aerial upgrade
CN107015817B (en) * 2017-05-25 2021-06-01 北京君泊网络科技有限责任公司 Method for upgrading equipment firmware in air
CN107391184A (en) * 2017-07-11 2017-11-24 上海斐讯数据通信技术有限公司 Based on wireless device generation firmware method, system and firmware upgrade method, system
CN110045978A (en) * 2019-04-16 2019-07-23 杭州阿姆科技有限公司 A kind of firmware of different type SSD equipment unifies upgrade method and system

Also Published As

Publication number Publication date
CN106250188B (en) 2019-08-23

Similar Documents

Publication Publication Date Title
US20230138736A1 (en) Cluster file system-based data backup method and apparatus, and readable storage medium
CN103098014B (en) Storage system
US7853759B2 (en) Hints model for optimization of storage devices connected to host and write optimization schema for storage devices
CN104699423B (en) The method and apparatus that drive is bound in linux system
US20050182796A1 (en) Method and system for protecting data associated with a replaced image file during a re-provisioning event
US9582433B2 (en) Disk array flushing method and disk array flushing apparatus
US6804761B1 (en) Memory allocation system and method
US8898677B2 (en) Data arrangement calculating system, data arrangement calculating method, master unit and data arranging method
CN103077197A (en) Data storing method and device
CN103455526A (en) ETL (extract-transform-load) data processing method, device and system
CN110750356B (en) Multi-core interaction method, system and storage medium suitable for nonvolatile memory
CN106550014A (en) Node upgrade method and device in server cluster
CN103218176A (en) Data processing method and device
CN106227621A (en) The data back up method of logic-based volume management simplification volume and system
CN103412822A (en) Operation method of non-volatile RAM, data operation method and relevant device
CN110109868A (en) Method, apparatus and computer program product for index file
CN106250188A (en) A kind of generation method and system of system firmware image file
CN102609305A (en) Method for sharing internal memory in server cluster
US8327111B2 (en) Method, system and computer program product for batched virtual memory remapping for efficient garbage collection of large object areas
CN111124254A (en) Method, electronic device and program product for scheduling storage space reclamation requests
CN109213429B (en) Storage management method and device
KR102114245B1 (en) Graphics state manage apparatus and method
CN1573747A (en) Shadow paging
CN104517067A (en) Method, device and system for data access
CN103119567A (en) Systems and methods for managing a virtual tape library domain

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant