CN113377401A - Method and tool for packaging version file of embedded device - Google Patents
Method and tool for packaging version file of embedded device Download PDFInfo
- Publication number
- CN113377401A CN113377401A CN202110693074.8A CN202110693074A CN113377401A CN 113377401 A CN113377401 A CN 113377401A CN 202110693074 A CN202110693074 A CN 202110693074A CN 113377401 A CN113377401 A CN 113377401A
- Authority
- CN
- China
- Prior art keywords
- file
- packaging
- tool
- index code
- files
- 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.)
- Pending
Links
- 238000004806 packaging method and process Methods 0.000 title claims abstract description 48
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000012856 packing Methods 0.000 claims description 19
- 238000004422 calculation algorithm Methods 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 8
- 125000004122 cyclic group Chemical group 0.000 claims description 6
- 238000012858 packaging process Methods 0.000 abstract description 5
- 238000013515 script Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- 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/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Library & Information Science (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a method and a tool for packaging version files of embedded equipment, and particularly relates to the technical field of packaging methods, wherein the method comprises the following steps: when the files need to be packaged, a packaging directory is created by using a packaging tool, and a file directory path needing to be packaged is placed in the packaging directory. The invention can automatically delete the added duplicate files by inserting the redundancy-resistant plug-in the packaging system, simultaneously the index code generation module can generate a new index code, and then the association module can associate the new index code with the repeated unique file, so that related personnel can inquire the duplicate files through the index code, and the device can delete unnecessary duplicate files without influencing normal inquiry in the packaging process and after packaging, thereby reducing the size of the files to a certain extent, greatly reducing the packaging time and simultaneously reducing the occupied space of the whole file.
Description
Technical Field
The invention relates to the technical field of packaging methods, in particular to a method and a tool for packaging version files of embedded equipment.
Background
Firmware upgrade refers to improving a working program or a source code in hardware through a special upgrade program, so that compatibility, performance or function of the firmware upgrade is improved, the security of a firmware upgrade file (bin file) is a necessary condition of the security of an embedded system, the integrity of the bin file determines whether the upgrade of the embedded device is successful, one bin file contains many resources, such as images, sounds, texts, scripts and other various types of data, general clients may store tens of thousands of files, and some redundant data are not lost, so that a long time is wasted in the packaging process, and a large amount of unnecessary space is occupied.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a method and a tool for packaging version files of embedded equipment, and the technical problems to be solved by the invention are that: a bin file contains many resources, such as images, sounds, texts, scripts and other various types of data, and a typical client may have tens of thousands of files, which contain some redundant data, so that a long time is wasted in the packaging process and a large amount of unnecessary space is occupied.
In order to achieve the purpose, the invention provides the following technical scheme: a method and a packaging tool for packaging version files of embedded equipment comprise the following steps:
s1, when the files need to be packed, a packing directory is created by using a packing tool, a file directory path needing to be packed is placed in the packing directory, then the files to be packed are collected and read, wherein each file is described by at least one file item, each file item comprises a plurality of file information used for describing the content of the file, in the reading process, the sequence of the files is collected and recorded as a file sequence list, meanwhile, whether the file is a common file or a file needing to be encrypted is judged according to the attribute of the file, then the content of the common file is compared, redundant data is removed, if one file corresponds to two or more positions, an index code used for accessing the same file can be generated, and then the content in the encrypted file is processed in the same method.
S2, processing the encrypted file separately, determining the encryption algorithm and generating the encryption key, encrypting each module of the encrypted file respectively by using the encryption key, cutting the file into an embedded system, compiling to generate a standard Linux kernel file and a rootfs file system mirror image, comparing the standard Linux kernel files generated by different cutting requirements, removing the same part of the head of the standard Linux kernel file, grouping the cut same part back to the head of the standard Linux kernel file in the process of equipment upgrading, packing the bin file, performing CRC check calculation on the packed bin file, writing the obtained CRC check value into the tail of the bin file, reading all the nodes to be packed from the node label file, wherein the update packages of the nodes contain update files of different versions, and performing basic node analysis on the nodes to be packed in the label file, And dividing common nodes and important nodes, and then performing outer layer traversal on all nodes needing to be packaged according to a reverse order mode.
S3, when traversing to a certain node, exporting the update file of the node and storing in a packed file list, after traversing all important nodes, judging whether all files have been read, if yes, stopping packing, if not, inquiring the files which are not read and reading again, stopping packing after reading is completed, then inserting an anti-redundancy plug-in into the packing system, wherein the anti-redundancy plug-in comprises an additional comparison module, an index code generation module and an association module, when a file is newly added, the additional comparison module can automatically compare the added file with the previously packed file, if the added file has the duplication with the previous file, the duplicated file is automatically deleted, meanwhile, the index code generation module can generate a new index code, then the association module can associate the new index code with the duplicated unique file, and related personnel can inquire the repeated file through the index code.
As a further scheme of the invention: and performing inner-layer traversal on unselected nodes needing to be packed between the two adjacent nodes needing to be packed according to a reverse order mode.
As a further scheme of the invention: and encrypting by using an encryption algorithm when the bin file is packaged, wherein the encryption algorithm is an MD5 encryption algorithm.
As a further scheme of the invention: the output end of the additional comparison module is electrically connected with the input end of the index code generation module, and the output end of the index code generation module is electrically connected with the input end of the correlation module.
As a further scheme of the invention: the function of the added comparison module is used for comparing the added file with the previous file and determining whether a duplicate file exists.
As a further scheme of the invention: the index code generation module may automatically generate a set of codes for the file, and the association module may associate the index codes with the file.
As a further scheme of the invention: the specific method for calculating the CRC check is as follows: and (3) adopting a 32-bit cyclic redundancy algorithm, dividing binary data t (x) to be packaged by a generator polynomial g (x), taking the final remainder as a CRC (Cyclic redundancy check) value, and writing the calculation result into the tail of the bin file.
As a further scheme of the invention: the packaging tool is a Webpack packaging tool.
As a further scheme of the invention: the Webpack packaging tool can simultaneously perform a plurality of packaging tasks.
The invention has the beneficial effects that:
the invention can automatically delete the added duplicate files by inserting the redundancy-resistant plug-in the packaging system, simultaneously the index code generation module can generate a new index code, and then the association module can associate the new index code with the repeated unique file, so that related personnel can inquire the duplicate files through the index code, and the device can delete unnecessary duplicate files without influencing normal inquiry in the packaging process and after packaging, thereby reducing the size of the files to a certain extent, greatly reducing the packaging time and simultaneously reducing the occupied space of the whole file.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A method and a packaging tool for packaging version files of embedded equipment comprise the following steps:
s1, when the files need to be packed, a packing directory is created by using a packing tool, a file directory path needing to be packed is placed in the packing directory, then the files to be packed are collected and read, wherein each file is described by at least one file item, each file item comprises a plurality of file information used for describing the content of the file, in the reading process, the sequence of the files is collected and recorded as a file sequence list, meanwhile, whether the file is a common file or a file needing to be encrypted is judged according to the attribute of the file, then the content of the common file is compared, redundant data is removed, if one file corresponds to two or more positions, an index code used for accessing the same file can be generated, and then the content in the encrypted file is processed in the same method.
S2, processing the encrypted file separately, determining the encryption algorithm and generating the encryption key, encrypting each module of the encrypted file respectively by using the encryption key, cutting the file into an embedded system, compiling to generate a standard Linux kernel file and a rootfs file system mirror image, comparing the standard Linux kernel files generated by different cutting requirements, removing the same part of the head of the standard Linux kernel file, grouping the cut same part back to the head of the standard Linux kernel file in the process of equipment upgrading, packing the bin file, performing CRC check calculation on the packed bin file, writing the obtained CRC check value into the tail of the bin file, reading all the nodes to be packed from the node label file, wherein the update packages in the nodes contain update files of different versions, and performing basic node calculation on the nodes to be packed in the label file, And dividing common nodes and important nodes, and then performing outer layer traversal on all nodes needing to be packaged according to a reverse order mode.
S3, when traversing to a certain node, exporting the update file of the node and storing in a packed file list, after traversing all important nodes, judging whether all files have been read, if yes, stopping packing, if not, inquiring the files which are not read and reading again, stopping packing after reading is completed, then inserting an anti-redundancy plug-in into the packing system, wherein the anti-redundancy plug-in comprises an additional comparison module, an index code generation module and an association module, when a file is newly added, the additional comparison module can automatically compare the additionally added file with the previously packed file, if the additionally added file has the duplication with the previous file, the duplicate file is automatically deleted, meanwhile, the index code generation module can generate a new index code, and then the association module can associate the new index code with the duplicated unique file, and related personnel can inquire the repeated file through the index code.
And performing inner-layer traversal on unselected nodes needing to be packed between two adjacent nodes needing to be packed according to a reverse order mode.
And encrypting by using an encryption algorithm when packing the bin file, wherein the encryption algorithm is an MD5 encryption algorithm.
The output end of the additional comparison module is electrically connected with the input end of the index code generation module, and the output end of the index code generation module is electrically connected with the input end of the correlation module.
The function of the added comparison module is used for comparing the added file with the previous file and determining whether a duplicate file exists.
The index code generation module may automatically generate a set of codes for the file, and the association module may associate the index codes with the file.
The specific method of CRC check calculation is as follows: and (3) adopting a 32-bit cyclic redundancy algorithm, dividing binary data t (x) to be packaged by a generator polynomial g (x), taking the final remainder as a CRC (Cyclic redundancy check) value, and writing the calculation result into the tail of the bin file.
The packaging tool is a Webpack packaging tool.
The Webpack packaging tool can perform multiple packaging tasks simultaneously.
In summary, the redundancy-resistant plug-in is inserted into the packaging system, so that the redundancy plug-in can automatically delete the added duplicate files, the index code generation module can generate new index codes, and the association module can associate the new index codes with the unique duplicate files, so that related personnel can inquire the duplicate files through the index codes, unnecessary duplicate files can be deleted by the device in the packaging process and after packaging without influencing normal inquiry, the size of the files is reduced to a certain extent, the packaging time can be greatly reduced, and the occupied space of the whole file is reduced.
The points to be finally explained are: although the present invention has been described in detail with reference to the general description and the specific embodiments, on the basis of the present invention, the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. A method and a packaging tool for packaging version files of embedded equipment are characterized by comprising the following steps:
s1, when a file needs to be packaged, a packaging directory is created by using a packaging tool, a file directory path needing to be packaged is placed in the packaging directory, then the file to be packaged is collected and read, wherein each file is described by at least one file item, each file item comprises a plurality of file information used for describing the content of the file, in the reading process, the sequence of the file is collected and recorded as a file sequence list, meanwhile, whether the file is a common file or a file needing to be encrypted is judged according to the attribute of the file, then the content of the common file is compared, redundant data is removed, if one file corresponds to two or more positions, an index code used for accessing the same file can be generated, and then the content in the encrypted file is processed in the same method;
s2, processing the encrypted file separately, determining the encryption algorithm and generating the encryption key, encrypting each module of the encrypted file respectively by using the encryption key, cutting the file into an embedded system, compiling to generate a standard Linux kernel file and a rootfs file system mirror image, comparing the standard Linux kernel files generated by different cutting requirements, removing the same part of the head of the standard Linux kernel file, grouping the cut same part back to the head of the standard Linux kernel file in the process of equipment upgrading, packing the bin file, performing CRC check calculation on the packed bin file, writing the obtained CRC check value into the tail of the bin file, reading all the nodes to be packed from the node label file, wherein the update packages of the nodes contain update files of different versions, and performing basic node analysis on the nodes to be packed in the label file, Dividing common nodes and important nodes, and then performing outer layer traversal on all nodes needing to be packaged according to a reverse order mode;
s3, when traversing to a certain node, exporting the update file of the node and storing in a packed file list, after traversing all important nodes, judging whether all files have been read, if yes, stopping packing, if not, inquiring the files which are not read and reading again, stopping packing after reading is completed, then inserting an anti-redundancy plug-in into the packing system, wherein the anti-redundancy plug-in comprises an additional comparison module, an index code generation module and an association module, when a file is newly added, the additional comparison module can automatically compare the added file with the previously packed file, if the added file has the duplication with the previous file, the duplicated file is automatically deleted, meanwhile, the index code generation module can generate a new index code, then the association module can associate the new index code with the duplicated unique file, and related personnel can inquire the repeated file through the index code.
2. The method and the tool for packaging the version file of the embedded device according to claim 1, wherein: and performing inner-layer traversal on unselected nodes needing to be packed between the two adjacent nodes needing to be packed according to a reverse order mode.
3. The method and the tool for packaging the version file of the embedded device according to claim 1, wherein: and encrypting by using an encryption algorithm when the bin file is packaged, wherein the encryption algorithm is an MD5 encryption algorithm.
4. The method and the tool for packaging the version file of the embedded device according to claim 1, wherein: the output end of the additional comparison module is electrically connected with the input end of the index code generation module, and the output end of the index code generation module is electrically connected with the input end of the correlation module.
5. The method and the tool for packaging the version file of the embedded device according to claim 4, wherein: the function of the added comparison module is used for comparing the added file with the previous file and determining whether a duplicate file exists.
6. The method and the tool for packaging the version file of the embedded device according to claim 4, wherein: the index code generation module may automatically generate a set of codes for the file, and the association module may associate the index codes with the file.
7. The method and the tool for packaging the version file of the embedded device according to claim 1, wherein: the specific method for calculating the CRC check is as follows: and (3) adopting a 32-bit cyclic redundancy algorithm, dividing binary data t (x) to be packaged by a generator polynomial g (x), taking the final remainder as a CRC (Cyclic redundancy check) value, and writing the calculation result into the tail of the bin file.
8. The method and the tool for packaging the version file of the embedded device according to the claims 1 to 7, wherein the method comprises the following steps: the packaging tool is a Webpack packaging tool.
9. The embedded device version file packaging tool of claim 8, wherein: the Webpack packaging tool can simultaneously perform a plurality of packaging tasks.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110693074.8A CN113377401A (en) | 2021-06-22 | 2021-06-22 | Method and tool for packaging version file of embedded device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110693074.8A CN113377401A (en) | 2021-06-22 | 2021-06-22 | Method and tool for packaging version file of embedded device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113377401A true CN113377401A (en) | 2021-09-10 |
Family
ID=77578395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110693074.8A Pending CN113377401A (en) | 2021-06-22 | 2021-06-22 | Method and tool for packaging version file of embedded device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113377401A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115935399A (en) * | 2023-01-05 | 2023-04-07 | 南通昌硕信息科技有限公司 | Cell-phone APP packing processing system based on artificial intelligence |
CN116302008A (en) * | 2023-05-19 | 2023-06-23 | 深圳市百酷新能源有限公司 | Firmware updating method and device, electronic equipment and storage medium |
WO2023237047A1 (en) * | 2022-06-10 | 2023-12-14 | 华为技术有限公司 | Data processing method and electronic device |
CN117909301A (en) * | 2024-03-19 | 2024-04-19 | 上海合见工业软件集团有限公司 | Index-based object query method, device, equipment and medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013040708A1 (en) * | 2011-09-19 | 2013-03-28 | Quickplay Media Inc. | Media processor |
CN107688463A (en) * | 2017-09-21 | 2018-02-13 | 杭州全维技术股份有限公司 | A kind of method of embedded device version file packing |
CN107992311A (en) * | 2017-12-27 | 2018-05-04 | 北京酷我科技有限公司 | A kind of method of rapid batch packing generation APK file |
-
2021
- 2021-06-22 CN CN202110693074.8A patent/CN113377401A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013040708A1 (en) * | 2011-09-19 | 2013-03-28 | Quickplay Media Inc. | Media processor |
CN107688463A (en) * | 2017-09-21 | 2018-02-13 | 杭州全维技术股份有限公司 | A kind of method of embedded device version file packing |
CN107992311A (en) * | 2017-12-27 | 2018-05-04 | 北京酷我科技有限公司 | A kind of method of rapid batch packing generation APK file |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023237047A1 (en) * | 2022-06-10 | 2023-12-14 | 华为技术有限公司 | Data processing method and electronic device |
CN115935399A (en) * | 2023-01-05 | 2023-04-07 | 南通昌硕信息科技有限公司 | Cell-phone APP packing processing system based on artificial intelligence |
CN116302008A (en) * | 2023-05-19 | 2023-06-23 | 深圳市百酷新能源有限公司 | Firmware updating method and device, electronic equipment and storage medium |
CN117909301A (en) * | 2024-03-19 | 2024-04-19 | 上海合见工业软件集团有限公司 | Index-based object query method, device, equipment and medium |
CN117909301B (en) * | 2024-03-19 | 2024-06-07 | 上海合见工业软件集团有限公司 | Index-based object query method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113377401A (en) | Method and tool for packaging version file of embedded device | |
US11314701B2 (en) | Resharding method and system for a distributed storage system | |
US8631052B1 (en) | Efficient content meta-data collection and trace generation from deduplicated storage | |
US10126972B1 (en) | Method and apparatus for block level data de-duplication | |
US8402063B2 (en) | Restoring data backed up in a content addressed storage (CAS) system | |
US8667032B1 (en) | Efficient content meta-data collection and trace generation from deduplicated storage | |
CN106933703B (en) | Database data backup method and device and electronic equipment | |
US10666435B2 (en) | Multi-tenant encryption on distributed storage having deduplication and compression capability | |
CN109791538B (en) | Data storage system and execution method thereof | |
CN107688463B (en) | Method for packaging version file of embedded equipment | |
CN102999433B (en) | Redundant data deletion method and system of virtual disks | |
CN107229420A (en) | Date storage method, read method, delet method and data operation system | |
CN108141229B (en) | Method and system for efficient detection of corrupted data | |
US10256977B2 (en) | Methods and systems for efficient representation of file sets | |
CN112612576B (en) | Virtual machine backup method and device, electronic equipment and storage medium | |
CN114860745B (en) | Database expansion method based on artificial intelligence and related equipment | |
US6553388B1 (en) | Database deltas using Cyclic Redundancy Checks | |
US20190215152A1 (en) | End-to-end checksum in a multi-tenant encryption storage system | |
US7949630B1 (en) | Storage of data addresses with hashes in backup systems | |
TW201335779A (en) | File synchronization system and method | |
CN106156076B (en) | The method and system of data processing | |
CN117349860B (en) | File storage system and method based on matrix change and data segmentation | |
CN111625396B (en) | Backup data verification method, server and storage medium | |
CN111444194B (en) | Method, device and equipment for clearing indexes in block chain type account book | |
CN114463045A (en) | Material file uploading method, device, equipment and storage medium |
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 |