WO2018161791A1 - Method and device for compressing executable file - Google Patents

Method and device for compressing executable file Download PDF

Info

Publication number
WO2018161791A1
WO2018161791A1 PCT/CN2018/076624 CN2018076624W WO2018161791A1 WO 2018161791 A1 WO2018161791 A1 WO 2018161791A1 CN 2018076624 W CN2018076624 W CN 2018076624W WO 2018161791 A1 WO2018161791 A1 WO 2018161791A1
Authority
WO
WIPO (PCT)
Prior art keywords
compression
target data
storage format
attribute
executable file
Prior art date
Application number
PCT/CN2018/076624
Other languages
French (fr)
Chinese (zh)
Inventor
刘兆祥
Original Assignee
深圳创维-Rgb电子有限公司
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 深圳创维-Rgb电子有限公司 filed Critical 深圳创维-Rgb电子有限公司
Publication of WO2018161791A1 publication Critical patent/WO2018161791A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion 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/02Conversion 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/04Conversion 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

Definitions

  • the present disclosure relates to the field of embedded technologies, and in particular, to a method and an apparatus for compressing an executable file.
  • An executable file refers to a file that can be loaded and executed by the operating system.
  • the executable program is, for example, an .exe file, a .sys file, .com, and the like.
  • Different types of executables require different compression algorithms.
  • the executable itself takes up a certain amount of storage space. Additional compression of the compression and/or decompression algorithms is required during the compression/decompression of the executable.
  • the storage space is large, and the system may not provide enough storage space, so the compression efficiency is lowered, and the cost of the memory chip is increased.
  • the present disclosure provides a method and a device for compressing an executable file, so as to improve the compression ratio of the executable file, save storage space occupied by the executable file, and save hardware costs.
  • an embodiment of the present disclosure provides a method for compressing an executable file, the method comprising: analyzing a function attribute and a storage format attribute of each of a plurality of data portions of the executable file; The function attribute, the compressible data part is identified as the target data from the plurality of data parts; and the compression strategy of the target data is obtained according to the storage format attribute of the target data; according to the compression policy, The target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file.
  • an embodiment of the present disclosure provides an apparatus for executing an executable file, where the apparatus includes: an attribute analysis module, an attribute analysis module, a compression policy determination module, and a compression module.
  • the attribute analysis module is configured to analyze functional attributes and storage format attributes of each of the plurality of data portions of the executable file.
  • the attribute analysis module is configured to identify the compressible data portion from the plurality of data portions as the target data according to the function attribute.
  • the compression policy determination module is configured to obtain a compression strategy of the target data according to a storage format attribute of the target data.
  • the compression module is configured to compress the target data according to the compression policy, and update a storage format attribute of the target data to obtain a compressed executable file.
  • an embodiment of the present disclosure provides an electronic device.
  • the electronic device includes: one or more processors; and a memory coupled to the one or more processors.
  • the memory stores one or more programs, the one or more programs being configured to cause the one or more processors to perform the compression method of the executable file described above.
  • an embodiment of the present disclosure provides a non-transitory computer readable storage medium, wherein the storage medium stores computer instructions configured to cause a computer to execute the compression method of the executable file described above.
  • the method and device for compressing an executable file first analyzes a function attribute and a storage format attribute of each data part of an executable file, and can identify a compressible data part as a target according to a functional attribute of each data part. Data; according to the storage format attribute of the target data, a compression strategy of the target data is obtained; according to the compression strategy, the compressible target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file.
  • the compressed executable file occupies less storage space.
  • FIG. 1 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
  • Figure 2A shows an executable binary file data generated after a FLASH operation.
  • Figure 2B shows yet another executable binary file data generated after a FLASH operation.
  • FIG. 3A is a diagram showing a data storage structure distribution of a pre-optimized TV FLASH memory according to an embodiment of the present invention.
  • FIG. 3B is a schematic diagram of a data storage structure distribution of an optimized TV FLASH memory according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of comparison of storage space occupied by an executable file before and after compression according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of an apparatus for compressing an executable file according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
  • the method of the present embodiment can be performed by, for example, a television and/or a television set-top box, etc., which can be implemented by software and/or hardware deployed in a television and/or television set-top box, which software and/or hardware can generally be integrated In an embedded system.
  • the method may include steps S110 to S140.
  • the executable file refers to a file that is loaded and executed by the operating system, and the executable file mentioned in this embodiment is, for example, an executable binary file.
  • the above executable binary file may be a binary file that has been compressed, or a binary file that has not been compressed. The person skilled in the art can determine whether the binary file has been compressed according to the compression identifier carried in the executable binary file.
  • the storage format attribute of each data part of the executable file may be obtained from an identifier corresponding to the storage format corresponding to the data part in the corresponding storage path of each data part, and generally includes the following three cases.
  • the compiler only needs to complete the normal compilation processing when compiling the file, without any compression and decompression processing.
  • a compression flag with a lower compression ratio is added to the corresponding storage path
  • the preset storage format attribute in the embodiment of the present invention refers to a first preset storage format (such as an identifier "-g") or a second preset storage format (such as an identifier "-7") in the storage path.
  • the compression ratios corresponding to the two storage formats are different, the compression ratio corresponding to the first preset storage format is lower, and the compression ratio corresponding to the second preset storage format is higher.
  • the tag of the first preset storage format is “-g”. If a "-g" identifier is detected in the corresponding storage path of a portion of the data of the executable binary file, the compiler indicates that the data portion of the executable binary file is compiled during the data portion of the executable binary file.
  • the compression process is performed in a small compression ratio to save storage space occupied by the binary file, thereby saving material cost of hardware (such as a memory chip) storing the binary file.
  • a compression flag with a higher compression ratio is added to the corresponding storage path.
  • the compiler When the identifier of the second preset storage format is "-7". If the "-7" identifier is detected in the corresponding storage path of a certain data portion of the executable binary file, the compiler indicates that the data portion is larger in the process of compiling the data portion of the binary file. The compression ratio is compressed. Compared with the first preset storage format with the identifier “-g”, the above compression method can further save the storage space occupied by the executable binary file, thereby saving the storage of the binary. The material cost of the hardware of the file.
  • a compressible data portion is identified from the plurality of data portions as the target data according to the function attribute.
  • each data portion in the executable binary file before each part of the executable binary file is compressed, it is necessary to determine whether each data portion in the executable binary file can be compressed according to the basic characteristic of the functional attributes of each data portion.
  • the functional attributes of the various data portions in the executable binary file may include, but are not limited to, such as storage attributes, compression or decompression attributes, and the like.
  • data of an executable binary file having a decompressed attribute or a tag attribute may not be compressed against its data attribute; and for data in a binary file having a storage attribute, It can be compressed to save storage space.
  • the system preferably has a NOS (No Operating System) system:
  • FIG. 2A is an executable binary file generated after a flash memory (Flash Memory, generally referred to as FLASH) operation. As shown in FIG. 2A, by performing a write FLASH operation on the structure, in the actual generated file, 0x21000 is the actually written data. Since the address corresponds to the tag code portion, the generated file data cannot be compressed and must be stored in the actual occupied byte size.
  • FLASH flash Memory
  • FIG. 2B is another executable binary file generated after the FLASH operation is written.
  • the data corresponding to the address 0002100h is consistent with the written data (54454C09 and 58336900), indicating that the part of the data in the binary file is OK. Being compressed.
  • the target data that can be compressed in the binary file can be quickly identified, thereby quickly locking the compressible, ie, the object to be processed, and narrowing the processing range.
  • different storage format attributes correspond to different compression strategies.
  • the target data corresponds to a storage attribute in the storage path that is not added with any compression identifier, indicating that the target data is not compressed at all. According to this, the next compression strategy of the target data can be obtained, that is, the partial data can be compressed according to a certain compression manner, thereby reducing the storage space of the target data.
  • the target data is stored in the corresponding path in the form of a first preset storage format (eg, the identifier is "-g"), indicating that the target data is currently compressed in a compressed manner with a lower compression ratio.
  • a first preset storage format eg, the identifier is "-g”
  • the next compression strategy of the target data can be obtained, and the part of the target data can be compressed in a certain compression manner higher than the current compression ratio.
  • the target data is stored in the corresponding path according to the second preset storage format (eg, the identifier is “-7”), indicating that the target data is currently compressed by a compression method with a higher compression ratio. of. According to this, it is possible to obtain the next compression strategy of the target data, that is, it is possible to further reduce the compression ratio of the target data by replacing the compression method.
  • the second preset storage format eg, the identifier is “-7”
  • the compression processing may be performed, and the storage format attribute in the storage path corresponding to the target data may be updated, so that the storage format attribute of the compressed target data is The current compression strategy corresponds.
  • the decompression strategy corresponding to the current compression strategy is selected when the target data is executed. Therefore, by identifying the storage format attribute of the target data, it can be determined whether the target data is compressed or in what manner.
  • the remaining storage space of the FLASH can be saved by making full use of the remaining space, so that the utilization of the FLASH memory space is maximized.
  • the optimization method is as follows.
  • FIG. 3A is a diagram showing a data storage structure distribution of a pre-optimized TV FLASH memory according to an embodiment of the present invention.
  • the storage space is allocated according to the size of the actual structure and the actual number of channels. After all the data is stored, only 2K of free space remains, that is, the storage space is insufficient. Therefore, in order to optimize the storage space to achieve the streamlined requirements, one more BANK is saved in the seven BANKs in FIG. 3A to store data.
  • the optimization process is as follows.
  • FIG. 3B is a diagram showing a data storage structure distribution of an optimized TV FLASH memory according to Embodiment 1 of the present invention. As shown in FIG. 3B, by upgrading the HDCP, data of the High-bandwidth Digital Content Protection (HDCP) portion can be directly written into a predetermined memory (for example, the 58th BANK). In this way, you can save a BANK to store other program code.
  • HDCP High-bandwidth Digital Content Protection
  • the data storage mode can be modified to not save, the entire table will be initialized when the system is initialized, and then when the different timings are switched, the data can be directly loaded from the table, which saves a BANK. come out. Therefore, by adopting the above method of optimizing memory allocation, the technical effect of further saving storage space can be achieved.
  • the method for saving storage space can understand that for a picture that is not needed in subsequent program execution, it can be deleted in the program data or compiled in the picture.
  • the compression ratio of the image is modified to reduce the size of the executable file that generates the image, thereby further saving the storage space required by the program.
  • the mode of masking the code that is not required to be executed in the program may be modified to directly delete the mode in which the part is shielded from being executed, thereby achieving the technical effect of further saving the storage space of the executable file.
  • the technical means of masking the code is just not executing this part of the code, but in the original executable binary file, this part of the blocked executable code is still physically present in the original executable binary file, so this Part of the blocked code still occupies a certain amount of physical storage space. If the code is removed directly from the code that is being deliberately not executed, the code is physically removed, and the code is removed to further save the executable binary compared to the technical means of masking not being executed. The storage space for the file.
  • the embodiment provides a method for compressing an executable file. After analyzing functional attributes and storage format attributes of each data portion of the executable file, according to functional attributes such as storage, compression, or decompression of each data portion of the executable file, The target data that can be compressed in each data portion of the executable file is identified. According to the storage format attribute of the target data, a compression strategy of the target data can be obtained.
  • the compression strategy may include compression without compression, compression according to a new compression method with a larger original compression ratio, and compression according to a new compression method with a smaller original compression ratio.
  • the target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file.
  • FIG. 4 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
  • the present embodiment further optimizes the step S130 "the compression strategy of obtaining the target data according to the storage format attribute of the target data" on the basis of the embodiment shown in FIG. 1.
  • a method for compressing an executable file according to an embodiment of the present invention includes steps S210 to S270.
  • a compressible data portion is identified from the plurality of data portions as the target data according to the function attribute.
  • step S230 it is determined whether the current storage format matches the preset storage format. If the current storage format matches the preset storage format, step S240 is performed; if it is determined that the current storage format does not match the preset storage format, step S260 is performed. .
  • the compressible target data identified through step S220 may be data that has been subjected to compression processing, it may also be data that has not undergone any compression. Therefore, by comparing the current storage format of the target data with the preset storage format, if the current storage format of the target data does not match the preset storage format, it is possible to indicate that the target data is data that has not been compressed. If the current storage format matches any of the preset storage formats, the current target data is data that has undergone compression processing according to a compression ratio corresponding to the preset storage format. Therefore, the step 230 can be used as a basis for determining a compression strategy of the current target data. After the compression policy is determined, the current target data can be further compressed by selecting an appropriate compression mode, thereby saving the storage space occupied by the target data.
  • step S240 it is determined whether the current storage format matches the first preset storage format corresponding to the first compression policy, and if the current storage format matches the first preset storage format corresponding to the first compression policy, step S250 is performed; If the current storage format does not match the first preset storage format corresponding to the first compression policy, step S260 is performed.
  • the current storage format of the target data matches the preset storage format
  • the current storage format is further determined to be the first preset storage format corresponding to the first compression policy (eg, the identifier is “-g” Matching
  • the compression strategy of the target data may be changed according to actual needs, and the original first preset storage format of the target data (such as the identifier “-g”) may be modified accordingly to improve the compression ratio of the target data.
  • the compression strategy of the target data may also be changed according to actual needs, and the original second preset storage format (such as the identifier "-7") of the target data may be modified accordingly.
  • the target data is compressed according to the second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy, and step S270 is continued.
  • FIG. 5 is a schematic diagram of comparison of storage space occupied by an executable file before and after compression according to Embodiment 2 of the present invention.
  • an uncompressed file (vdplayer. Bin) takes up the size of the file itself in the storage space to save storage space (1270KB); for the compressed file (vdplayer.bin), it takes up a small amount of storage space (380KB).
  • the second preset storage format (such as the identifier is "-" 7") is modified to the first preset storage format (such as the identifier "-g") to save the storage space occupied by the target data itself.
  • step S260 determining a compression strategy of the target data according to the preset storage format, and proceeding to step S270.
  • the preset storage format (for example, the first preset storage format or the second preset storage format) may be added to the path corresponding to the target data, and when the target data is compressed, the editor may The target data is compressed according to the compression mode corresponding to different storage formats, and target data of different compression ratios are obtained, thereby saving the storage space of the target data in the executable file and reducing the hardware cost required for storing the executable file.
  • the current storage format of the target data is matched with the preset storage format, and different compression policies are adopted according to the matching result, and correspondingly added according to the selected compression policy. Or change the original storage format attribute of the current target data to the new storage format attribute, so that the compression mode of the target data can be added or changed according to actual needs, thereby improving the compression ratio of the target data of the executable file and saving the target data. Taking up storage space, indirectly achieves the technical effect of saving storage material costs.
  • the following is an embodiment of a compression device for an executable file provided by an embodiment of the present invention.
  • the compression device of the executable file and the compression method for providing the executable file according to the foregoing embodiments belong to the same inventive concept.
  • FIG. 6 is a structural block diagram of an apparatus for compressing an executable file according to an embodiment of the present invention.
  • the apparatus may be implemented by software and/or hardware deployed in, for example, a television and/or a television set top box, where the apparatus may generally be integrated into an embedded system of hardware entities such as televisions and/or television set top boxes.
  • the apparatus includes: an attribute analysis module 310, a target data identification module 320, a compression policy determination module 330, and a compression module 340.
  • the attribute analysis module 310 is configured to analyze function attributes and storage format attributes of each part of the executable file data
  • the target data identification module 320 is configured to identify, according to the function attribute, the compressible target data in each part of the data;
  • the compression policy determination module 330 is configured to obtain a compression strategy of the target data according to a storage format attribute of the target data.
  • the compression module 340 is configured to compress the target data according to the compression policy, and update a storage format attribute of the target data to obtain a compressed executable file.
  • the embodiment provides a compression device for an executable file, which first analyzes the function attributes and storage format attributes of each part of the executable file, and can identify the function according to the storage, compression or decompression of the data of each part of the executable file.
  • the target data that can be compressed in the data of each part of the executable file.
  • a compression strategy of the target data can be obtained.
  • the compression strategy may include compression without compression, compression according to a new compression method with a larger original compression ratio, and compression according to a new compression method with a smaller original compression ratio.
  • the target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file.
  • the compression policy determination module 330 may include: a compression policy determination unit.
  • the compression policy determining unit is configured to determine a compression policy of the target data according to the current storage format if the current storage format of the target data matches the preset storage format.
  • the compression policy determining unit is configured to:
  • the compression strategy of the target data is:
  • the target data is compressed according to a second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy.
  • the compression policy determining module 330 may further be specifically configured to:
  • the first preset storage format is “-g”
  • the second preset storage format is “-7”.
  • the present disclosure also provides an electronic device.
  • the electronic device can include one or more processors and a memory coupled to the one or more processors. (memory).
  • the memory is for storing instructions executable by the one or more processors, the instructions being executed by the one or more processors to cause the one or more processors to execute the executable file described above Compression method.
  • the electronic device can also include a communications interface (Communications Interface) and a bus.
  • a communications interface Communication Interface
  • the processor, the communication interface, and the memory can complete communication with each other through the bus.
  • the communication interface can be used for information transmission.
  • the processor can invoke logic instructions in the memory to perform the deployment method of the cloud platform of the above embodiment.
  • the logic instructions in the above-described memory may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • the technical solution of the present disclosure may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network) The device or the like) performs all or part of the steps of the method described in various embodiments of the present disclosure.
  • the foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • a medium that can store program code, or a transitory storage medium including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • Embodiments of the present disclosure provide a non-transitory computer readable storage medium, wherein the storage medium stores computer instructions configured to cause a computer to execute the compression method of the executable file described above.
  • the compression device of the executable file provided by the embodiment of the present invention can execute the compression method of the executable file provided by any embodiment of the present invention, and has the corresponding functional modules and corresponding beneficial effects of the execution method.
  • the compression method of the executable file provided by any embodiment of the present invention can execute the compression method of the executable file provided by any embodiment of the present invention, and has the corresponding functional modules and corresponding beneficial effects of the execution method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and device for compressing an executable file. The method comprises: analyzing a functional attribute and a storage format attribute of each data portion in a plurality of data portions of the executable file (S110); identifying, according to the functional attribute, a compressible data portion in the plurality of data portions to serve as target data (S120); obtaining, according to a storage format attribute of the target data, a compression strategy of the target data (S130); and compressing, according to the compression strategy, the target data, updating a storage format attribute of the target data, and obtaining a compressed executable file (S140). The technical solution is adopted to reduce a storage space occupied by an executable file.

Description

可执行文件的压缩方法及装置Executable file compression method and device 技术领域Technical field
本公开涉及嵌入式技术领域,尤其涉及一种可执行文件的压缩方法及装置。The present disclosure relates to the field of embedded technologies, and in particular, to a method and an apparatus for compressing an executable file.
背景技术Background technique
可执行文件(executable file)指的是可以由操作系统进行加载执行的文件。在Windows操作系统下,可执行程序例如是.exe文件.sys文件.com等。不同类型的可执行文件需要不同的压缩算法。可执行文件本身占用一定的存储空间。在可执行文件的压缩/解压缩过程中,还需要为压缩和/或解压缩算法提供额外的存储空间。在压缩/解压缩多个可执行文件时,需要存储空间较大,系统可能无法提供足够的存储空间,因此压缩效率降低,增加了存储芯片的成本。An executable file refers to a file that can be loaded and executed by the operating system. Under the Windows operating system, the executable program is, for example, an .exe file, a .sys file, .com, and the like. Different types of executables require different compression algorithms. The executable itself takes up a certain amount of storage space. Additional compression of the compression and/or decompression algorithms is required during the compression/decompression of the executable. When compressing/decompressing multiple executable files, the storage space is large, and the system may not provide enough storage space, so the compression efficiency is lowered, and the cost of the memory chip is increased.
发明内容Summary of the invention
为解决上述相关技术问题,本公开提供一种可执行文件的压缩方法及装置,以提高可执行文件的压缩率,节省可执行文件占用的存储空间,节约硬件成本。To solve the above related technical problem, the present disclosure provides a method and a device for compressing an executable file, so as to improve the compression ratio of the executable file, save storage space occupied by the executable file, and save hardware costs.
第一方面,本公开实施例提供了一种可执行文件的压缩方法,所述方法包括:分析所述可执行文件的多个数据部分中的每个数据部分的功能属性和存储格式属性;根据所述功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据;根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略;根据所述压缩策略,对所述目标数据进行压缩,并更新所述目标数据的存储格式属性,得到压缩后的可执行文件。In a first aspect, an embodiment of the present disclosure provides a method for compressing an executable file, the method comprising: analyzing a function attribute and a storage format attribute of each of a plurality of data portions of the executable file; The function attribute, the compressible data part is identified as the target data from the plurality of data parts; and the compression strategy of the target data is obtained according to the storage format attribute of the target data; according to the compression policy, The target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file.
第二方面,本公开实施例提供了一种可执行文件的装置,所述装置包括:属性分析模块,属性分析模块,压缩策略确定模块和压缩模块。In a second aspect, an embodiment of the present disclosure provides an apparatus for executing an executable file, where the apparatus includes: an attribute analysis module, an attribute analysis module, a compression policy determination module, and a compression module.
属性分析模块设置为分析所述可执行文件的多个数据部分中的每个数据部分的功能属性和存储格式属性。The attribute analysis module is configured to analyze functional attributes and storage format attributes of each of the plurality of data portions of the executable file.
属性分析模块设置为根据所述功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据。The attribute analysis module is configured to identify the compressible data portion from the plurality of data portions as the target data according to the function attribute.
压缩策略确定模块设置为根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略。The compression policy determination module is configured to obtain a compression strategy of the target data according to a storage format attribute of the target data.
压缩模块设置为根据所述压缩策略,对所述目标数据进行压缩,并更新所述目标数据的存储格式属性,得到压缩后的可执行文件。The compression module is configured to compress the target data according to the compression policy, and update a storage format attribute of the target data to obtain a compressed executable file.
第三方面,本公开实施例提供了一种电子设备。该电子设备包括:一个或多个处理器;和与所述一个或多个处理器连接的存储器。所述存储器存储有一个或多个程序,所述一个或多个程序被配置使所述一个或多个处理器执行上述的可执行文件的压缩方法。In a third aspect, an embodiment of the present disclosure provides an electronic device. The electronic device includes: one or more processors; and a memory coupled to the one or more processors. The memory stores one or more programs, the one or more programs being configured to cause the one or more processors to perform the compression method of the executable file described above.
第四方面,本公开实施例提供了一种非暂态计算机可读存储介质,其中,所述存储介质存储计算机指令,所述计算机指令被配置使计算机执行上述的可执行文件的压缩方法。In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer readable storage medium, wherein the storage medium stores computer instructions configured to cause a computer to execute the compression method of the executable file described above.
本发明实施例提供的一种可执行文件的压缩方法及装置,首先分析可执行文件各数据部分的功能属性和存储格式属性,根据各数据部分的功能属性,可识别可压缩的数据部分作为目标数据;根据目标数据的存储格式属性,可得到目标数据的压缩策略;根据压缩策略,对可压缩的目标数据进行压缩,并更新目标数据的存储格式属性,得到压缩后的可执行文件。通过采用上述技术方案,压缩后的可执行文件占用较少的存储空间。The method and device for compressing an executable file according to an embodiment of the present invention first analyzes a function attribute and a storage format attribute of each data part of an executable file, and can identify a compressible data part as a target according to a functional attribute of each data part. Data; according to the storage format attribute of the target data, a compression strategy of the target data is obtained; according to the compression strategy, the compressible target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file. By adopting the above technical solution, the compressed executable file occupies less storage space.
附图说明DRAWINGS
下面将对本发明实施例描述中所需要使用的附图作简单的介绍,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据本发明实施例的内容和这些附图获得其他的附图。The drawings used in the description of the embodiments of the present invention will be briefly described below. The drawings in the following description are only some embodiments of the present invention, and those skilled in the art will not make any creative work. Further drawings may also be obtained in accordance with the teachings of the embodiments of the present invention and the drawings.
图1为本发明实施例提供的一种可执行文件的压缩方法的流程图。FIG. 1 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
图2A示出了写FLASH操作后生成的一种可执行的二进制文件数据。Figure 2A shows an executable binary file data generated after a FLASH operation.
图2B示出了写FLASH操作后生成的又一种可执行的二进制文件数据。Figure 2B shows yet another executable binary file data generated after a FLASH operation.
图3A为本发明实施例提供的优化前电视FLASH内存的数据存储结构分布图。FIG. 3A is a diagram showing a data storage structure distribution of a pre-optimized TV FLASH memory according to an embodiment of the present invention.
图3B为本发明实施例提供的优化后电视FLASH内存的数据存储结构分布图。FIG. 3B is a schematic diagram of a data storage structure distribution of an optimized TV FLASH memory according to an embodiment of the present invention.
图4为本发明实施例提供的一种可执行文件的压缩方法的流程图。FIG. 4 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention.
图5为本发明实施例提供的一种可执行文件在压缩前后所占存储空间的对比示意图。FIG. 5 is a schematic diagram of comparison of storage space occupied by an executable file before and after compression according to an embodiment of the present invention.
图6为本发明实施例提供的一种可执行文件的压缩装置的结构框图。FIG. 6 is a structural block diagram of an apparatus for compressing an executable file according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合附图对本发明实施例的技术方案作进一步的详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions of the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图1为本发明实施例提供的一种可执行文件的压缩方法的流程图。本实施例的方法可以由如电视和/或电视机顶盒等来执行,该方法可由部署在如电视和/或电视机顶盒中的软件和/或硬件来实施,该软件和/或硬件一般可集成在某个嵌 入式系统中。如图1所示,该方法可以包括步骤S110至S140。FIG. 1 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention. The method of the present embodiment can be performed by, for example, a television and/or a television set-top box, etc., which can be implemented by software and/or hardware deployed in a television and/or television set-top box, which software and/or hardware can generally be integrated In an embedded system. As shown in FIG. 1, the method may include steps S110 to S140.
在S110:分析可执行文件各个数据部分的功能属性和存储格式属性。At S110: analyzing functional attributes and storage format attributes of respective data portions of the executable file.
可执行文件是指由操作系统进行加载执行的文件,本实施例中提到的可执行文件例如为可执行的二进制(bin)文件。上述可执行的二进制文件可以为已经经过压缩处理的二进制文件,也可为未经过压缩处理的二进制文件。其中,本领域技术人员可根据可执行的二进制文件中携带的压缩标识,来判断该二进制文件是否已被压缩。The executable file refers to a file that is loaded and executed by the operating system, and the executable file mentioned in this embodiment is, for example, an executable binary file. The above executable binary file may be a binary file that has been compressed, or a binary file that has not been compressed. The person skilled in the art can determine whether the binary file has been compressed according to the compression identifier carried in the executable binary file.
示例性的,可执行文件各数据部分的存储格式属性可以从各数据部分对应存储路径中附加的标识该数据部分对应存储格式的标识符中得到,通常包括如下三种情况。Exemplarily, the storage format attribute of each data part of the executable file may be obtained from an identifier corresponding to the storage format corresponding to the data part in the corresponding storage path of each data part, and generally includes the following three cases.
1、对应存储路径中未添加有任何压缩标识;1. No compression identifier is added to the corresponding storage path;
对于在各数据部分对应存储路径中未添加任何压缩标识的可执行文件,编译器在编译该文件时只需完成正常的编译处理即可,无需做任何压缩和解压缩处理。For an executable file that does not have any compression identifier added to the corresponding storage path in each data portion, the compiler only needs to complete the normal compilation processing when compiling the file, without any compression and decompression processing.
2、对应存储路径中添加有压缩率较低的压缩标识;2. A compression flag with a lower compression ratio is added to the corresponding storage path;
本发明实施例中的预设存储格式属性是指,在存储路径中按照第一预设存储格式(如标识符“-g”)或第二预设存储格式(如标识符“-7”)保存的可执行文件具有的特征属性。上述两种存储格式对应的压缩率不同,第一预设存储格式对应的压缩率较低,第二预设存储格式对应的压缩率较高。具体的,当第一预设存储格式的标记符为“-g”时。若在可执行的二进制文件的某部分数据的对应存储路径中检测到存在“-g”标识符时,则说明编译器在编译该可执行的二进制文件的该数据部分过程中,对该数据部分按较小压缩率的方式进行过压缩处理,以节省该二进制文件所占用的存储空间,进而节省存储该二进制文件的硬 件(如存储芯片)的材料成本。The preset storage format attribute in the embodiment of the present invention refers to a first preset storage format (such as an identifier "-g") or a second preset storage format (such as an identifier "-7") in the storage path. The feature attribute that the saved executable has. The compression ratios corresponding to the two storage formats are different, the compression ratio corresponding to the first preset storage format is lower, and the compression ratio corresponding to the second preset storage format is higher. Specifically, when the tag of the first preset storage format is “-g”. If a "-g" identifier is detected in the corresponding storage path of a portion of the data of the executable binary file, the compiler indicates that the data portion of the executable binary file is compiled during the data portion of the executable binary file. The compression process is performed in a small compression ratio to save storage space occupied by the binary file, thereby saving material cost of hardware (such as a memory chip) storing the binary file.
3、对应存储路径中添加有压缩率较高的压缩标识。3. A compression flag with a higher compression ratio is added to the corresponding storage path.
当第二预设存储格式的标识符为“-7”。若可执行的二进制文件的某数据部分的对应存储路径中若检测到存在“-7”标识符时,则说明编译器在编译该二进制文件的该数据部分过程中,对该数据部分按较大压缩率的方式进行过压缩处理,相较于标识符为“-g”的第一预设存储格式,上述压缩方式可进一步节省该可执行的二进制文件所占用的存储空间,以节省存储该二进制文件的硬件的材料成本。When the identifier of the second preset storage format is "-7". If the "-7" identifier is detected in the corresponding storage path of a certain data portion of the executable binary file, the compiler indicates that the data portion is larger in the process of compiling the data portion of the binary file. The compression ratio is compressed. Compared with the first preset storage format with the identifier “-g”, the above compression method can further save the storage space occupied by the executable binary file, thereby saving the storage of the binary. The material cost of the hardware of the file.
需要说明的是,可执行的二进制文件各数据部分的存储格式并不限于以上所列举的三种形式。It should be noted that the storage format of each data portion of the executable binary file is not limited to the three forms listed above.
在S120:根据功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据。At S120: a compressible data portion is identified from the plurality of data portions as the target data according to the function attribute.
在一实施例中,在可执行的二进制文件各部分被压缩之前,需要根据各数据部分的功能属性这一基本特性,判断该可执行的二进制文件中的各数据部分是否可以进行压缩。示例性的,可执行的二进制文件中的各数据部分的功能属性可包括但不限于如存储属性、压缩或解压缩属性等。在具体操作过程中,对于具有解压缩属性或者具有标记属性的可执行的二进制文件的数据,则不可以违背其数据属性对其做压缩处理;而对于具有存储属性的二进制文件中的数据,则可以对其进行压缩以节省存储空间。In an embodiment, before each part of the executable binary file is compressed, it is necessary to determine whether each data portion in the executable binary file can be compressed according to the basic characteristic of the functional attributes of each data portion. Illustratively, the functional attributes of the various data portions in the executable binary file may include, but are not limited to, such as storage attributes, compression or decompression attributes, and the like. In a specific operation, data of an executable binary file having a decompressed attribute or a tag attribute may not be compressed against its data attribute; and for data in a binary file having a storage attribute, It can be compressed to save storage space.
示例性的,下面以系统的实际结构为例进行说明,该系统优选NOS(No Operating System,没有操作系统)系统:Exemplarily, the following takes the actual structure of the system as an example. The system preferably has a NOS (No Operating System) system:
Figure PCTCN2018076624-appb-000001
Figure PCTCN2018076624-appb-000001
Figure PCTCN2018076624-appb-000002
Figure PCTCN2018076624-appb-000002
图2A为写闪存(Flash Memory,一般简称FLASH)操作后生成的一种可执行的二进制文件。如图2A所示,通过对该结构体进行写FLASH操作,在实际的生成文件中,0x21000是实际写入的数据。由于该地址对应的是标记码部分,则生成的文件数据不可以被压缩,必须以实际占用的字节大小进行存储。FIG. 2A is an executable binary file generated after a flash memory (Flash Memory, generally referred to as FLASH) operation. As shown in FIG. 2A, by performing a write FLASH operation on the structure, in the actual generated file, 0x21000 is the actually written data. Since the address corresponds to the tag code portion, the generated file data cannot be compressed and must be stored in the actual occupied byte size.
示例性的,对于下述可执行的二进制文件:Illustrative, for the following executable binary:
Figure PCTCN2018076624-appb-000003
Figure PCTCN2018076624-appb-000003
具体的,图2B为写FLASH操作后生成的又一种可执行的二进制文件。如图2B所示,本领域技术人员可以理解的是,在该二进制文件中,地址0002100h对应的数据与写入的数据(54454C09和58336900)一致,则表明该二进制文件中的该部分数据是可以被压缩的。Specifically, FIG. 2B is another executable binary file generated after the FLASH operation is written. As shown in FIG. 2B, it can be understood by those skilled in the art that in the binary file, the data corresponding to the address 0002100h is consistent with the written data (54454C09 and 58336900), indicating that the part of the data in the binary file is OK. Being compressed.
通过对可执行的二进制文件各数据部分的功能属性进行分析,可以快速识别出该二进制文件中可被压缩的目标数据,从而快速锁定可压缩,即待处理对象,缩小处理范围。By analyzing the functional attributes of each data part of the executable binary file, the target data that can be compressed in the binary file can be quickly identified, thereby quickly locking the compressible, ie, the object to be processed, and narrowing the processing range.
在S130:根据目标数据的存储格式属性,得到目标数据的压缩策略。At S130: obtaining a compression strategy of the target data according to the storage format attribute of the target data.
示例性的,不同的存储格式属性对应的压缩策略不同。在一些实施例中,目标数据对应存储路径中未添加有任何压缩标识的存储属性,则说明该目标数据完全没有被压缩。据此,从而可以得出该目标数据的下一步压缩策略,即可以按照某种压缩方式对该部分数据进行压缩,从而减少该目标数据的存储空间。Illustratively, different storage format attributes correspond to different compression strategies. In some embodiments, the target data corresponds to a storage attribute in the storage path that is not added with any compression identifier, indicating that the target data is not compressed at all. According to this, the next compression strategy of the target data can be obtained, that is, the partial data can be compressed according to a certain compression manner, thereby reducing the storage space of the target data.
在一些实施例中,目标数据按照第一预设存储格式(如标识符为“-g”)的形式存储在对应路径中,则说明目标数据当前是按压缩率较低的压缩方式压缩的。据此,可以得出该目标数据下一步的压缩策略,即可按比当前压缩率更高的某种压缩方式压缩该部分目标数据。In some embodiments, the target data is stored in the corresponding path in the form of a first preset storage format (eg, the identifier is "-g"), indicating that the target data is currently compressed in a compressed manner with a lower compression ratio. According to this, the next compression strategy of the target data can be obtained, and the part of the target data can be compressed in a certain compression manner higher than the current compression ratio.
在一些实施例中,目标数据按照第二预设存储格式(如标识符为“-7”)的形式存储在对应路径中,则说明目标数据当前可按某种压缩率较高的压缩方式压缩的。据此,有可能可以得出该目标数据下一步的压缩策略,即有可能无法再通过更换压缩方式,进一步提升该部分目标数据的压缩率了。In some embodiments, the target data is stored in the corresponding path according to the second preset storage format (eg, the identifier is “-7”), indicating that the target data is currently compressed by a compression method with a higher compression ratio. of. According to this, it is possible to obtain the next compression strategy of the target data, that is, it is possible to further reduce the compression ratio of the target data by replacing the compression method.
在S140:根据压缩策略,对目标数据进行压缩,并更新目标数据的存储格式属性,得到压缩后的可执行文件。At S140: compressing the target data according to the compression policy, and updating the storage format attribute of the target data to obtain a compressed executable file.
对于可压缩的目标数据,根据上述步骤中已确定的压缩策略,可对其进行压缩处理,同时可更新目标数据对应的存储路径中的存储格式属性,使得压缩后的目标数据的存储格式属性与当前的压缩策略相对应。从而便于该目标数据被执行时选择与当前压缩策略对应的解压缩策略。因此,通过识别目标数据的存储格式属性,可确定出该目标数据是否被压缩,或者是按照怎样的方式经过压缩处理的。For the compressible target data, according to the compression strategy determined in the above steps, the compression processing may be performed, and the storage format attribute in the storage path corresponding to the target data may be updated, so that the storage format attribute of the compressed target data is The current compression strategy corresponds. Thereby, the decompression strategy corresponding to the current compression strategy is selected when the target data is executed. Therefore, by identifying the storage format attribute of the target data, it can be determined whether the target data is compressed or in what manner.
进一步的,将压缩后的可执行文件保存在FLASH中后,对于FLASH剩余的存储空间,可通过充分利用其剩余空间保存数据,使得该FLASH内存空间的利用率达到最大。优化方法如下。Further, after the compressed executable file is saved in the FLASH, the remaining storage space of the FLASH can be saved by making full use of the remaining space, so that the utilization of the FLASH memory space is maximized. The optimization method is as follows.
图3A为本发明实施例提供的优化前电视FLASH内存的数据存储结构分布图。如图3A所示,在0-57BANK(存储单位)的存储空间,主要存储软件的可执行文件,所以可执行文件的大小最大为58×64K=3712K。如果可执行文件的大小大于这个空间,就会存在覆盖数据区的风险。而对于可执行文件以外的数 据则根据实际结构体的大小以及实际的频道个数进行存储空间的分配。将全部数据存储完成之后,只剩余了2K的可用空间,即存储空间余量不足。因此,为了对存储空间进行优化以达到精简的要求,需在图3A中的7个BANK中再节省出一个BANK来存储数据。优化过程如下。FIG. 3A is a diagram showing a data storage structure distribution of a pre-optimized TV FLASH memory according to an embodiment of the present invention. As shown in FIG. 3A, in the storage space of 0-57 BANK (storage unit), the executable file of the software is mainly stored, so the size of the executable file is at most 58×64K=3712K. If the size of the executable is larger than this space, there is a risk of overwriting the data area. For data other than the executable file, the storage space is allocated according to the size of the actual structure and the actual number of channels. After all the data is stored, only 2K of free space remains, that is, the storage space is insufficient. Therefore, in order to optimize the storage space to achieve the streamlined requirements, one more BANK is saved in the seven BANKs in FIG. 3A to store data. The optimization process is as follows.
经过分析,在第63个BANK中,真实的数据只有304个BYTE,但是FLASH的存储空间是以BANK为单元来进行划分的,所以,第63个BANK中304个BYTE的数据占据了整个第63个BANK,造成了FLASH存储空间资源的浪费。图3B为本发明实施例一提供的优化后电视FLASH内存的数据存储结构分布图。如图3B所示,通过升级HDCP,可将高带宽数字内容保护(High-bandwidth Digital Content Protection,HDCP)部分的数据直接写入到规定的内存(如第58个BANK)中。这样,就可以多节省出一个BANK来存放其它程序代码。除此之外,还可将数据的存储方式修改为不保存的方式,在系统初始化时将初始化整个表格,然后在切换不同的时序时,可直接从表格中加载数据,这样又可节省一个BANK出来。因此,通过采用上述优化内存分配的方式,可达到进一步节省存储空间的技术效果。After analysis, in the 63rd BANK, the actual data is only 304 BYTE, but the storage space of FLASH is divided into BANK units, so the data of 304 BYTE in the 63rd BANK occupies the entire 63rd. BANK, caused a waste of FLASH storage space resources. FIG. 3B is a diagram showing a data storage structure distribution of an optimized TV FLASH memory according to Embodiment 1 of the present invention. As shown in FIG. 3B, by upgrading the HDCP, data of the High-bandwidth Digital Content Protection (HDCP) portion can be directly written into a predetermined memory (for example, the 58th BANK). In this way, you can save a BANK to store other program code. In addition, the data storage mode can be modified to not save, the entire table will be initialized when the system is initialized, and then when the different timings are switched, the data can be directly loaded from the table, which saves a BANK. come out. Therefore, by adopting the above method of optimizing memory allocation, the technical effect of further saving storage space can be achieved.
可选的,对于节省存储空间的方法,本领域技术人员可以理解的是,对于在后续程序执行中不需要用到的图片,可通过对其在程序数据中进行删除,或者在对图片进行编译时修改图片的压缩率来降低生成图片的可执行文件的大小,进而进一步节省程序所需要的存储空间。Optionally, for the method for saving storage space, those skilled in the art can understand that for a picture that is not needed in subsequent program execution, it can be deleted in the program data or compiled in the picture. The compression ratio of the image is modified to reduce the size of the executable file that generates the image, thereby further saving the storage space required by the program.
可选的,还可通过将程序中不需要执行的代码进行屏蔽的模式,修改为直接删除这部分被屏蔽使其不被执行代码的模式,达到进一步节省可执行文件存储空间的技术效果。因为采取的屏蔽代码的技术手段只是不执行这部分代码而已,但在原可执行的二进制文件中,这部分被屏蔽的不被执行的代码仍然物理 上存在于原可执行的二进制文件中,所以这部分被屏蔽的代码仍然会占据一定的物理存储空间。如果对于被屏蔽以刻意不被执行的代码,采取直接删除代码的形式,则由于代码被物理性的删除了,相较于屏蔽不被执行的技术手段,删除代码则会进一步节省可执行的二进制文件的存储空间。Optionally, the mode of masking the code that is not required to be executed in the program may be modified to directly delete the mode in which the part is shielded from being executed, thereby achieving the technical effect of further saving the storage space of the executable file. Because the technical means of masking the code is just not executing this part of the code, but in the original executable binary file, this part of the blocked executable code is still physically present in the original executable binary file, so this Part of the blocked code still occupies a certain amount of physical storage space. If the code is removed directly from the code that is being deliberately not executed, the code is physically removed, and the code is removed to further save the executable binary compared to the technical means of masking not being executed. The storage space for the file.
本实施例提供了一种可执行文件的压缩方法,在分析可执行文件各数据部分的功能属性和存储格式属性后,根据可执行文件各数据部分的存储、压缩或解压缩等功能属性,可识别出该可执行文件各数据部分中可被压缩的目标数据。根据目标数据的存储格式属性,可得到目标数据的压缩策略。其中,压缩策略可包括不进行压缩、进行压缩,按照比原压缩率较大的新的压缩方式进行压缩,以及按照比原压缩率较小的新的压缩方式进行压缩等情况。根据压缩策略,对目标数据进行压缩,并更新目标数据的存储格式属性,得到压缩后的可执行文件。通过采用上述技术方案,可以使得压缩后的可执行文件占用较少的存储空间,达到节省可执行文件所需要的存储硬件材料成本的技术效果,从而间接地提升相应产品的市场竞争力。The embodiment provides a method for compressing an executable file. After analyzing functional attributes and storage format attributes of each data portion of the executable file, according to functional attributes such as storage, compression, or decompression of each data portion of the executable file, The target data that can be compressed in each data portion of the executable file is identified. According to the storage format attribute of the target data, a compression strategy of the target data can be obtained. The compression strategy may include compression without compression, compression according to a new compression method with a larger original compression ratio, and compression according to a new compression method with a smaller original compression ratio. According to the compression strategy, the target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file. By adopting the above technical solution, the compressed executable file can occupy less storage space, and the technical effect of saving the storage hardware material cost required for the executable file can be achieved, thereby indirectly improving the market competitiveness of the corresponding product.
图4为本发明实施例提供的一种可执行文件的压缩方法的流程图。本实施例在图1所示实施例的基础上,对步骤S130“根据目标数据的存储格式属性,得到目标数据的压缩策略”进行了进一步地优化。参照图4,本发明实施例的可执行文件的压缩方法包括步骤S210至S270。FIG. 4 is a flowchart of a method for compressing an executable file according to an embodiment of the present invention. The present embodiment further optimizes the step S130 "the compression strategy of obtaining the target data according to the storage format attribute of the target data" on the basis of the embodiment shown in FIG. 1. Referring to FIG. 4, a method for compressing an executable file according to an embodiment of the present invention includes steps S210 to S270.
在S210:分析可执行文件的各数据部分的功能属性和存储格式属性。At S210: analyzing the functional attributes and storage format attributes of each data portion of the executable file.
在S220:根据功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据。At S220: a compressible data portion is identified from the plurality of data portions as the target data according to the function attribute.
在S230:判断当前存储格式是否与预设存储格式相匹配,若当前存储格式与预设存储格式相匹配,则执行步骤S240;若判断当前存储格式与预设存储格 式不匹配,则执行步骤S260。At S230, it is determined whether the current storage format matches the preset storage format. If the current storage format matches the preset storage format, step S240 is performed; if it is determined that the current storage format does not match the preset storage format, step S260 is performed. .
示例性的,由于经过步骤S220识别出的可压缩的目标数据有可能是已经过压缩处理后的数据,也可能是未经过任何压缩的数据。因此,通过将目标数据的当前存储格式与预设存储格式相比较,若目标数据的当前存储格式与预设存储格式不相符,则有可能表明目标数据是未经过压缩处理的数据。若当前存储格式与任一预设存储格式相匹配,则可说明当前目标数据是按照预设存储格式对应的压缩率经过压缩处理之后的数据。因此步骤230可以作为确定当前目标数据的压缩策略的基础,在压缩策略确定后,可选择合适的压缩方式对当前的目标数据进行进一步地压缩,进而节省目标数据所占用的存储空间。Exemplarily, since the compressible target data identified through step S220 may be data that has been subjected to compression processing, it may also be data that has not undergone any compression. Therefore, by comparing the current storage format of the target data with the preset storage format, if the current storage format of the target data does not match the preset storage format, it is possible to indicate that the target data is data that has not been compressed. If the current storage format matches any of the preset storage formats, the current target data is data that has undergone compression processing according to a compression ratio corresponding to the preset storage format. Therefore, the step 230 can be used as a basis for determining a compression strategy of the current target data. After the compression policy is determined, the current target data can be further compressed by selecting an appropriate compression mode, thereby saving the storage space occupied by the target data.
在S240:判断当前存储格式是否与第一压缩策略对应的第一预设存储格式相匹配,若当前存储格式与第一压缩策略对应的第一预设存储格式相匹配,则执行步骤S250;若当前存储格式与第一压缩策略对应的第一预设存储格式相不匹配,则执行步骤S260。In S240, it is determined whether the current storage format matches the first preset storage format corresponding to the first compression policy, and if the current storage format matches the first preset storage format corresponding to the first compression policy, step S250 is performed; If the current storage format does not match the first preset storage format corresponding to the first compression policy, step S260 is performed.
示例性的,在目标数据的当前存储格式与预设存储格式匹配的前提下,若进一步判断出当前存储格式与第一压缩策略对应的第一预设存储格式(如标识符为“-g”)相匹配,则可说明目标数据已按照第一压缩策略经过了压缩处理。此时,可根据实际需求,更改目标数据的压缩策略,并同时相应地对目标数据的原第一预设存储格式(如标识符为“-g”)进行修改,以提升目标数据的压缩率,达到节省可执行文件存储空间,节约存储材料成本的技术效果。For example, if the current storage format of the target data matches the preset storage format, if the current storage format is further determined to be the first preset storage format corresponding to the first compression policy (eg, the identifier is “-g” Matching, it can be said that the target data has been compressed according to the first compression strategy. At this time, the compression strategy of the target data may be changed according to actual needs, and the original first preset storage format of the target data (such as the identifier “-g”) may be modified accordingly to improve the compression ratio of the target data. To achieve the technical effect of saving executable file storage space and saving storage material cost.
示例性的,还可以进一步判断当前存储格式是否与第二压缩策略对应的第二预设存储格式(如标识符为“-7”)相匹配,若当前存储格式是否与第二压缩策略对应的第二预设存储格式相匹配,则可说明目标数据已按照第二压缩策略经过了压缩处理。此时,也可根据实际需求,更改目标数据的压缩策略,并同 时相应地对目标数据的原第二预设存储格式(如标识符为“-7”)进行修改。Exemplarily, whether the current storage format matches the second preset storage format corresponding to the second compression policy (eg, the identifier is “-7”), and if the current storage format corresponds to the second compression policy. If the second preset storage format matches, it can be stated that the target data has been compressed according to the second compression strategy. At this time, the compression strategy of the target data may also be changed according to actual needs, and the original second preset storage format (such as the identifier "-7") of the target data may be modified accordingly.
在S250:按照与第二预设存储格式对应的第二压缩策略压缩目标数据,其中,第二压缩策略对应的压缩率大于第一压缩策略对应的压缩率,继续执行步骤S270。In S250, the target data is compressed according to the second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy, and step S270 is continued.
示例性的,若将目标数据中的第一预设预储格式(如标识符为“-g”)修改为第二预设存储格式(如标识符为“-7),则可提升目标数据的压缩率,节省存储空间。具体的,图5为本发明实施例二提供的一种可执行文件在压缩前后所占存储空间的对比示意图。如图5所示,未压缩的文件(vdplayer.bin)在存储空间中需要占用文件本身大小以节省存储空间(1270KB);而对于压缩后的文件(vdplayer.bin),则占用了较少一部分存储空间(380KB)。Exemplarily, if the first preset pre-storage format (such as the identifier is “-g”) in the target data is modified to the second preset storage format (if the identifier is “-7”), the target data may be upgraded. The compression ratio saves storage space. Specifically, FIG. 5 is a schematic diagram of comparison of storage space occupied by an executable file before and after compression according to Embodiment 2 of the present invention. As shown in FIG. 5, an uncompressed file (vdplayer. Bin) takes up the size of the file itself in the storage space to save storage space (1270KB); for the compressed file (vdplayer.bin), it takes up a small amount of storage space (380KB).
示例性的,在一些特定情况下,对于某些目标数据,根据实际需要,若无需或不宜采用较大压缩率的方式进行压缩,则可将第二预设存储格式(如标识符为“-7”)修改为第一预设存储格式(如标识符为“-g”),以根据目标数据本身的特性节省其所占用的存储空间。Exemplarily, in some specific cases, for some target data, according to actual needs, if compression is not required or not suitable, the second preset storage format (such as the identifier is "-" 7") is modified to the first preset storage format (such as the identifier "-g") to save the storage space occupied by the target data itself.
在S260:根据预设存储格式,确定目标数据的压缩策略,继续执行步骤S270。At S260: determining a compression strategy of the target data according to the preset storage format, and proceeding to step S270.
示例性的,若目标数据的当前存储格式与预设存储格式不相符时,则可表明目标数据未经过压缩处理。此时,可将预设存储格式(例如,可以为第一预设存储格式也可以为第二预设存储格式)添加到目标数据对应存储的路径中,在压缩目标数据时,编辑器则可根据不同存储格式对应的压缩方式压缩目标数据,并得到不同压缩率的目标数据,以节省可执行文件中目标数据的存储空间,减小存储可执行文件所需要的硬件成本。Exemplarily, if the current storage format of the target data does not match the preset storage format, it may indicate that the target data is not compressed. At this time, the preset storage format (for example, the first preset storage format or the second preset storage format) may be added to the path corresponding to the target data, and when the target data is compressed, the editor may The target data is compressed according to the compression mode corresponding to different storage formats, and target data of different compression ratios are obtained, thereby saving the storage space of the target data in the executable file and reducing the hardware cost required for storing the executable file.
在S270:根据压缩策略,对目标数据进行压缩,并更新目标数据的存储格式属性,得到压缩后的可执行文件。At S270: compressing the target data according to the compression strategy, and updating the storage format attribute of the target data to obtain a compressed executable file.
本实施例二在上述实施例的基础上,通过对目标数据的当前存储格式与预设的存储格式进行匹配,根据匹配结果,采取不同的压缩策略,并且根据所选择的压缩策略,相应进行添加或更改当前目标数据的原存储格式属性至新的存储格式属性,从而可以根据实际需要,相应地添加或更改目标数据的压缩方式,进而可以提升可执行文件目标数据的压缩率,节省目标数据所占存储空间,间接达到节约存储材料成本的技术效果。In the second embodiment, on the basis of the foregoing embodiment, the current storage format of the target data is matched with the preset storage format, and different compression policies are adopted according to the matching result, and correspondingly added according to the selected compression policy. Or change the original storage format attribute of the current target data to the new storage format attribute, so that the compression mode of the target data can be added or changed according to actual needs, thereby improving the compression ratio of the target data of the executable file and saving the target data. Taking up storage space, indirectly achieves the technical effect of saving storage material costs.
以下是本发明实施例提供的可执行文件的压缩装置的实施例,可执行文件的压缩装置与上述各实施例提供可执行文件的压缩方法属于同一个发明构思。The following is an embodiment of a compression device for an executable file provided by an embodiment of the present invention. The compression device of the executable file and the compression method for providing the executable file according to the foregoing embodiments belong to the same inventive concept.
图6为本发明实施例提供的一种可执行文件的压缩装置的结构框图。该装置可由部署在如电视和/或电视机顶盒中的软件和/或硬件来实现,其中,该装置一般可集成在如电视和/或电视机顶盒等硬件实体的嵌入式系统中。FIG. 6 is a structural block diagram of an apparatus for compressing an executable file according to an embodiment of the present invention. The apparatus may be implemented by software and/or hardware deployed in, for example, a television and/or a television set top box, where the apparatus may generally be integrated into an embedded system of hardware entities such as televisions and/or television set top boxes.
如图6所示,该装置包括:属性分析模块310、目标数据识别模块320、压缩策略确定模块330和压缩模块340。As shown in FIG. 6, the apparatus includes: an attribute analysis module 310, a target data identification module 320, a compression policy determination module 330, and a compression module 340.
属性分析模块310,设置为分析所述可执行文件各部分数据的功能属性和存储格式属性;The attribute analysis module 310 is configured to analyze function attributes and storage format attributes of each part of the executable file data;
目标数据识别模块320,设置为根据所述功能属性,识别出所述各部分数据中可压缩的目标数据;The target data identification module 320 is configured to identify, according to the function attribute, the compressible target data in each part of the data;
压缩策略确定模块330,设置为根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略;The compression policy determination module 330 is configured to obtain a compression strategy of the target data according to a storage format attribute of the target data.
压缩模块340,设置为根据所述压缩策略,对所述目标数据进行压缩,并更新所述目标数据的存储格式属性,得到压缩后的可执行文件。The compression module 340 is configured to compress the target data according to the compression policy, and update a storage format attribute of the target data to obtain a compressed executable file.
本实施例提供了一种可执行文件的压缩装置,首先分析可执行文件各部分数据的功能属性和存储格式属性,根据可执行文件各部分数据的存储、压缩或 解压缩等功能属性,可识别出该可执行文件各部分数据中可压缩的目标数据。根据目标数据的存储格式属性,可得到目标数据的压缩策略。其中,压缩策略可包括不进行压缩、进行压缩,按照比原压缩率较大的新的压缩方式进行压缩,以及按照比原压缩率较小的新的压缩方式进行压缩等情况。根据压缩策略,对目标数据进行压缩,并更新目标数据的存储格式属性,得到压缩后的可执行文件。通过采用上述技术方案,可以使得压缩后的可执行文件占用较少的存储空间,达到节省可执行文件所需要的存储硬件材料成本的技术效果,从而间接地提升了相应产品的市场竞争力。The embodiment provides a compression device for an executable file, which first analyzes the function attributes and storage format attributes of each part of the executable file, and can identify the function according to the storage, compression or decompression of the data of each part of the executable file. The target data that can be compressed in the data of each part of the executable file. According to the storage format attribute of the target data, a compression strategy of the target data can be obtained. The compression strategy may include compression without compression, compression according to a new compression method with a larger original compression ratio, and compression according to a new compression method with a smaller original compression ratio. According to the compression strategy, the target data is compressed, and the storage format attribute of the target data is updated to obtain a compressed executable file. By adopting the above technical solution, the compressed executable file can occupy less storage space and achieve the technical effect of saving the storage hardware material cost required for the executable file, thereby indirectly improving the market competitiveness of the corresponding product.
在上述实施例的基础上,所述压缩策略确定模块330可以包括:压缩策略确定单元。Based on the foregoing embodiment, the compression policy determination module 330 may include: a compression policy determination unit.
压缩策略确定单元设置为,若所述目标数据的当前存储格式与预设存储格式相匹配,则根据所述当前存储格式,确定所述目标数据的压缩策略。The compression policy determining unit is configured to determine a compression policy of the target data according to the current storage format if the current storage format of the target data matches the preset storage format.
在上述实施例的基础上,所述压缩策略确定单元设置为:Based on the foregoing embodiment, the compression policy determining unit is configured to:
若所述当前存储格式与第一压缩策略对应的第一预设存储格式相匹配,则所述目标数据的压缩策略为:If the current storage format matches the first preset storage format corresponding to the first compression policy, the compression strategy of the target data is:
按照与第二预设存储格式对应的第二压缩策略压缩所述目标数据,其中,所述第二压缩策略对应的压缩率大于所述第一压缩策略对应的压缩率。The target data is compressed according to a second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy.
在上述实施例的基础上,所述压缩策略确定模块330还可以具体用于:Based on the foregoing embodiment, the compression policy determining module 330 may further be specifically configured to:
若所述目标数据的当前存储格式与预设存储格式不匹配,则根据预设存储格式,确定所述目标数据的压缩策略。If the current storage format of the target data does not match the preset storage format, determining a compression policy of the target data according to the preset storage format.
在上述实施例的基础上,所述第一预设存储格式为“-g”,所述第二预设存储格式为“-7”。On the basis of the foregoing embodiment, the first preset storage format is “-g”, and the second preset storage format is “-7”.
本公开还提供了一种电子设备。该电子设备可以包括:一个或多个处理器 (processor)和与所述一个或多个处理器连接的存储器。(memory)。所述存储器用于存储可被所述一个或多个处理器执行的指令,所述指令被所述一个或多个处理器执行时,使所述一个或多个处理器执行上述的可执行文件的压缩方法。The present disclosure also provides an electronic device. The electronic device can include one or more processors and a memory coupled to the one or more processors. (memory). The memory is for storing instructions executable by the one or more processors, the instructions being executed by the one or more processors to cause the one or more processors to execute the executable file described above Compression method.
电子设备还可以包括通信接口(Communications Interface)和总线。其中,处理器、通信接口、存储器可以通过总线完成相互间的通信。通信接口可以用于信息传输。处理器可以调用存储器中的逻辑指令,以执行上述实施例的云平台的部署方法。The electronic device can also include a communications interface (Communications Interface) and a bus. Among them, the processor, the communication interface, and the memory can complete communication with each other through the bus. The communication interface can be used for information transmission. The processor can invoke logic instructions in the memory to perform the deployment method of the cloud platform of the above embodiment.
此外,上述的存储器中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,也可以是暂态存储介质。In addition, the logic instructions in the above-described memory may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network) The device or the like) performs all or part of the steps of the method described in various embodiments of the present disclosure. The foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A medium that can store program code, or a transitory storage medium.
本公开实施例提供了一种非暂态计算机可读存储介质,其中,所述存储介质存储计算机指令,所述计算机指令被配置使计算机执行上述的可执行文件的压缩方法。Embodiments of the present disclosure provide a non-transitory computer readable storage medium, wherein the storage medium stores computer instructions configured to cause a computer to execute the compression method of the executable file described above.
本发明实施例提供的可执行文件的压缩装置可执行本发明任意实施例所提供的可执行文件的压缩方法,具备执行方法相应的功能模块和相应的有益效果。未在上述实施例中详尽描述的技术细节,可参见本发明任意实施例所提供的可执行文件的压缩方法。The compression device of the executable file provided by the embodiment of the present invention can execute the compression method of the executable file provided by any embodiment of the present invention, and has the corresponding functional modules and corresponding beneficial effects of the execution method. For details of the technical details that are not described in detail in the above embodiments, reference may be made to the compression method of the executable file provided by any embodiment of the present invention.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only the preferred embodiments of the present invention and the technical principles applied thereto. Those skilled in the art will appreciate that the present invention is not limited to the specific embodiments described herein, and that various modifications, changes and substitutions may be made without departing from the scope of the invention. Therefore, the present invention has been described in detail by the above embodiments, but the present invention is not limited to the above embodiments, and other equivalent embodiments may be included without departing from the inventive concept. The scope is determined by the scope of the appended claims.

Claims (15)

  1. 一种可执行文件的压缩方法,包括:A method of compressing an executable file, comprising:
    分析所述可执行文件的多个数据部分中的每个数据部分的功能属性和存储格式属性;Analyzing a functional attribute and a storage format attribute of each of the plurality of data portions of the executable file;
    根据所述功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据;Determining, according to the functional attribute, a compressible data portion from the plurality of data portions as the target data;
    根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略;以及Obtaining a compression strategy of the target data according to a storage format attribute of the target data;
    根据所述压缩策略,对所述目标数据进行压缩,并更新所述目标数据的存储格式属性,得到压缩后的可执行文件。And compressing the target data according to the compression policy, and updating a storage format attribute of the target data to obtain a compressed executable file.
  2. 根据权利要求1所述的方法,其中,所述根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略的步骤包括:The method according to claim 1, wherein the step of obtaining a compression strategy of the target data according to a storage format attribute of the target data comprises:
    若所述目标数据的当前存储格式与预设存储格式相匹配,则根据所述当前存储格式,确定所述目标数据的压缩策略。And if the current storage format of the target data matches the preset storage format, determining a compression policy of the target data according to the current storage format.
  3. 根据权利要求2所述的方法,其中,所述根据所述当前存储格式,确定所述目标数据的压缩策略的步骤,包括:The method of claim 2, wherein the step of determining a compression policy of the target data according to the current storage format comprises:
    若所述当前存储格式与第一压缩策略对应的第一预设存储格式相匹配,则所述目标数据的压缩策略为:If the current storage format matches the first preset storage format corresponding to the first compression policy, the compression strategy of the target data is:
    按照与第二预设存储格式对应的第二压缩策略压缩所述目标数据,其中,所述第二压缩策略对应的压缩率大于所述第一压缩策略对应的压缩率。The target data is compressed according to a second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy.
  4. 根据权利要求1所述的方法,其中,所述根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略的步骤还包括:The method according to claim 1, wherein the step of obtaining a compression strategy of the target data according to the storage format attribute of the target data further comprises:
    若所述目标数据的当前存储格式与预设存储格式不匹配,则根据预设存储格式,确定所述目标数据的压缩策略。If the current storage format of the target data does not match the preset storage format, determining a compression policy of the target data according to the preset storage format.
  5. 根据权利要求3所述的方法,其中,所述第一预设存储格式为-g,所述 第二预设存储格式为-7。The method according to claim 3, wherein the first preset storage format is -g and the second preset storage format is -7.
  6. 根据权利要求1所述的方法,其中,所述功能属性包括存储属性、压缩属性和解压缩属性。The method of claim 1 wherein the functional attributes comprise storage attributes, compression attributes, and decompression attributes.
  7. 一种可执行文件的压缩装置,包括:An executable file compression device comprising:
    属性分析模块,设置为分析所述可执行文件的多个数据部分中的每个数据部分的功能属性和存储格式属性;An attribute analysis module configured to analyze functional attributes and storage format attributes of each of the plurality of data portions of the executable file;
    目标数据识别模块,设置为根据所述功能属性,从多个数据部分中识别出可压缩的数据部分作为目标数据;a target data identification module configured to identify a compressible data portion from the plurality of data portions as the target data according to the function attribute;
    压缩策略确定模块,设置为根据所述目标数据的存储格式属性,得到所述目标数据的压缩策略;以及a compression policy determining module, configured to obtain a compression strategy of the target data according to a storage format attribute of the target data;
    压缩模块,设置为根据所述压缩策略,对所述目标数据进行压缩,并更新所述目标数据的存储格式属性,得到压缩后的可执行文件。And a compression module, configured to compress the target data according to the compression policy, and update a storage format attribute of the target data to obtain a compressed executable file.
  8. 根据权利要求7所述的装置,其中,所述压缩策略确定模块包括:The apparatus of claim 7, wherein the compression policy determination module comprises:
    压缩策略确定单元,设置为若所述目标数据的当前存储格式与预设存储格式相匹配,则根据所述当前存储格式,确定所述目标数据的压缩策略。And a compression policy determining unit, configured to determine a compression policy of the target data according to the current storage format, if a current storage format of the target data matches a preset storage format.
  9. 根据权利要求8所述的装置,其中,所述压缩策略确定单元进一步设置为:The apparatus of claim 8, wherein the compression policy determination unit is further configured to:
    若所述当前存储格式与第一压缩策略对应的第一预设存储格式相匹配,则所述目标数据的压缩策略为:If the current storage format matches the first preset storage format corresponding to the first compression policy, the compression strategy of the target data is:
    按照与第二预设存储格式对应的第二压缩策略压缩所述目标数据,其中,所述第二压缩策略对应的压缩率大于所述第一压缩策略对应的压缩率。The target data is compressed according to a second compression policy corresponding to the second preset storage format, where the compression ratio corresponding to the second compression policy is greater than the compression ratio corresponding to the first compression policy.
  10. 根据权利要求7所述的装置,其中,所述压缩策略确定模块进一步设置为:The apparatus of claim 7, wherein the compression policy determination module is further configured to:
    若所述目标数据的当前存储格式与预设存储格式不匹配,则根据预设存储格式,确定所述目标数据的压缩策略。If the current storage format of the target data does not match the preset storage format, determining a compression policy of the target data according to the preset storage format.
  11. 根据权利要求9所述的装置,其中,所述第一预设存储格式为-g,所述第二预设存储格式为-7。The apparatus according to claim 9, wherein the first preset storage format is -g and the second preset storage format is -7.
  12. 根据权利要求7所述的装置,其中,所述功能属性包括存储属性、压缩属性和解压缩属性。The apparatus of claim 7, wherein the functional attributes comprise a storage attribute, a compression attribute, and a decompression attribute.
  13. 一种电子设备,包括:An electronic device comprising:
    一个或多个处理器;和One or more processors; and
    与所述一个或多个处理器连接的存储器;a memory coupled to the one or more processors;
    其中,所述存储器存储有一个或多个程序,所述一个或多个程序被配置使所述一个或多个处理器执行权利要求1所述的可执行文件的压缩方法。Wherein the memory stores one or more programs, the one or more programs being configured to cause the one or more processors to execute the compression method of the executable file of claim 1.
  14. 根据权利要求13所述的电子设备是机顶盒。The electronic device of claim 13 is a set top box.
  15. 一种非暂态计算机可读存储介质,其中,所述存储介质存储计算机指令,所述计算机指令被配置使计算机执行权利要求1所述的可执行文件的压缩方法。A non-transitory computer readable storage medium, wherein the storage medium stores computer instructions configured to cause a computer to execute the method of compressing the executable file of claim 1.
PCT/CN2018/076624 2017-03-10 2018-02-13 Method and device for compressing executable file WO2018161791A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710142482.8 2017-03-10
CN201710142482.8A CN106909398B (en) 2017-03-10 2017-03-10 Compression method and device for executable file

Publications (1)

Publication Number Publication Date
WO2018161791A1 true WO2018161791A1 (en) 2018-09-13

Family

ID=59187689

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076624 WO2018161791A1 (en) 2017-03-10 2018-02-13 Method and device for compressing executable file

Country Status (2)

Country Link
CN (1) CN106909398B (en)
WO (1) WO2018161791A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909398B (en) * 2017-03-10 2020-10-16 深圳创维-Rgb电子有限公司 Compression method and device for executable file
CN111078647B (en) * 2019-11-22 2023-09-22 北京安兔兔科技有限公司 Method and device for creating uncompressed file and testing magnetic disk and electronic equipment
CN113850055A (en) * 2021-09-29 2021-12-28 北京有竹居网络技术有限公司 Data processing method, device, storage medium and product
CN116909937B (en) * 2023-05-11 2024-02-23 深圳三地一芯电子股份有限公司 Flash memory capacity optimization method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609360A (en) * 2012-01-12 2012-07-25 华为技术有限公司 Data processing method, data processing device and data processing system
CN102957633A (en) * 2011-08-19 2013-03-06 北京大学 Data packing and transmitting method and data packing and transmitting system for message-oriented middleware
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
CN104954497A (en) * 2015-07-03 2015-09-30 浪潮(北京)电子信息产业有限公司 Data transmission method and system for cloud storage system
CN106909398A (en) * 2017-03-10 2017-06-30 深圳创维-Rgb电子有限公司 The compression method and device of a kind of executable file

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1269034C (en) * 2003-12-31 2006-08-09 中兴通讯股份有限公司 Compression of executable document in embedded type system and its loading method
CN101977061B (en) * 2010-10-19 2012-12-26 广西师范大学 Lossless compression and decompression method for general information
CN202134001U (en) * 2011-03-07 2012-02-01 浪潮(北京)电子信息产业有限公司 Executable file backup device
WO2012141871A1 (en) * 2011-04-11 2012-10-18 Marvell World Trade Ltd. 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
CN106202213B (en) * 2016-06-28 2019-12-17 深圳市恒扬数据股份有限公司 FPGA binary file compression and decompression method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
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
CN104954497A (en) * 2015-07-03 2015-09-30 浪潮(北京)电子信息产业有限公司 Data transmission method and system for cloud storage system
CN106909398A (en) * 2017-03-10 2017-06-30 深圳创维-Rgb电子有限公司 The compression method and device of a kind of executable file

Also Published As

Publication number Publication date
CN106909398B (en) 2020-10-16
CN106909398A (en) 2017-06-30

Similar Documents

Publication Publication Date Title
WO2018161791A1 (en) Method and device for compressing executable file
US10140113B2 (en) Data processing method and device of preset application after upgrading
US9852056B2 (en) Multi-level memory compression
CN111352861B (en) Memory compression method and device and electronic equipment
JP5658283B2 (en) Application operating method, apparatus and system
WO2020140634A1 (en) Storage space optimization method and device, computer apparatus, and storage medium
WO2017107414A1 (en) File operation method and device
US10048986B2 (en) Method and device for allocating browser processes according to a selected browser process mode
WO2021057665A1 (en) Data storage method and apparatus, mobile terminal, and storage medium
US20230289156A1 (en) Dynamic partition customization method and apparatus, and device
US11467734B2 (en) Managing swap area in memory using multiple compression algorithms
CN112181471A (en) Differential upgrading method and device, storage medium and computer equipment
CN105786997A (en) IOS-system-based image caching and compression method
CN114168490A (en) Method for determining memory recovery threshold and related equipment
CN107577474B (en) Processing method and device for upgrading file and electronic equipment
US20230376600A1 (en) Method and system for upgrading firmware of vehicle infotainment system
CN110851433B (en) Key optimization method for key value storage system, storage medium, electronic device and system
CN111414339A (en) File processing method, system, device, equipment and medium
CN111767417A (en) Application picture management method, device, equipment and storage medium
CN113377382B (en) Processing method and device of software installation package, electronic equipment and storage medium
CN110365962B (en) Color gamut conversion processing method and device and electronic equipment
CN113641643A (en) File writing method and device
CN112363768A (en) Method for realizing application skin changing by inserting U disk based on android system
WO2020103057A1 (en) Data processing method, apparatus, electronic device and storage medium
KR101384929B1 (en) Media scanning method and media scanning device for storage medium of user terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18764581

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18764581

Country of ref document: EP

Kind code of ref document: A1