CN112612473A - File compression shell adding method, device, equipment and storage medium - Google Patents
File compression shell adding method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112612473A CN112612473A CN202011541979.5A CN202011541979A CN112612473A CN 112612473 A CN112612473 A CN 112612473A CN 202011541979 A CN202011541979 A CN 202011541979A CN 112612473 A CN112612473 A CN 112612473A
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of internet, and discloses a file compression 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
Technical Field
The invention relates to the technical field of internet, in particular to a file compression shell adding method, a device, equipment and a storage medium.
Background
In the prior art, a key compression shell reinforcing technology for an Internet of Things (Internet of Things IOT) device directly encapsulates firmware files uniformly and transmits the encapsulated files, but in the prior art, complex firmware is not processed, 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 device is increased, and meanwhile, in the prior art, the firmware is not encapsulated in a shell, so that the security of firmware file transmission is low.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is 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 and 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 includes:
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;
the processing module is used for 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.
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, in order to achieve the above object, the present invention further provides a file compression shelling apparatus, 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, when executed by a processor, implements the steps of the file compression shell method as described above.
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 equipment, the operation process of the mirror image file is complex, the packaged file is transmitted to the Internet of things equipment only by packaging the mirror image file, and the Internet of things equipment processes the mirror image file according to the packaged file, so that the safety of firmware file transmission 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 compressing and shelling apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained 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 shelling device according to the present invention may be disposed in the file compression shelling device, and the file compression shelling device calls the file compression shelling program stored in the memory 1005 through the processor 1001 and executes the file compression shelling method according to 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 the 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: the method comprises the steps of obtaining 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 generally 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 and the like according to the program function information, wherein the processing method 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 and the like according to the analysis result, wherein the processing method 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, and when the file compression information does not satisfy 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 identifier, and generating a decompression code according to the file compression information and the compression missing information, which is not limited in this embodiment.
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, 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 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 shelling method according to the present invention.
Based on the 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 generally 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, 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 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 this embodiment is not limited.
The step of determining the system boot program according to the to-be-processed image file may be determining program function information according to the to-be-processed image file, and generating the system boot program and the like according to the program function information, wherein the processing method 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 and the like according to the analysis result, wherein the processing method of determining the decompression code according to the to-be-processed image file may be extracting file compression information from the to-be-processed image file, determining whether the file compression information satisfies a preset encoding condition, when the file compression information satisfies the preset encoding condition, generating the decompression code according to the file compression information, when the file compression information does not satisfy 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 identifier, and generating a decompression code according to the file compression information and the compression missing information, which is not limited in this embodiment.
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.
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 compressing and shelling device 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 upgrade processing on the new root certificate file based on the target certificate data. The validity of the certificate is recovered through the upgrading client side without the need of recovering the certificate after the certificate expires, and only the new root certificate information and the new root certificate file are acquired according to the service request, and then the new root certificate file is verified based on the new root certificate information, so that the safety 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 missing 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 to-be-processed image file 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 phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises 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.
The invention discloses A1 and a file compression and shell adding method, wherein the file compression and shell adding method comprises the following steps:
acquiring a to-be-processed image file, and determining system boot data according to the to-be-processed image file;
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.
A2, the method of claim a1, the system boot data comprising 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 includes:
and compiling the target image file and the system boot program into a firmware program.
A3, the method of claim A2, the step of determining the system boot program from the pending image file comprising:
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.
A4, the method of claim A3, wherein the step of determining program function information from the pending image file 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.
A5, the method of claim a4, wherein 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 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.
A6, the method of claim a1, the system boot data further comprising 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.
A7, the method of claim a6, wherein 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 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 system and the decompression code in the firmware program.
A8, the method of claim a6, the step of determining decompression code from the pending image file comprising:
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.
A9, the method of claim A8, wherein the step of determining whether the file compression information satisfies preset encoding conditions 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.
A10, the method of claim A1, 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.
A11, the method of claim A10, wherein the step of compressing the image file to be processed according to the first preset compression rule to obtain the 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.
A12, the method of claim A11, further comprising, after the step of determining whether the second file size is smaller than a preset file threshold:
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.
The invention also discloses B13, a file compression and shell adding device, which comprises:
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;
the processing module is used for 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.
B14, the apparatus of claim B13, the system boot data comprising 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.
B15, the apparatus according to claim B14, the obtaining module further configured to determine program function information according to the image file to be processed;
the acquisition module is further used for generating a system bootstrap program according to the program function information.
B16, the apparatus according to claim B15, the obtaining module further configured to extract key file data from the image file to be processed;
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.
B17, the apparatus according to claim B16, wherein 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.
B18, the apparatus of claim B13, the system boot data further comprising 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.
The invention also discloses C19, a file compression and shell adding device, which comprises: 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.
The invention also discloses D20 and a storage medium, wherein the storage medium is stored with a file compression shell adding program, and the file compression shell adding program realizes the steps of the file compression shell adding method when being executed by a processor.
Claims (10)
1. A file compression shelling method is characterized by comprising the following steps:
acquiring a to-be-processed image file, and determining system boot data according to the to-be-processed image file;
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.
2. The method of claim 1, wherein 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 includes:
and compiling the target image file and the system boot program into a firmware program.
3. The method of claim 2, 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.
4. The method of claim 3, 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.
5. The method of claim 4, 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.
6. The method of claim 1, wherein 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.
7. The method of claim 6, 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 system and the decompression code in the firmware program.
8. A file compression shelling apparatus, said file compression shelling apparatus comprising:
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;
the processing module is used for 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.
9. A file compression shelling device, said device comprising: a memory, a processor, and a file compression shelling program stored on the memory and executable on the processor, the file compression shelling program configured to implement the steps of the file compression shelling method as claimed in any one of claims 1 to 7.
10. 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 of any of claims 1 to 7.
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 true CN112612473A (en) | 2021-04-06 |
CN112612473B 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)
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 |
-
2020
- 2020-12-23 CN CN202011541979.5A patent/CN112612473B/en active Active
Patent Citations (4)
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 |
---|---|
CN112612473B (en) | 2022-11-04 |
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 | |
CN108399319B (en) | Source code protection method, application server and computer readable storage medium | |
CN104217165B (en) | The processing method of file and device | |
CN111724248A (en) | Deployment method of machine learning algorithm, micro-expression recognition method and terminal equipment | |
CN110753312A (en) | Data sharing method, device and system and computer readable storage medium | |
CN111782511B (en) | Firmware file analysis method, equipment and storage medium | |
CN112035401A (en) | Model data processing method and device, electronic equipment and readable medium | |
CN113535263A (en) | Dynamic library calling method and device, computer equipment and storage medium | |
CN105975302A (en) | Application installation method and terminal | |
CN112632536B (en) | Memory loading method based on PE file transformation | |
CN112612473B (en) | File compression shell adding method, device, equipment and storage medium | |
CN111400736B (en) | Application program encryption method and device, storage medium and electronic equipment | |
CN110505289B (en) | File downloading method and device, computer readable medium and wireless communication equipment | |
CN102377793A (en) | Flash interaction method and device based on mobile communication equipment terminal | |
CN113703877B (en) | Method and device for generating image based on image generation plug-in and readable storage medium | |
CN110061861B (en) | Internet protocol configuration method, device, equipment and computer readable storage medium | |
CN113127860B (en) | Executable file detection method, device, terminal and storage medium | |
CN110046504B (en) | SO file hiding method, storage medium and device based on Linker | |
CN110580165A (en) | Software program distribution method, device, computer equipment and storage medium | |
CN114095203B (en) | Data encryption interaction method, device and readable medium | |
CN110928754A (en) | Operation and maintenance auditing method, device, equipment and medium | |
CN118605967A (en) | Dynamic library loading method, device, equipment, storage medium and product | |
CN118444975A (en) | Firmware analysis method, storage medium and device |
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 |