CN106909398A - The compression method and device of a kind of executable file - Google Patents
The compression method and device of a kind of executable file Download PDFInfo
- Publication number
- CN106909398A CN106909398A CN201710142482.8A CN201710142482A CN106909398A CN 106909398 A CN106909398 A CN 106909398A CN 201710142482 A CN201710142482 A CN 201710142482A CN 106909398 A CN106909398 A CN 106909398A
- Authority
- CN
- China
- Prior art keywords
- target data
- compression
- storage format
- data
- executable file
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/02—Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word
- H03M7/04—Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word the radix thereof being two
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses the compression method and device of a kind of executable file.Methods described includes:Analyze the functional attributes and storage format attribute of the executable file each several part data;According to the functional attributes, compressible target data in each several part data is identified;Storage format attribute according to the target data, obtains the Compression Strategies of the target data;According to the Compression Strategies, the target data is compressed, and updates the storage format attribute of the target data, the executable file after being compressed.By using above-mentioned technical proposal, can cause that the executable file after compression takes less memory space, reach the effect for saving hardware cost, improve the market competitiveness.
Description
Technical field
The embodiment of the present invention relates to field of embedded technology, more particularly to a kind of executable file compression method and device.
Background technology
With continuing to develop for science and technology, the competition of the industry such as TV is more and more fierce.Wherein, Cost Competition is very heavy
The one side wanted, how the reduces cost problem that to be also most companies be required for considers.
By taking television set manufacturing as an example, Cost Competition is concentrated mainly on hardware aspect.Software aspects generally by
Reduce the size of executable file, thus reduce the size in storage chip space reduce the material of television set storage hardware into
This.
In the prior art, usually according to the difference of executable file, determine different compression algorithms with to executable
File is compressed.However, when executable file is more, and after being compressed respectively to each executable file, it is also possible to exist
Memory space cannot store such case of the executable file after all compressions.Because, in each executable file
, it is necessary to be that extra memory space is opened up in compression and/or the execution of decompression algorithm in compression and/or decompression process, and work as
When executable file is more, performs compression and/or decompression algorithm additional storage space required in itself and also compare many, depositing
When storage space can not meet the requirement for performing compression and/or decompression algorithm, the effect of compression and/or decompression algorithm will be subject to
Influence, in turn results in storage device space increase shared by file so that the cost of storage executable file storage chip increases.
Therefore, the compress mode and compression efficiency of executable file of the prior art have much room for improvement.
The content of the invention
To solve above-mentioned Related Technical Issues, the present invention provides a kind of compression method and device of executable file, to carry
The compression ratio of executable file high, save storage executable file storage chip memory space, reach indirectly saving hardware into
This technique effect.
To achieve the above object, the embodiment of the present invention is adopted the following technical scheme that:
In a first aspect, the embodiment of the invention provides a kind of compression method of executable file, methods described includes:
Analyze the functional attributes and storage format attribute of the executable file each several part data;
According to the functional attributes, compressible target data in each several part data is identified;
Storage format attribute according to the target data, obtains the Compression Strategies of the target data;
According to the Compression Strategies, the target data is compressed, and updates the storage format of the target data
Attribute, the executable file after being compressed.
Second aspect, the embodiment of the invention provides a kind of device of executable file, and described device includes:
Attributive analysis module, functional attributes and the storage format category for analyzing the executable file each several part data
Property;
Target data identification module, it is compressible in each several part data for according to the functional attributes, identifying
Target data;
Compression Strategies determining module, for the storage format attribute according to the target data, obtains the target data
Compression Strategies;
Compression module, for according to the Compression Strategies, being compressed to the target data, and updates the number of targets
According to storage format attribute, the executable file after being compressed.
The compression method and device of a kind of executable file provided in an embodiment of the present invention, analyze executable file each first
The functional attributes and storage format attribute of partial data, according to the functional attributes of each several part data, may recognize that each several part data
In compressible target data;Storage format attribute according to target data, can obtain the Compression Strategies of target data;According to pressure
Contracting strategy, is compressed, and update the storage format attribute of target data to compressible target data, after being compressed can
Perform file.By using above-mentioned technical proposal, relative to prior art, can cause the executable file after compression take compared with
Few memory space, reaches the technique effect of the hardware cost for saving storage executable file, and the market of product is improved indirectly
Competitiveness.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, institute in being described to the embodiment of the present invention below
The accompanying drawing for needing to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the invention
Example, for those of ordinary skill in the art, on the premise of not paying creative work, can also implement according to the present invention
The content and these accompanying drawings of example obtain other accompanying drawings.
Fig. 1 is a kind of flow chart of the compression method of executable file that the embodiment of the present invention one is provided;
Fig. 2 a are to write a kind of executable binary file data generated after FLASH operations;
Fig. 2 b are to write another the executable binary file data generated after FLASH operations;
Fig. 3 a are the data store organisation distribution map of TV FLASH internal memories before the optimization that the embodiment of the present invention one is provided;
Fig. 3 b are the data store organisation distribution map of TV FLASH internal memories after the optimization that the embodiment of the present invention one is provided;
Fig. 4 is a kind of flow chart of the compression method of executable file that the embodiment of the present invention two is provided;
Fig. 5 be a kind of executable file that provides of the embodiment of the present invention two before compression after the contrast of shared memory space show
It is intended to;
Fig. 6 is a kind of structured flowchart of the compression set of executable file that the embodiment of the present invention three is provided.
Specific embodiment
For make present invention solves the technical problem that, the technical scheme that uses and the technique effect that reaches it is clearer, below
The technical scheme of the embodiment of the present invention will be described in further detail with reference to accompanying drawing, it is clear that described embodiment is only
It is a part of embodiment of the invention, rather than whole embodiments.Based on the embodiment in the present invention, those skilled in the art exist
The every other embodiment obtained under the premise of creative work is not made, the scope of protection of the invention is belonged to.
Embodiment one
Fig. 1 is a kind of flow chart of the compression method of executable file that the embodiment of the present invention one is provided.The present embodiment
Method can be performed by the compression set of such as executable file such as TV and/or TV set-top box, wherein, the method can be by portion
Affix one's name to software and/or hardware in such as TV and/or TV set-top box to implement, the software and/or hardware can typically be integrated in
In certain embedded system.As shown in figure 1, the method may include steps of:
S110:Analyze the functional attributes and storage format attribute of executable file each several part data.
Wherein, executable file refers to the file that load and execution is carried out by operating system, and that is mentioned in the present embodiment holds
Style of writing part is preferably executable binary system (bin) file.Above-mentioned executable binary file can be to pass through compression
The binary file for the treatment of, or the binary file without overcompression treatment.Wherein, those skilled in the art can be according to can
The compressing mark carried in the binary file of execution judges whether the binary file is compressed.
Exemplary, the storage format attribute of executable file each several part data can be from each several part data correspondence storage road
Obtained in the identifier of the mark partial data correspondence storage format added in footpath, generally include following three kinds of situations:
1st, any compressing mark has been not added with it in correspondence store path;
For the executable file that any compressing mark is not added with each several part data correspondence store path, compiler exists
Normal process of compilation need to be only completed during compiling this document, without doing any compression and decompression.
2nd, it is added with the relatively low compressing mark of compression ratio in correspondence store path;
Preferably, the default storage format attribute in the embodiment of the present invention refers to and is preset according to first in store path
What the executable file that storage format (such as identifier "-g ") or the second default storage format (such as identifier " -7 ") are preserved had
Characteristic attribute.The corresponding compression ratio of above two storage format is different, and the first corresponding compression ratio of default storage format is relatively low, the
The two corresponding compression ratios of default storage format are higher.Specifically, when the marker character of the first default storage format is "-g ".If
When detecting the presence of "-g " identifier in the corresponding store path of certain partial data of executable binary file, then explanation is compiled
Device is translated during the partial data for compiling the executable binary file, the side of smaller compression ratio is pressed to the partial data
Formula carries out overcompression treatment, and the binary file is stored to save the memory space shared by the binary file, and then save
The material cost of hardware (such as storage chip).
3rd, it is added with compression ratio compressing mark higher in correspondence store path.
Preferably, when the identifier of the second default storage format is " -7 ".If certain part of executable binary file
If detect the presence of " -7 " identifier in the corresponding store path of data, illustrate that compiler is compiling the binary file
During the partial data, overcompression treatment is carried out in the way of larger compression ratio to the partial data, be compared to identifier
The default storage format of the first of "-g ", above-mentioned compress mode can further save depositing shared by the executable binary file
Storage space, the material cost of the binary file hardware is stored to save.
It should be noted that because compression algorithm and technology are numerous, executable binary file each several part data are deposited
Storage form is not limited to three kinds of forms enumerated above.
S120:According to functional attributes, compressible target data in each several part data is identified.
Further, it is necessary to according to the work(of each several part data before executable binary file each several part is by compression
Can attribute this fundamental characteristics, judge whether each several part data in the executable binary file can be compressed.Show
Example property, the functional attributes of each several part data in executable binary file may include but be not limited to such as storage attribute, pressure
Contracting or decompression attribute etc..In specific operation process, for executable with decompression attribute or with flag attribute
Binary file data, then cannot run counter to its data attribute it is done compression treatment;And for storage attribute
Data in binary file, then can be compressed to save memory space to it.
Exemplary, illustrated by taking the practical structures of system as an example below, the preferred NOS of the system (No Operating
System, does not have operating system) system:
00113:#define IMG_INFO_OFFSET 0x21000
00112:#difine MAGIC_BOOTLOADER 0x55AA1234
00113:#define MAGIC_APP 0x55AA5678
00114:#define MAGIC_IMAGE_END 0x55AAABCD
Fig. 2 a are to write a kind of executable two generated after flash memory (Flash Memory, general abbreviation FLASH) operation to enter
File data processed.As shown in Figure 2 a, operated by entering row write FLASH to the structure, in actual generation file,
0x21000 is the data being actually written into.It is flag code part because the address is corresponding, then the file data for generating cannot be by
Compression, it is necessary to stored with the actual byte-sized for taking.
Exemplary, for following executable binary file datas:
00303:#difine BIN_PACKAGE_HEADER_ID0 0x54454C09
00304:#difine BIN_PACKAGE_HEADER_ID1 0x58336900
00289:PlaceU32_ (BIN_PACKAGE_HEADER_ID0),
PlaceU32_(BIN_PACKAGE_HEADER_ID1)
Specifically, Fig. 2 b are to write another the executable binary file data generated after FLASH operations.Such as Fig. 2 b institutes
Show, it will be appreciated by persons skilled in the art that in the binary file, the corresponding data of address 0002100h and write-in
Data (54454C09 and 58336900) are consistent, then show that the partial data in the binary file can be what is compressed.
It is analyzed by the functional attributes of the binary file each several part data to can perform, this can be quickly recognized
The target data that can be compressed in binary file, so that quick lock in is compressible, i.e., pending object reduces process range.
S130:Storage format attribute according to target data, obtains the Compression Strategies of target data.
Exemplary, the corresponding Compression Strategies of different storage format attributes are different.For example:
If being not added with the storage attribute of any compressing mark in target data correspondence store path, the number of targets is illustrated
According to not compressing completely.Accordingly, such that it is able to draw the next step Compression Strategies of the target data, you can with according to certain pressure
Contracting mode is compressed to the partial data, so as to reduce the memory space of the target data;
If target data is stored in respective path according to the form of the first default storage format (such as identifier is "-g "),
Then explanation target data is compressed by the relatively low compress mode of compression ratio.Accordingly, it can be deduced that the target data is next
The Compression Strategies of step, you can compress the partial target data by certain compress mode higher than current compression rate;
If target data is stored in respective path according to the form of the second default storage format (such as identifier is " -7 "),
Then explanation target data can currently be compressed by certain compression ratio compress mode higher.Accordingly, it may be possible to draw the mesh
The Compression Strategies of data next step are marked, that is, is possible to that the partial target number cannot be lifted by changing compress mode, further again
According to compression ratio.
S140:According to Compression Strategies, target data is compressed, and updates the storage format attribute of target data, obtained
Executable file after to compression.
For compressible target data, according to fixed Compression Strategies in above-mentioned steps, place can be compressed to it
Reason, while the storage format attribute in the corresponding store path of updatable object data so that target data after compression is deposited
The storage attribute of a configuration is corresponding with current Compression Strategies.Consequently facilitating being selected and current compression strategy when the target data is performed
Corresponding decompression strategy.Therefore, by recognizing the storage format attribute of target data, it may be determined that go out the target data whether by
Compression, or processed through overcompression according to what kind of mode.
Further, after the executable file after compression is stored in FLASH, for the remaining memory spaces of FLASH,
Data can be preserved by making full use of its remaining space so that the utilization rate of the FLASH memory headrooms reaches maximum.Specifically,
Its optimization method is as follows:
Fig. 3 a are the data store organisation distribution map of TV FLASH internal memories before the optimization that the embodiment of the present invention one is provided.Such as
Shown in Fig. 3 a, in the memory space of 0-57BANK (storage cell), the executable file of main storage software, so executable text
The size of part is 58 × 64K=3712K to the maximum.If the size of executable file is more than this space, will there is covering number
According to the risk in area.And for the size then according to practical structures body of the data beyond executable file and the channel number of reality
Carry out the distribution of memory space.After total data storage is completed, the only remaining free space of 2K, i.e. memory space surplus
It is not enough.Therefore, in order to optimize to reach the requirement simplified to memory space, need to be saved again in 7 BANK in fig. 3 a
Go out a BANK and carry out data storage.Specific optimization process is as follows:
By analysis, in the 63rd BANK, real data only have 304 BYTE, but the memory space of FLASH is
Divided with BANK as unit, so, the data of 304 BYTE occupy whole 63rd in the 63rd BANK
BANK, causes the waste of FLASH memory space resources.Fig. 3 b are TV FLASH after the optimization that the embodiment of the present invention one is provided
The data store organisation distribution map of internal memory.As shown in Figure 3 b, by the HDCP that upgrades, can be by HDCP (High-
Bandwidth Digital Content Protection, HDCP) data of part directly write to the internal memory of regulation (such as
58 BANK) in.In this manner it is possible to save a BANK to deposit other program codes more.In addition, can also be by data
Storage mode be revised as the mode not preserved, whole form will be initialized in system initialization, then switch it is different
During sequential, data can be directly loaded from form, so can save a BANK out again.Therefore, by using above-mentioned optimization
The mode of Memory Allocation, can reach the technique effect for further saving memory space.
Optionally, the method for saving memory space, it will be appreciated by persons skilled in the art that in rear onward encoding
The picture that sequence need not be used in performing, can delete, or be compiled to picture by it in routine data
The compression ratio of Shi Xiugai pictures reduces the size of the executable file of generation picture, and then further required for saving program
Memory space.
Optionally, also directly deletion can be revised as by the pattern that is shielded the code that need not be performed in program
This part is shielded the pattern that makes it be not carried out code, reaches the technology effect for further saving executable file memory space
Really.Because the technological means of the shielding code taken does not perform this partial code simply, but in former executable binary system
In file, the code being not carried out that this part is shielded still is physically present in former executable binary file, institute
Certain amount of physical memory still can be occupied with the code that this part is shielded.If for being shielded deliberately to be not carried out
Code, take the form for directly deleting code, then because code is deleted by physical, be not carried out compared to shielding
Technological means, deleting code then can further save the memory space of executable binary file.
A kind of compression method of executable file is present embodiments provided, in the work(of analysis executable file each several part data
After energy attribute and storage format attribute, the functional attributes such as storage, compression or decompression according to executable file each several part data,
May recognize that the target data that can be compressed in the executable file each several part data.Storage format category according to target data
Property, can obtain the Compression Strategies of target data.Wherein, Compression Strategies may include not to be compressed, be compressed, and be pressed according to than original
The larger new compress mode of shrinkage is compressed, and is compressed according to new compress mode more less than former compression ratio
Situation.According to Compression Strategies, target data is compressed, and updates the storage format attribute of target data, after being compressed
Executable file.By using above-mentioned technical proposal, can cause that the executable file after compression takes less storage empty
Between, the technique effect of the storage hardware material cost required for saving executable file is reached, so as to lift corresponding producing indirectly
The market competitiveness of product.
Embodiment two
Fig. 4 is a kind of flow chart of the compression method of executable file that the embodiment of the present invention two is provided.The present embodiment two
On the basis of embodiment one, " the storage format attribute according to target data, obtains number of targets to S130 the step of to embodiment one
According to Compression Strategies " further optimized, reference picture 4, the embodiment of the present invention two specifically includes following steps:
S210:Analyze the functional attributes and storage format attribute of executable file each several part data.
S220:According to functional attributes, compressible target data in each several part data is identified.
S230:Judge whether currently stored form matches with default storage format, if so, then performing step S240;It is no
Then, then step S260 is performed.
Exemplary, have been compressed place because the compressible target data identified by step S220 is likely to be
Data after reason, it is also possible to without the data of any compression.Therefore, by by the currently stored form of target data with it is pre-
If storage format compares, if the two is not corresponded, it is likely that show that target data is the data without overcompression treatment.If working as
Preceding storage format matches with any default storage format, then it is according to default storage format correspondence that current target data can be explained
Compression ratio through overcompression process after data.Therefore step 230 can be as the Compression Strategies for determining current target data
Basis, Compression Strategies determination after, may be selected suitable compress mode current target data is further compressed,
And then save the memory space shared by target data.
S240:Judge that whether currently stored form the first default storage format corresponding with the first Compression Strategies matches,
If so, then performing step S250;Otherwise, then step S260 is performed.
Exemplary, on the premise of the currently stored form of target data is matched with default storage format, if further
Judge that currently stored form the first default storage format (such as identifier is "-g ") corresponding with the first Compression Strategies matches,
Target data then can be explained and have passed through compression treatment according to the first Compression Strategies.Now, target can be changed according to the actual requirements
The Compression Strategies of data, and the former first default storage format (such as identifier is "-g ") correspondingly to target data is carried out simultaneously
Modification, to lift the compression ratio of target data, reaches saving executable file memory space, saves the technology of storage material cost
Effect.
Exemplary, can also determine whether that whether currently stored form corresponding with the second Compression Strategies second is preset
Storage format (such as identifier is " -7 ") matches, if so, target data then can be explained be have passed through according to the second Compression Strategies
Compression is processed.Now, also dependent on actual demand, the Compression Strategies of target data are changed, and simultaneously correspondingly to target data
The former second default storage format (such as identifier is " -7 ") modify.
S250:According to the second Compression Strategies compression goal data corresponding with the second default storage format, wherein, the second pressure
The tactful corresponding compression ratio that contracts is more than the corresponding compression ratio of the first Compression Strategies, continues executing with step S270.
Exemplary, if it is pre- that the default pre- storage form (such as identifier is "-g ") of first in target data is revised as into second
If storage format (such as identifier for " -7), then the compression ratio of target data can be lifted, save memory space.Specifically, Fig. 5 is
A kind of executable file that the embodiment of the present invention two is provided before compression after shared memory space contrast schematic diagram.Such as Fig. 5 institutes
Show, unpressed file (vdplayer.bin) needed in memory space take file in itself size to save memory space
(1270KB);And for the file (vdplayer.bin) after compression, then occupy less a part of memory space (380KB).
It is exemplary, under some particular cases, for some target datas, according to actual needs, if without or it is unsuitable
It is compressed by the way of larger compression ratio, then the second default storage format (such as identifier is " -7 ") can be revised as first
Default storage format (such as identifier is "-g "), it is saved with the characteristic according to target data in itself shared by memory space.
S260:According to default storage format, the Compression Strategies of target data are determined, continue executing with step S270.
Exemplary, if the currently stored form of target data is not corresponded with default storage format, can be shown that target
Data are processed without overcompression.Now, can be by default storage format (for example, can also be able to be for the first default storage format
Second default storage format) it is added in the path of target data correspondence storage, in compression goal data, editing machine then can root
According to the corresponding compress mode compression goal data of different storage formats, and the target data of different compression ratios is obtained, so that save can
The memory space of target data in file is performed, the hardware cost required for reducing storage executable file.
S270:According to Compression Strategies, target data is compressed, and updates the storage format attribute of target data, obtained
Executable file after to compression.
The present embodiment two is deposited by the currently stored form to target data on the basis of above-described embodiment with default
Storage form is matched, and according to matching result, takes different Compression Strategies, and according to selected Compression Strategies, accordingly
The former storage format attribute of current target data is added or changed to new storage format attribute, such that it is able to according to reality
Need, correspondingly add or change the compress mode of target data, and then the compression of executable file target data can be lifted
Rate, memory space shared by saving target data, reaches the technique effect for saving storage material cost indirectly.
The following is the embodiment of the compression set of executable file provided in an embodiment of the present invention, the compression of executable file
The compression method that device provides executable file with the various embodiments described above belongs to same inventive concept.
Embodiment three
Fig. 6 is a kind of structured flowchart of the compression set of executable file that the embodiment of the present invention three is provided.The device can
Realized by being deployed in such as the software and/or hardware in TV and/or TV set-top box, wherein, the device can typically be integrated in
Such as in the embedded system of TV and/or TV set-top box hardware entities.
As shown in fig. 6, the device includes:Attributive analysis module 310, target data identification module 320, Compression Strategies determine
Module 330 and compression module 340.Wherein,
Attributive analysis module 310, functional attributes and storage format for analyzing the executable file each several part data
Attribute;
Target data identification module 320, it is compressible in each several part data for according to the functional attributes, identifying
Target data;
Compression Strategies determining module 330, for the storage format attribute according to the target data, obtains the number of targets
According to Compression Strategies;
Compression module 340, for according to the Compression Strategies, being compressed to the target data, and updates the mesh
Mark the storage format attribute of data, the executable file after being compressed.
A kind of compression set of executable file is present embodiments provided, executable file each several part data are analyzed first
The functional attributes such as functional attributes and storage format attribute, storage, compression or decompression according to executable file each several part data,
May recognize that compressible target data in the executable file each several part data.Storage format attribute according to target data,
Can obtain the Compression Strategies of target data.Wherein, Compression Strategies may include not to be compressed, be compressed, and be compressed according to than original
The larger new compress mode of rate is compressed, and the feelings such as is compressed according to new compress mode more less than former compression ratio
Condition.According to Compression Strategies, target data is compressed, and updates the storage format attribute of target data, after being compressed
Executable file.By using above-mentioned technical proposal, can cause that the executable file after compression takes less memory space,
The technique effect of the storage hardware material cost required for saving executable file is reached, so as to improve corresponding product indirectly
The market competitiveness.
On the basis of above-described embodiment, the Compression Strategies determining module 330 may further include:
Compression Strategies determining unit, if for the currently stored form and default storage format phase of the target data
Match somebody with somebody, then according to the currently stored form, determine the Compression Strategies of the target data.
On the basis of above-described embodiment, the Compression Strategies determining unit specifically for:
If the currently stored form corresponding with the first Compression Strategies first presets storage format matching, the mesh
Mark data Compression Strategies be:
The target data is compressed according to the second Compression Strategies corresponding with the second default storage format, wherein, described the
The corresponding compression ratio of two Compression Strategies is more than the corresponding compression ratio of first Compression Strategies.
On the basis of above-described embodiment, the Compression Strategies determining module 330 can also be specifically for:
If the currently stored form of the target data is mismatched with default storage format, according to default storage format,
Determine the Compression Strategies of the target data.
On the basis of above-described embodiment, the described first default storage format is "-g ", the described second default storage format
It is " -7 ".
The compression set of executable file provided in an embodiment of the present invention can perform what any embodiment of the present invention was provided
The compression method of executable file, possesses the corresponding functional module of execution method and corresponding beneficial effect.Not in above-mentioned implementation
The ins and outs of detailed description in example, reference can be made to the compression method of the executable file that any embodiment of the present invention is provided.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
More other Equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
1. a kind of compression method of executable file, it is characterised in that methods described includes:
Analyze the functional attributes and storage format attribute of the executable file each several part data;
According to the functional attributes, compressible target data in each several part data is identified;
Storage format attribute according to the target data, obtains the Compression Strategies of the target data;
According to the Compression Strategies, the target data is compressed, and updates the storage format attribute of the target data,
Executable file after being compressed.
2. method according to claim 1, it is characterised in that the storage format attribute according to the target data,
The step of Compression Strategies for obtaining the target data, includes:
If the currently stored form of the target data matches with default storage format, according to the currently stored form,
Determine the Compression Strategies of the target data.
3. method according to claim 2, it is characterised in that described according to the currently stored form, determines the mesh
The step of marking the Compression Strategies of data, including:
If the currently stored form corresponding with the first Compression Strategies first presets storage format matching, the number of targets
According to Compression Strategies be:
The storage format corresponding second Compression Strategies compression target data is preset according to second, wherein, second pressure
The tactful corresponding compression ratio that contracts is more than the corresponding compression ratio of first Compression Strategies.
4. method according to claim 1, it is characterised in that the storage format attribute according to the target data,
The step of Compression Strategies for obtaining the target data, also includes:
If the currently stored form of the target data is mismatched with default storage format, according to default storage format, it is determined that
The Compression Strategies of the target data.
5. method according to claim 3, it is characterised in that
Described first default storage format is-g, and the described second default storage format is -7.
6. a kind of compression set of executable file, it is characterised in that described device includes:
Attributive analysis module, functional attributes and storage format attribute for analyzing the executable file each several part data;
Target data identification module, for according to the functional attributes, identifying compressible target in each several part data
Data;
Compression Strategies determining module, for the storage format attribute according to the target data, obtains the pressure of the target data
Contracting strategy;
Compression module, for according to the Compression Strategies, being compressed to the target data, and updates the target data
Storage format attribute, the executable file after being compressed.
7. device according to claim 6, it is characterised in that the Compression Strategies determining module includes:
Compression Strategies determining unit, if matching for the currently stored form and default storage format of the target data,
According to the currently stored form, the Compression Strategies of the target data are determined.
8. device according to claim 7, it is characterised in that the Compression Strategies determining unit specifically for:
If the currently stored form corresponding with the first Compression Strategies first presets storage format matching, the number of targets
According to Compression Strategies be:
The storage format corresponding second Compression Strategies compression target data is preset according to second, wherein, second pressure
The tactful corresponding compression ratio that contracts is more than the corresponding compression ratio of first Compression Strategies.
9. device according to claim 6, it is characterised in that the Compression Strategies determining module specifically for:
If the currently stored form of the target data is mismatched with default storage format, according to default storage format, it is determined that
The Compression Strategies of the target data.
10. device according to claim 8, it is characterised in that
Described first default storage format is-g, and the described second default storage format is -7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710142482.8A CN106909398B (en) | 2017-03-10 | 2017-03-10 | Compression method and device for executable file |
PCT/CN2018/076624 WO2018161791A1 (en) | 2017-03-10 | 2018-02-13 | Method and device for compressing executable file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710142482.8A CN106909398B (en) | 2017-03-10 | 2017-03-10 | Compression method and device for executable file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106909398A true CN106909398A (en) | 2017-06-30 |
CN106909398B CN106909398B (en) | 2020-10-16 |
Family
ID=59187689
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710142482.8A Active CN106909398B (en) | 2017-03-10 | 2017-03-10 | Compression method and device for executable file |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106909398B (en) |
WO (1) | WO2018161791A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018161791A1 (en) * | 2017-03-10 | 2018-09-13 | 深圳创维-Rgb电子有限公司 | Method and device for compressing executable file |
CN111078647A (en) * | 2019-11-22 | 2020-04-28 | 北京安兔兔科技有限公司 | Method and device for creating uncompressed file, method and device for testing magnetic disk and electronic equipment |
CN116909937A (en) * | 2023-05-11 | 2023-10-20 | 深圳三地一芯电子股份有限公司 | Flash memory capacity optimization method, device, equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556472A (en) * | 2003-12-31 | 2004-12-22 | 中兴通讯股份有限公司 | Compression of executable document in embedded type system and its loading method |
CN101977061A (en) * | 2010-10-19 | 2011-02-16 | 广西师范大学 | Lossless compression and decompression method for general information |
CN202134001U (en) * | 2011-03-07 | 2012-02-01 | 浪潮(北京)电子信息产业有限公司 | Executable file backup device |
CN102609360A (en) * | 2012-01-12 | 2012-07-25 | 华为技术有限公司 | Data processing method, data processing device and data processing system |
CN103186597A (en) * | 2011-12-29 | 2013-07-03 | 盛大计算机(上海)有限公司 | Method and system for expanding hard disk capacity |
CN103218224A (en) * | 2013-03-29 | 2013-07-24 | 东莞宇龙通信科技有限公司 | Method and terminal for improving utilization ratio of memory space |
CN103563255A (en) * | 2011-04-11 | 2014-02-05 | 马维尔国际贸易有限公司 | Method for compression and real-time decompression of executable code |
CN105677348A (en) * | 2016-01-04 | 2016-06-15 | 青岛海信信芯科技有限公司 | BOOT program storing method and device and BOOT program starting method and device |
CN106202213A (en) * | 2016-06-28 | 2016-12-07 | 深圳市恒扬数据股份有限公司 | A kind of FPGA binary file compression, decompressing method and compression, decompression device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957633A (en) * | 2011-08-19 | 2013-03-06 | 北京大学 | Data packing and transmitting method and data packing and transmitting system for message-oriented middleware |
CN104954497B (en) * | 2015-07-03 | 2018-09-14 | 浪潮(北京)电子信息产业有限公司 | Data transmission method and system in a kind of cloud storage system |
CN106909398B (en) * | 2017-03-10 | 2020-10-16 | 深圳创维-Rgb电子有限公司 | Compression method and device for executable file |
-
2017
- 2017-03-10 CN CN201710142482.8A patent/CN106909398B/en active Active
-
2018
- 2018-02-13 WO PCT/CN2018/076624 patent/WO2018161791A1/en active Application Filing
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556472A (en) * | 2003-12-31 | 2004-12-22 | 中兴通讯股份有限公司 | Compression of executable document in embedded type system and its loading method |
CN101977061A (en) * | 2010-10-19 | 2011-02-16 | 广西师范大学 | Lossless compression and decompression method for general information |
CN202134001U (en) * | 2011-03-07 | 2012-02-01 | 浪潮(北京)电子信息产业有限公司 | Executable file backup device |
CN103563255A (en) * | 2011-04-11 | 2014-02-05 | 马维尔国际贸易有限公司 | Method for compression and real-time decompression of executable code |
CN103186597A (en) * | 2011-12-29 | 2013-07-03 | 盛大计算机(上海)有限公司 | Method and system for expanding hard disk capacity |
CN102609360A (en) * | 2012-01-12 | 2012-07-25 | 华为技术有限公司 | Data processing method, data processing device and data processing system |
CN103218224A (en) * | 2013-03-29 | 2013-07-24 | 东莞宇龙通信科技有限公司 | Method and terminal for improving utilization ratio of memory space |
CN105677348A (en) * | 2016-01-04 | 2016-06-15 | 青岛海信信芯科技有限公司 | BOOT program storing method and device and BOOT program starting method and device |
CN106202213A (en) * | 2016-06-28 | 2016-12-07 | 深圳市恒扬数据股份有限公司 | A kind of FPGA binary file compression, decompressing method and compression, decompression device |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018161791A1 (en) * | 2017-03-10 | 2018-09-13 | 深圳创维-Rgb电子有限公司 | Method and device for compressing executable file |
CN111078647A (en) * | 2019-11-22 | 2020-04-28 | 北京安兔兔科技有限公司 | Method and device for creating uncompressed file, method and device for testing magnetic disk and electronic equipment |
CN111078647B (en) * | 2019-11-22 | 2023-09-22 | 北京安兔兔科技有限公司 | Method and device for creating uncompressed file and testing magnetic disk and electronic equipment |
CN116909937A (en) * | 2023-05-11 | 2023-10-20 | 深圳三地一芯电子股份有限公司 | Flash memory capacity optimization method, device, equipment and storage medium |
CN116909937B (en) * | 2023-05-11 | 2024-02-23 | 深圳三地一芯电子股份有限公司 | Flash memory capacity optimization method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106909398B (en) | 2020-10-16 |
WO2018161791A1 (en) | 2018-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103473099B (en) | Software upgrading method and system for mobile terminal | |
US7461198B2 (en) | System and method for configuration and management of flash memory | |
US6952820B1 (en) | Data compaction method for an intermediate object code program executable in an onboard system provided with data processing resources and corresponding onboard system with multiple applications | |
CN106909398A (en) | The compression method and device of a kind of executable file | |
CN105550123B (en) | Electronic device and its memory space management | |
CN111079917B (en) | Tensor data block access method and device | |
CN105096367B (en) | Optimize the method and device of Canvas rendering performances | |
CN111124464B (en) | Method, system and computer readable storage medium for differential upgrade of embedded system | |
CN105487907A (en) | Difference package manufacturing method and device | |
CN101840373B (en) | Data operating method and device | |
CN106327453B (en) | Method for splicing picture resources and picture resource splicing device | |
US8281289B2 (en) | Device, method, and program for generating and executing execution binary image, and computer-readable recording medium containing the execution binary image execution program | |
CN108122189A (en) | Vertex attribute compression and decompression in hardware | |
CN112764925A (en) | Data storage method, device, equipment and storage medium based on virtual memory | |
CN109634705A (en) | A kind of embedded device booting Logo updates, display methods and its system | |
CN108089821A (en) | A kind of method of micro controller data storage management | |
CN103632185A (en) | Covering film intelligent card with extended functions | |
CN109088636B (en) | Data processing method and system, electronic equipment and storage medium | |
CN102298534B (en) | Method for writing software into set-top box | |
CN112199042A (en) | Storage space management method, device, chip, equipment and storage medium | |
Li et al. | A new list compaction method | |
CN115795066A (en) | Method and related device for interconversion of iBootim image and PNG image | |
CN115328656A (en) | Dynamic memory intelligent expansion method, device, equipment and storage medium | |
CN115495020A (en) | File processing method and device, electronic equipment and readable storage medium | |
CN113032008B (en) | Electronic processing device and memory control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |