CN112612473B - File compression shell adding method, device, equipment and storage medium - Google Patents

File compression shell adding method, device, equipment and storage medium Download PDF

Info

Publication number
CN112612473B
CN112612473B CN202011541979.5A CN202011541979A CN112612473B CN 112612473 B CN112612473 B CN 112612473B CN 202011541979 A CN202011541979 A CN 202011541979A CN 112612473 B CN112612473 B CN 112612473B
Authority
CN
China
Prior art keywords
image file
file
program
processed
system boot
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.)
Active
Application number
CN202011541979.5A
Other languages
Chinese (zh)
Other versions
CN112612473A (en
Inventor
张成亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou 360 Intelligent Security Technology Co Ltd
Original Assignee
Suzhou 360 Intelligent Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou 360 Intelligent Security Technology Co Ltd filed Critical Suzhou 360 Intelligent Security Technology Co Ltd
Priority to CN202011541979.5A priority Critical patent/CN112612473B/en
Publication of CN112612473A publication Critical patent/CN112612473A/en
Application granted granted Critical
Publication of CN112612473B publication Critical patent/CN112612473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Abstract

The invention relates to the technical field of Internet, and discloses a file compression and shell adding method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a mirror image file to be processed, and determining system boot data according to the mirror image file to be processed; compressing the image file to be processed to obtain a target image file; compiling the target image file and the system boot data into a firmware program; and sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program. Compared with the prior art, the method and the device have the advantages that the mirror image file does not need to be packaged, the mirror image file is directly operated through the device, the operation process of the mirror image file is complex, the packaged file is transmitted to the Internet of things device, and the Internet of things device can process the mirror image file according to the packaged file, so that the transmission safety of the firmware file is improved.

Description

File compression shell adding method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of internet, in particular to a file compression and shell adding method, device, equipment and storage medium.
Background
In the prior art, a key compression shell reinforcing technology for Internet of Things (Internet of Things) equipment can directly and uniformly package firmware files and transmit the packaged files, but complex firmware is not processed in the prior art, so that the transmission cost of the image files of the firmware is high, the space occupancy rate of a Read Only Memory (Read Only Memory ROM) in the IOT equipment is increased, and meanwhile, the firmware is not packaged in a shell in the prior art, so that the security of firmware file transmission is low.
The above is only for the purpose of assisting understanding of the technical solution of the present invention, and does not represent an admission that the above is the prior art.
Disclosure of Invention
The invention mainly aims to provide a file compression and shell adding method, a device, equipment and a storage medium, and aims to solve the technical problem of improving the safety of firmware file transmission.
In order to achieve the above object, the present invention provides a file compression shell adding method, including:
compressing the mirror image file to be processed to obtain a target mirror image file;
compiling the target image file and the system boot data into a firmware program;
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program.
Optionally, the system boot data comprises a system boot program;
the step of determining system boot data according to the image file to be processed includes:
determining the system bootstrap program according to the mirror image file to be processed;
accordingly, the step of compiling the target image file and the system boot data into a firmware program comprises:
and compiling the target image file and the system boot program into a firmware program.
Optionally, the step of determining the system boot program according to the image file to be processed includes:
determining program function information according to the mirror image file to be processed;
and generating a system bootstrap program according to the program function information.
Optionally, the step of determining program function information according to the to-be-processed image file includes:
extracting key file data from the mirror image file to be processed;
and analyzing the key data of the file to obtain an analysis result, and determining program function information according to the analysis result.
Optionally, the step of sending the firmware program to the internet of things device so that the internet of things device processes the firmware program according to the system boot data in the firmware program includes:
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment acquires a decompression code corresponding to the firmware program and processes the firmware program according to the decompression code and the system boot program in the firmware program.
Optionally, the system boot data further comprises a system boot program and decompression code;
the step of determining system boot data according to the image file to be processed includes:
determining the system boot program and the decompression code according to the image file to be processed;
accordingly, the step of compiling the target image file and the system boot data into a firmware program includes:
compiling the target image file, the system boot program and the decompression code into a firmware program.
Optionally, the step of sending the firmware program to the internet of things device so that the internet of things device processes the firmware program according to the system boot data in the firmware program includes:
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot system and the decompression code in the firmware program.
Optionally, the step of determining a decompression code according to the image file to be processed includes:
extracting file compression information from the mirror image file to be processed;
judging whether the file compression information meets a preset encoding condition;
and when the file compression information meets the preset encoding condition, generating a decompression code according to the file compression information.
Optionally, the step of determining whether the file compression information meets a preset encoding condition includes:
when the file compression information does not meet the preset encoding condition, determining a compression missing identifier according to the file compression information;
extracting compression missing information from the target image file according to the compression missing identification;
and generating a decompression code according to the file compression information and the compression missing information.
Optionally, the step of compressing the image file to be processed to obtain a target image file includes:
determining the size of a first file according to the mirror image file to be processed;
acquiring a first preset compression rule according to the size of the first file;
and compressing the image file to be processed according to the first preset compression rule to obtain a target image file.
Optionally, the step of compressing the image file to be processed according to the first preset compression rule to obtain a target image file includes:
compressing the image file to be processed according to the first preset compression rule to obtain a compressed image file;
acquiring a second file size of the compressed mirror image file;
judging whether the size of the second file is smaller than a preset file threshold value or not;
and when the size of the second file is smaller than the preset file threshold value, taking the compressed image file as a target image file.
Optionally, after the step of determining whether the size of the second file is smaller than a preset file threshold, the method further includes:
when the size of the second file is larger than or equal to the preset file threshold value, acquiring the function type of the mirror image file to be processed;
acquiring a second preset compression rule according to the function type;
and compressing the image file to be processed according to the second preset compression rule to obtain a target image file.
In addition, in order to achieve the above object, the present invention further provides a file compressing and casing device, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a mirror image file to be processed and determining system guide data according to the mirror image file to be processed;
the compression module is used for compressing the mirror image file to be processed to obtain a target mirror image file;
the compiling module is used for compiling the target image file and the system boot data into a firmware program;
and the processing module is used for sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program.
Optionally, the system boot data comprises a system boot program;
the acquisition module is further used for determining the system bootstrap program according to the to-be-processed image file;
the compiling module is further configured to compile the target image file and the system boot program into a firmware program.
Optionally, the obtaining module is further configured to determine program function information according to the to-be-processed image file;
the acquisition module is further used for generating a system bootstrap program according to the program function information.
Optionally, the obtaining module is further configured to extract file key data from the to-be-processed image file;
the acquisition module is further used for analyzing the file key data, obtaining an analysis result and determining program function information according to the analysis result.
Optionally, the processing module is further configured to send the firmware program to an internet of things device, so that the internet of things device obtains a decompression code corresponding to the firmware program, and processes the firmware program according to the decompression code and the system boot program in the firmware program.
Optionally, the system boot data further comprises a system boot program and decompression code;
the acquisition module is further configured to determine the system boot program and the decompression code according to the to-be-processed image file;
the compiling module is further configured to compile the target image file, the system boot program, and the decompression code into a firmware program.
In addition, to achieve the above object, the present invention further provides a file compression and shelling device, including: a memory, a processor, and a file compression shell program stored on the memory and executable on the processor, the file compression shell program configured to implement the steps of the file compression shell method as described above.
In addition, to achieve the above object, the present invention further provides a storage medium, on which a file compression shell program is stored, and the file compression shell program implements the steps of the file compression shell method as described above when executed by a processor.
The method comprises the steps of firstly obtaining a to-be-processed image file, determining system boot data according to the to-be-processed image file, compressing the to-be-processed image file to obtain a target image file, then compiling the target image file and the system boot data into a firmware program, and then sending the firmware program to the Internet of things equipment so that the Internet of things equipment can process the firmware program according to the system boot data in the firmware program. Compared with the prior art, the method and the device have the advantages that the mirror image file does not need to be packaged, the mirror image file is directly operated according to the device, but the operation process of the mirror image file is complex, the mirror image file only needs to be packaged, the packaged file is transmitted to the Internet of things device, and the Internet of things device can process the mirror image file according to the packaged file, so that the transmission safety of the firmware file is improved.
Drawings
FIG. 1 is a schematic structural diagram of a file compression and shelling device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a file compression shelling method according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for compressing and shelling files according to the present invention;
fig. 4 is a block diagram of a first embodiment of the file compression and shell adding device according to the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a file compression and shelling device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the file compression shelling device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 does not constitute a limitation of a file compression shelling apparatus and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a data storage module, a network communication module, a user interface module, and a file compression shell.
In the file compression shelling device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the file compression shell device of the present invention may be disposed in the file compression shell device, and the file compression shell device calls the file compression shell program stored in the memory 1005 through the processor 1001 and executes the file compression shell method provided by the embodiment of the present invention.
An embodiment of the present invention provides a file compression and shell adding method, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of a file compression and shell adding method according to the present invention.
In this embodiment, the file compression and shell adding method includes the following steps:
step S10: and acquiring a to-be-processed image file, and determining system boot data according to the to-be-processed image file.
It is to be understood that the execution subject of this embodiment may be a file compression shell device having functions of data processing, network communication, program operation, and the like, or may also be other computer devices having similar functions, and this embodiment is not limited thereto, where the file compression shell device may be a platform system, and the embodiments and the following embodiments are described by taking the platform system as an example, and the present embodiment is not limited thereto.
It should be understood that the image file to be processed may be a bin file of the IOT firmware, may also be a bin file of other firmware, and the like, and the embodiment is not limited thereto.
The system boot data may be a system boot program or a decompression code, wherein the system boot program may be a program located on a computer or other computer application and refers to a program for booting an operating system. The boot program starting method and program are different depending on the type of the application. For example, on a common personal computer, the boot program is usually divided into two parts: the first-stage boot program is located in a Master Boot Record (MBR) for booting a second-stage boot program located on a certain partition, and the present embodiment is not limited thereto.
Further, in order to enable the image file to normally operate in the platform system, the platform system may determine a system boot program and the like on the platform system according to the image file to be processed, and the platform system may also determine a corresponding decompression code according to the image file to be processed, where the decompression code may decompress the compressed image file to be processed on the internet of things device to restore the image file and the like originally transmitted, where the system boot program and the decompression code may both exist in a form of characters, and the like, and the embodiment is not limited.
The step of determining the system boot program according to the to-be-processed image file may be that the platform system determines program function information according to the to-be-processed image file, and generates the system boot program according to the program function information, where the processing manner of determining the program function information according to the to-be-processed image file is to extract file key data from the to-be-processed image file, analyze the file key data, obtain an analysis result, and determine the program function information according to the analysis result, and the like, where the processing manner of determining the decompression code according to the to-be-processed image file may be to extract file compression information from the to-be-processed image file, determine whether the file compression information satisfies a preset encoding condition, generate the decompression code according to the file compression information when the file compression information satisfies the preset encoding condition, determine the compression missing identifier according to the file compression missing identifier when the file compression information does not satisfy the preset encoding condition, extract the compression missing information from the target image file according to the compression missing identifier, generate the decompression code according to the file compression information and the compression missing information, and the like, and this embodiment is not limited.
The program function information may be application function information in the image file, and the like, and the file key data may be key function characters in the image file, and then the key data is analyzed to obtain an analysis result, which may be an analysis result of the image file, and the like, and this embodiment is not limited.
The file compression information may be understood as compression information required in the image file, and may include content information, and may also include a plurality of information such as a name, and the preset encoding condition may be whether the compression information is complete, and when the compression information is complete, a decompression code and the like are generated according to the file compression information, where the compression missing identifier may identify a compression information missing item and the like, which is not limited in this embodiment.
Step S20: and compressing the mirror image file to be processed to obtain a target mirror image file.
It is understood that the target image file may be a compressed image file to be processed, and the present embodiment is not limited thereto.
Because the capacity of the image file to be processed is too large, the platform system needs to compress the image file to be processed, so that the compressed image file to be processed can ensure the normal operation of the decompressed image file, and the current compressed image file to be processed, that is, the target image file, can occupy a small memory, and the like.
Further, in order to reduce the occupied space of the image file, the step of compressing the image file to be processed to obtain the target image file may be that the platform system determines the size of the first file according to the image file to be processed, obtains a first preset compression rule according to the size of the first file, and then compresses the image file to be processed according to the first preset compression rule to obtain the target image file, and the like, where the size of the first file may be understood as the size of the capacity corresponding to the image file to be processed, and may be 1G, or may be 800M, and the embodiment is not limited.
The first preset compression rule may be set by a user in a self-defined manner, may be a split compression rule, and may also be an entire compression rule or a partial compression rule, and the like, which is not limited in this embodiment.
Assuming that the capacity of the to-be-processed image file is 1G, the whole compression rule may be selected, that is, the to-be-processed image file is rapidly compressed, so as to obtain the target image file, and the like.
It should be noted that, the image file to be processed is compressed according to a first preset compression rule, so as to obtain a compressed image file, obtain a second file size of the compressed image file, and determine whether the second file size is smaller than a preset file threshold, and when the second file size is smaller than the preset file threshold, the compressed image file is used as a target image file; when the size of the second file is greater than or equal to the preset file threshold, acquiring the function type of the image file to be processed, acquiring a second preset compression rule according to the function type, and compressing the image file to be processed according to the second preset compression rule to obtain a target image file and the like, where the size of the second file may be understood as the compressed image file to be processed, and may be 600M or 2M, and the embodiment is not limited.
The preset file threshold is set by a user in a self-defined manner, and may be 9M, or 15M, etc., the function type of the image file to be processed may be a service type, or may also be an entertainment type, etc., the second preset compression rule may be set by the user in a self-defined manner, or may be a split compression rule, or may also be an entire compression rule or a part of compression rule, etc., and this embodiment is not limited to this embodiment.
Assuming that the capacity of the image file to be processed is 1G, an integral compression rule may be selected, that is, the image file to be processed is rapidly compressed, so as to obtain a compressed image file, if the capacity of the compressed image file is 300M, and the preset file threshold is 200M, the function type of the processed image file is obtained, and if the function type is an entertainment type, the image file to be processed may be split and compressed, and the split and compressed image file is used as a target image file, and the like.
Step S30: and compiling the target image file and the system boot data into a firmware program.
In the platform system, the target image file and the system boot data may be subjected to data compiling to obtain a firmware program, where the firmware program may exist in a form of characters, may also exist in a form of data, and the like.
Step S40: and sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program.
The firmware program is loaded into the IOT device, the IOT device may start a system boot program in the firmware program, decompress the target image file according to the obtained decompression code, and execute the original image file to be processed according to the system boot program, and the like.
In this embodiment, first, a to-be-processed image file is obtained, system boot data is determined according to the to-be-processed image file, the to-be-processed image file is compressed to obtain a target image file, then the target image file and the system boot data are compiled into a firmware program, and then the firmware program is sent to the internet of things device, so that the internet of things device processes the firmware program according to the system boot data in the firmware program. Compared with the prior art, the image file does not need to be packaged, the image file is directly operated according to the equipment, but the operation process of the image file is complex, the image file only needs to be packaged in the embodiment, the packaged file is transmitted to the Internet of things equipment, and the Internet of things equipment can process the image file according to the packaged file, so that the transmission safety of the firmware file is improved.
Referring to fig. 3, fig. 3 is a schematic flow chart of a second embodiment of the file compression and shelling method according to the present invention.
Based on the foregoing first embodiment, in this embodiment, the step S10 further includes:
step S101: the method comprises the steps of obtaining a to-be-processed image file, and determining a system boot program and a decompression code according to the to-be-processed image file, wherein the system boot data comprises the system boot program and the decompression code.
It should be understood that the image file to be processed may be a bin file of the IOT firmware, may also be a bin file of other firmware, and the like, and the embodiment is not limited thereto.
The system boot data may be a system boot program or a decompression code, wherein the system boot program may be a program located on a computer or other computer application and refers to a program for booting an operating system. The boot program starting method and program are different depending on the type of the application. For example, on a common personal computer, the boot program is usually divided into two parts: the first-stage boot program is located in a Master Boot Record (MBR) for booting the second-stage boot program located on a certain partition, and the present embodiment is not limited thereto.
Further, in order to enable the image file to operate normally in the platform system, a system boot program and the like on the platform system may be determined according to the image file to be processed, and a corresponding decompression code may also be determined according to the image file to be processed, where the decompression code may perform decompression processing on the compressed image file to be processed on the internet of things device to restore an image file and the like that are originally transmitted, where the system boot program and the decompression code may both exist in a character form, and the like, which is not limited in this embodiment.
The step of determining the system boot program according to the to-be-processed image file may be to determine program function information according to the to-be-processed image file, and generate the system boot program according to the program function information, where the processing manner of determining the program function information according to the to-be-processed image file is to extract file key data from the to-be-processed image file, analyze the file key data, obtain an analysis result, and determine the program function information according to the analysis result, and the like, where the processing manner of determining the decompression code according to the to-be-processed image file may be to extract file compression information from the to-be-processed image file, determine whether the file compression information satisfies a preset encoding condition, generate the decompression code according to the file compression information when the file compression information satisfies the preset encoding condition, determine the compression missing identifier according to the file compression missing identifier when the file compression information does not satisfy the preset encoding condition, extract the compression missing information from the target image file according to the compression missing identifier, generate the decompression code according to the file compression missing information and the compression missing information, and the like, and this embodiment is not limited.
The program function information may be application function information in the image file, and the like, and the file key data may be key function characters in the image file, and then the key data is analyzed to obtain an analysis result, which may be an analysis result of the image file, and the like, and this embodiment is not limited.
The file compression information may be understood as compression information required in the image file, may include content information, may also include a variety of information such as a name, and the preset encoding condition may be whether the compression information is complete, and when the compression information is complete, a decompression code may be generated according to the file compression information, and when the compression information is incomplete, a compression missing identifier corresponding to the current compression information may be obtained, and a compression information missing item and the like may be identified according to the compression missing identifier, and the compression missing identifier may exist in a form of a character, may also exist in a form of a character, and the like, and this embodiment is not limited.
In this embodiment, the step S30 further includes:
step S301: compiling the target image file, the system boot program and the decompression code into a firmware program.
It is understood that the target image file may be a compressed image file to be processed, and the present embodiment is not limited thereto.
Because the capacity of the image file to be processed is too large, the image file to be processed needs to be compressed, so that the compressed image file to be processed can ensure the normal operation of the decompressed image file, and the current compressed image file to be processed, that is, the target image file, can occupy a small memory, and the like, which is not limited in this embodiment.
Further, in order to reduce the occupied space of the image file, the image file to be processed is compressed, and the step of obtaining the target image file may be determining a first file size according to the image file to be processed, obtaining a first preset compression rule according to the first file size, and then compressing the image file to be processed according to the first preset compression rule, so as to obtain the target image file, and the like, where the first file size may be understood as a capacity size corresponding to the image file to be processed, and may be 5G, or 700M, and the like, and this embodiment is not limited.
The first preset compression rule may be set by a user in a self-defined manner, may be a split compression rule, and may also be an entire compression rule or a partial compression rule, and the like, which is not limited in this embodiment.
Assuming that the capacity of the to-be-processed image file is 3G, the whole compression rule may be selected, that is, the to-be-processed image file is rapidly compressed, so as to obtain the target image file, and the like.
It should be noted that, the image file to be processed is compressed according to a first preset compression rule, the compressed image file is obtained, a second file size of the compressed image file is obtained, whether the second file size is smaller than a preset file threshold value or not is judged, and when the second file size is smaller than the preset file threshold value, the compressed image file is used as a target image file; when the size of the second file is greater than or equal to the preset file threshold, acquiring the function type of the image file to be processed, acquiring a second preset compression rule according to the function type, and compressing the image file to be processed according to the second preset compression rule to obtain a target image file and the like, where the size of the second file may be understood as the compressed image file to be processed, and may be 800M or 1M, and the embodiment is not limited.
The preset file threshold is set by a user in a self-defined manner, and may be 5M, or 10M, etc., the function type of the image file to be processed may be a service type, or may also be an entertainment type, etc., the second preset compression rule may be set by the user in a self-defined manner, or may be a split compression rule, or may also be an entire compression rule or a part of compression rule, etc., and this embodiment is not limited to this embodiment.
Assuming that the capacity of the image file to be processed is 3G, an integral compression rule may be selected, that is, the image file to be processed is rapidly compressed, so as to obtain a compressed image file, if the capacity of the compressed image file is 200M and the preset file threshold is 100M, a function type of the processed image file is obtained, and if the function type is an entertainment type, the image file to be processed may be split and compressed, and the split and compressed image file is used as a target image file, and the like.
Further, in order to ensure the security of the transmission of the target image file, a boot program and a decompression code of the target image file system may be subjected to data compiling to obtain a firmware program, where the firmware program may exist in a form of a character, may also exist in a form of data, and the like, and the present embodiment is not limited thereto.
In this embodiment, first, a to-be-processed image file is obtained, a system boot program and a decompression code are determined according to the to-be-processed image file, the to-be-processed image file is compressed to obtain a target image file, and then the target image file, the system boot program and the decompression code are compiled into a firmware program. Compared with the prior art, the method has the advantages that the image file is directly transmitted without being packaged, but the transmission security of the image file is not high, and only the image file needs to be compressed and packaged in the embodiment, so that the transmission security and efficiency of the firmware file are improved.
Referring to fig. 4, fig. 4 is a block diagram illustrating a first embodiment of a file compression and shell adding apparatus according to the present invention.
As shown in fig. 4, the file compressing and shelling device according to the embodiment of the present invention includes:
the acquisition module 4001 is configured to acquire an image file to be processed, and determine system boot data according to the image file to be processed;
the compression module 4002 is configured to compress the to-be-processed image file to obtain a target image file;
a compiling module 4003, configured to compile the target image file and the system boot data into a firmware program;
the processing module 4004 is configured to send the firmware program to an internet of things device, so that the internet of things device processes the firmware program according to the system boot data in the firmware program.
In this embodiment, first, when a service request sent by a client is received, new root certificate information and a new root certificate file are obtained according to the service request, then the new root certificate information is preprocessed to obtain target certificate data, and then the target certificate data and the new root certificate file are sent to the client, so that the client performs upgrading processing on the new root certificate file based on the target certificate data. Since the validity of the certificate is not required to be recovered by upgrading the client after the certificate expires, only the new root certificate information and the new root certificate file are required to be obtained according to the service request, and then the new root certificate file is verified based on the new root certificate information, the security of certificate transmission is ensured, and the upgrading efficiency of the certificate is improved.
Further, the system boot data comprises a system boot program;
the obtaining module 4001 is further configured to determine the system boot program according to the to-be-processed image file;
the compiling module 4003 is further configured to compile the target image file and the system boot program into a firmware program.
Further, the obtaining module 4001 is further configured to determine program function information according to the to-be-processed image file;
the acquiring module 4001 is further configured to generate a system boot program according to the program function information.
Further, the obtaining module 4001 is further configured to extract file key data from the to-be-processed image file;
the obtaining module 4001 is further configured to analyze the file key data, obtain an analysis result, and determine program function information according to the analysis result.
Further, the processing module 4004 is further configured to send the firmware program to an internet of things device, so that the internet of things device obtains a decompression code corresponding to the firmware program, and processes the firmware program according to the decompression code and the system boot program in the firmware program.
Further, the system boot data further includes a system boot program and decompression code;
the obtaining module 4001 is further configured to determine the system boot program and the decompression code according to the image file to be processed;
the compiling module 4003 is further configured to compile the target image file, the system boot program, and the decompression code into a firmware program.
Further, the processing module 4004 is further configured to send the firmware program to an internet of things device, so that the internet of things device processes the firmware program according to the system boot system and the decompression code in the firmware program.
Further, the obtaining module 4001 is further configured to extract file compression information from the to-be-processed image file;
the obtaining module 4001 is further configured to determine whether the file compression information meets a preset encoding condition;
the obtaining module 4001 is further configured to generate a decompression code according to the file compression information when the file compression information meets the preset encoding condition.
Further, the obtaining module 4001 is further configured to determine a compression missing identifier according to the file compression information when the file compression information does not satisfy the preset encoding condition;
the obtaining module 4001 is further configured to extract compression missing information from the target image file according to the compression missing identifier;
the obtaining module 4001 is further configured to generate a decompression code according to the file compression information and the compression loss information.
Further, the compression module 4002 is further configured to determine a first file size according to the to-be-processed image file;
the compression module 4002 is further configured to obtain a first preset compression rule according to the size of the first file;
the compression module 4002 is further configured to compress the to-be-processed image file according to the first preset compression rule, so as to obtain a target image file.
Further, the compression module 4002 is further configured to compress the to-be-processed image file according to the first preset compression rule, so as to obtain a compressed image file;
the compression module 4002 is further configured to obtain a second file size of the compressed image file;
the compression module 4002 is further configured to determine whether the size of the second file is smaller than a preset file threshold;
the compression module 4002 is further configured to use the compressed image file as a target image file when the size of the second file is smaller than the preset file threshold.
Further, the compression module 4002 is further configured to obtain a function type of the mirror image file to be processed when the size of the second file is greater than or equal to the preset file threshold;
the compression module 4002 is further configured to obtain a second preset compression rule according to the function type;
the compression module 4002 is further configured to compress the to-be-processed image file according to the second preset compression rule, so as to obtain a target image file.
Other embodiments or specific implementation manners of the file compression and shell adding device of the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (16)

1. A file compression shelling method is characterized by comprising the following steps:
acquiring a mirror image file to be processed, and determining system boot data according to the mirror image file to be processed;
compressing the mirror image file to be processed to obtain a target mirror image file;
compiling the target image file and the system boot data into a firmware program;
sending the firmware program to Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program;
when the system boot data comprises a system boot program,
the step of determining system boot data according to the image file to be processed comprises the following steps:
determining the system bootstrap program according to the mirror image file to be processed;
accordingly, the step of compiling the target image file and the system boot data into a firmware program includes:
compiling the target image file and the system boot program into a firmware program;
when the system boot data includes a system boot program and decompression code,
the step of determining system boot data according to the image file to be processed comprises the following steps:
determining the system bootstrap program and the decompression code according to the image file to be processed;
accordingly, the step of compiling the target image file and the system boot data into a firmware program includes:
compiling the target image file, the system boot program and the decompression code into a firmware program.
2. The method of claim 1, wherein determining the system boot from the pending image file comprises:
determining program function information according to the mirror image file to be processed;
and generating a system bootstrap program according to the program function information.
3. The method of claim 2, wherein the step of determining program function information from the image file to be processed comprises:
extracting key file data from the mirror image file to be processed;
and analyzing the key data of the file to obtain an analysis result, and determining program function information according to the analysis result.
4. The method of claim 3, wherein the step of sending the firmware program to an Internet of things device to cause the Internet of things device to process the firmware program according to the system boot data in the firmware program comprises:
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment acquires a decompression code corresponding to the firmware program and processes the firmware program according to the decompression code and the system boot program in the firmware program.
5. The method of claim 1, wherein the step of sending the firmware program to an internet of things device to cause the internet of things device to process the firmware program according to the system boot data in the firmware program comprises:
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data and the decompression code in the firmware program.
6. The method of claim 1, wherein determining the decompression code based on the image file to be processed comprises:
extracting file compression information from the mirror image file to be processed;
judging whether the file compression information meets a preset coding condition or not;
and when the file compression information meets the preset encoding condition, generating a decompression code according to the file compression information.
7. The method of claim 6, wherein the step of determining whether the file compression information satisfies a predetermined encoding condition comprises:
when the file compression information does not meet the preset encoding condition, determining a compression missing identifier according to the file compression information;
extracting compression missing information from the target image file according to the compression missing identification;
and generating a decompression code according to the file compression information and the compression missing information.
8. The method of claim 1, wherein the step of compressing the image file to be processed to obtain the target image file comprises:
determining the size of a first file according to the mirror image file to be processed;
acquiring a first preset compression rule according to the size of the first file;
and compressing the image file to be processed according to the first preset compression rule to obtain a target image file.
9. The method according to claim 8, wherein the step of compressing the image file to be processed according to the first preset compression rule to obtain a target image file comprises:
compressing the image file to be processed according to the first preset compression rule to obtain a compressed image file;
acquiring a second file size of the compressed mirror image file;
judging whether the size of the second file is smaller than a preset file threshold value or not;
and when the size of the second file is smaller than the preset file threshold value, taking the compressed image file as a target image file.
10. The method of claim 9, wherein the step of determining whether the second file size is less than a predetermined file threshold further comprises:
when the size of the second file is larger than or equal to the preset file threshold value, acquiring the function type of the mirror image file to be processed;
acquiring a second preset compression rule according to the function type;
and compressing the image file to be processed according to the second preset compression rule to obtain a target image file.
11. A file compression shelling apparatus, said file compression shelling apparatus comprising:
an acquisition module for acquiring the image file to be processed and determining according to the image file to be processed
System boot data;
the compression module is used for compressing the mirror image file to be processed to obtain a target mirror image file;
the compiling module is used for compiling the target image file and the system boot data into a firmware program;
the processing module is used for sending the firmware program to the Internet of things equipment so that the Internet of things equipment processes the firmware program according to the system boot data in the firmware program;
when the system boot data comprises a system boot program,
the determining system boot data according to the to-be-processed image file includes:
determining the system bootstrap program according to the mirror image file to be processed;
accordingly, the compiling the target image file and the system boot data into a firmware program includes:
compiling the target image file and the system boot program into a firmware program;
when the system boot data includes a system boot program and decompression code,
the determining system boot data according to the image file to be processed includes:
determining the system boot program and the decompression code according to the image file to be processed;
accordingly, the compiling the target image file and the system boot data into a firmware program includes:
compiling the target image file, the system boot program and the decompression code into a firmware program.
12. The apparatus of claim 11, wherein the obtaining module, configured to determine the system boot program according to the image file to be processed, comprises:
determining program function information according to the mirror image file to be processed;
and generating a system bootstrap program according to the program function information.
13. The apparatus of claim 12, wherein the obtaining module is configured to determine program function information according to the image file to be processed, and includes:
extracting key file data from the mirror image file to be processed;
and analyzing the key data of the file to obtain an analysis result, and determining program function information according to the analysis result.
14. The apparatus of claim 13, wherein the processing module is configured to send the firmware program to an internet of things device, so that the internet of things device processes the firmware program according to the system boot data in the firmware program, and includes:
and sending the firmware program to the Internet of things equipment so that the Internet of things equipment acquires a decompression code corresponding to the firmware program and processes the firmware program according to the decompression code and the system boot program in the firmware program.
15. A file compression shelling device, said device comprising: memory, a processor and a file compression shell program stored on the memory and executable on the processor, the file compression shell program being configured to implement the steps of the file compression shell method as claimed in any one of claims 1 to 10.
16. A storage medium having stored thereon a file compression shell program, which when executed by a processor implements the steps of the file compression shell method according to any one of claims 1 to 10.
CN202011541979.5A 2020-12-23 2020-12-23 File compression shell adding method, device, equipment and storage medium Active CN112612473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011541979.5A CN112612473B (en) 2020-12-23 2020-12-23 File compression shell adding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011541979.5A CN112612473B (en) 2020-12-23 2020-12-23 File compression shell adding method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112612473A CN112612473A (en) 2021-04-06
CN112612473B true CN112612473B (en) 2022-11-04

Family

ID=75244610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011541979.5A Active CN112612473B (en) 2020-12-23 2020-12-23 File compression shell adding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112612473B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520993A (en) * 2011-12-06 2012-06-27 深圳市共进电子股份有限公司 Method for transplanting universal boot loader on specific hardware platform
CN105677348A (en) * 2016-01-04 2016-06-15 青岛海信信芯科技有限公司 BOOT program storing method and device and BOOT program starting method and device
CN109471642A (en) * 2018-11-15 2019-03-15 北京行易道科技有限公司 Firmware generates storage method and device, firmware start method and device
CN110895477A (en) * 2018-09-13 2020-03-20 杭州海康威视数字技术股份有限公司 Equipment starting method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520993A (en) * 2011-12-06 2012-06-27 深圳市共进电子股份有限公司 Method for transplanting universal boot loader on specific hardware platform
CN105677348A (en) * 2016-01-04 2016-06-15 青岛海信信芯科技有限公司 BOOT program storing method and device and BOOT program starting method and device
CN110895477A (en) * 2018-09-13 2020-03-20 杭州海康威视数字技术股份有限公司 Equipment starting method, device and equipment
CN109471642A (en) * 2018-11-15 2019-03-15 北京行易道科技有限公司 Firmware generates storage method and device, firmware start method and device

Also Published As

Publication number Publication date
CN112612473A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
US7234165B1 (en) Malware scanning of compressed computer files
EP3401782B1 (en) File identification method and related device
CN103123588A (en) Method and system for obtaining difference upgrade patch
CN109922049B (en) Verification device and method based on block chain
CN111352912A (en) Compressed file processing method, device, storage medium, terminal and server
CN110753312A (en) Data sharing method, device and system and computer readable storage medium
CN113535263A (en) Dynamic library calling method and device, computer equipment and storage medium
CN112612473B (en) File compression shell adding method, device, equipment and storage medium
CN112632536B (en) Memory loading method based on PE file transformation
CN114745681B (en) Rich media information display method, rich media information display equipment and computer storage medium
CN113703877B (en) Method and device for generating image based on image generation plug-in and readable storage medium
CN114095037B (en) Application program updating method, updating data compression method, device and equipment
CN112823349A (en) Data processing method, data processing device, electronic equipment and storage medium
CN110061861B (en) Internet protocol configuration method, device, equipment and computer readable storage medium
CN115883359A (en) Upgrade installation method and device, system, electronic equipment and storage medium thereof
CN113360902B (en) shellcode detection method and device, computer equipment and computer storage medium
CN110647753B (en) Method, device and equipment for acquiring kernel file and storage medium
CN114218175A (en) Resource cross-platform sharing method and device, terminal equipment and storage medium
CN109407974B (en) Electronic device, picture deleting method based on mixed binary code and storage medium
CN108734149B (en) Text data scanning method and device
CN113127860A (en) Executable file detection method, device, terminal and storage medium
KR20170101693A (en) Apparatus and method for analyzing android application, and computer-readable medium storing program for method thereof
CN111080728A (en) Map processing method, device, equipment and storage medium
CN113283215B (en) Data confusion method and device based on UTF-32 coding
CN111079202A (en) Information display method and device of terminal equipment and terminal equipment

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