Application packaging, compressing and loading method and device based on Flash file system
By tar packaging and gzip compression of the application to generate a .tar.gz compressed package, and then decompressing and unpacking it in the memory file system, the problems of poor random read performance and insufficient storage space of the Flash file system in airborne avionics systems are solved, achieving efficient application loading and storage space saving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TAIYUAN AERO INSTR
- Filing Date
- 2025-12-27
- Publication Date
- 2026-05-12
AI Technical Summary
Existing Flash file systems suffer from poor random read performance, long boot times, and insufficient storage space in airborne avionics systems, especially in service-oriented and component-based environments, resulting in insufficient device boot times and storage capacity.
The application is packaged using tar and gzip to generate a .tar.gz compressed file, which is then transferred to the target machine's Flash file system via FTP. After the target machine boots up, the file system is decompressed and unpacked in the memory file system. Finally, the application is loaded from the memory file system. This avoids the problems of poor random read performance and frequent erasure and writing of small files in the Flash file system, and uses memory copying and replacement loading.
It significantly shortens application loading time, improves burning efficiency, saves storage space, and solves the problems of insufficient device startup time and storage space. The compression rate can reach over 70%.
Smart Images

Figure CN122019008A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of embedded application loading technology for avionics systems, and specifically relates to an application packaging, compression and loading method and apparatus based on the Flash file system. Background Technology
[0002] As the application requirements of modern aircraft become more complex, avionics systems have undergone a transformation towards service-oriented and component-based architectures. The software image files of airborne equipment are no longer the original single executable files (.bin or .elf files). Application target programs also contain a large number of configuration files (such as .ini files), data files (such as .json files), dynamic library files (such as .so files), etc. The large number and size of files have led to increasingly higher requirements for the airborne equipment file system.
[0003] Flash memory is widely used in airborne avionics systems, especially for certain small airborne devices. It must meet stringent economic and technical requirements such as cost, power consumption, size, weight, and boot time, as well as increasingly demanding technical requirements, which poses a huge challenge to the use of Flash file systems.
[0004] Flash file systems exhibit good sequential read performance, but when handling random read requests, read performance fluctuates due to the frequent addressing of different storage locations by the file system and the internal management mechanisms of the flash chip (such as wear leveling and garbage collection). This performance degradation is particularly pronounced as file fragmentation increases with storage device usage. When onboard devices use Flash file systems to store a large number of application target files, the scattered distribution of these files means that executable files randomly read configuration files, data files, and dynamic library files from the Flash file system during startup. This results in a significant time requirement for loading the entire application, failing to meet the device's startup time requirements.
[0005] Furthermore, the block-based erasure and write-after-erase characteristic of Flash memory means that even when writing small files, the entire block must be erased before new data can be written, significantly increasing the time overhead of write operations. In service-oriented and component-based development environments, the large number and varying sizes of application target files highlight the poor random write performance of the Flash file system, leading to excessively long application programming times and hindering overall system performance.
[0006] At the same time, Flash storage capacity is limited. Generally, Flash storage chips have a storage capacity of 32MB or 64MB. When storing executable files and a large number of dynamic library files, some airborne devices often encounter situations where the storage space is insufficient or the margin is not up to standard due to too many or too large target programs. Summary of the Invention
[0007] This invention provides an application packaging, compression, and loading method and apparatus based on a Flash file system, which can solve the problem of insufficient startup time of onboard devices; effectively shorten the application burning time; and solve the problem of insufficient storage space capacity or inadequate margin of onboard devices.
[0008] The first aspect of this invention provides a method for packaging, compressing, and loading applications based on a Flash file system, comprising the following steps: The application is packaged using tar and gzip compression, and all target files are generated into a .tar.gz compressed package, which is then transferred to the target machine's Flash file system via FTP. After the target machine boots up, the operating system program creates a memory file system, completes the decompression and unpacking of the .tar.gz compressed package in the memory file system, and finally boots the application from the memory file system.
[0009] Optionally, the application target file may contain multiple configuration files, data files, dynamic library files, executable files, and corresponding file directories; Package the application into a tar archive, including: Use tar to combine multiple files and directories into a single archive file; Archived files contain metadata information for files and directories, the actual content of the files, and the structural information of the directories.
[0010] Optionally, data can be transferred to the target machine's Flash file system via FTP, including: The target device initializes the network protocol stack through the CPU network port, configures the FTP server, mounts the Flash file system in the root directory, logs into the FTP server on the host computer, and transfers the image file to the target device's Flash file system over the network.
[0011] Optionally, after the target machine boots up, the operating system program creates a memory file system, including: The target machine is equipped with a Ramdisk storage device, which uses a fixed amount of memory as a file system. When the operating system of the device starts, the kernel image and the file system are loaded into memory together to complete the initialization of the memory file system.
[0012] Optionally, the decompression and uncompression of the .tar.gz compressed package can be performed in the memory file system, including: The application image file is decompressed using the gzip algorithm. The source file path for decompression is specified as the Flash file system, and the target file path for decompression is specified as the memory file system. Finally, the .tar packaged files of each component or service are output to the memory file system. In the memory file system, the application image file is unpacked using the tar packaging method to accurately restore the application image of each service or component.
[0013] Optionally, the application may be booted from a memory file system, including: Call the operating system's interface or method to load the application, configure the loading path to the memory file system, including the storage paths for executable files, configuration files, and dynamic libraries, and complete the application startup.
[0014] A second aspect of the present invention provides an application packaging and compression loading apparatus based on a Flash file system, for executing the application packaging and compression loading method based on a Flash file system as described in any one of the first aspects.
[0015] A third aspect of the present invention provides a computer-readable storage medium, comprising: a memory and a processor; The memory is configured to store executable instructions; The processor is configured to implement the application packaging and compression loading method based on the Flash file system as described in any one of the first aspects when executing the executable instructions stored in the memory.
[0016] A fourth aspect of the present invention provides a computer program product, the computer program product including instructions, which, when executed by a computer, implement the application packaging, compression and loading method based on the Flash file system as described in any one of the first aspects.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a method and apparatus for packaging, compressing, and loading applications based on a Flash file system. The method comprises six parts: application packaging, application compression, application burning via an FTP server, application decompression, application unpacking, and application loading. The application is packaged using tar and compressed using gzip, generating a single .tar.gz compressed file from all target files. This compressed file is then transferred to the target machine's Flash file system via FTP. After the target machine boots, the operating system creates a memory file system, where the .tar.gz compressed file is decompressed and unpacked. Finally, the application is loaded from the memory file system. In this invention, the application is decompressed and unpacked, and the file storage path is transferred from the Flash file system to the memory file system. The program loading process is changed from copying from the Flash file system to memory to efficient copying between memory, avoiding the problem of poor random read performance of the Flash file system caused by scattered target files. This significantly shortens the application loading time and effectively eliminates the risk of insufficient device startup time. The application target files are packaged to generate a unique application image file, avoiding the impact of frequent "erase-write" of small files on the writing speed, improving the efficiency of application burning, and exponentially reducing the application burning time. The application target files are compressed, effectively reducing the size of the application. The actual compression rate can reach more than 70%, saving storage space and shortening the application burning time. Attached Figure Description
[0018] Figure 1 This is a flowchart of the application packaging, compression, and burning process of this invention; Figure 2 This is a flowchart of the application decompression, unpacking, and loading process of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be described in more detail below with reference to the accompanying drawings.
[0020] In the accompanying drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, of the embodiments of the present invention.
[0021] The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0022] The following is in conjunction with the appendix Figure 1-2 The embodiments of the present invention will be described in detail below.
[0023] This invention provides a method for packaging, compressing, and loading applications based on a Flash file system. The method comprises six parts: application packaging, application compression, application burning via an FTP server, application decompression, application unpacking, and application loading. The application is packaged using tar and compressed using gzip, generating a single .tar.gz compressed file from all target files. This file is then transferred to the target machine's Flash file system via FTP. After the target machine boots, the operating system creates a memory file system, where the .tar.gz compressed file is decompressed and unpacked. Finally, the application is loaded from the memory file system.
[0024] The technical solution includes the following steps: 1. Application Packaging The application target file is packaged using the tar packaging principle. The application target file contains multiple configuration files, data files, dynamic library files, executable files and corresponding file directories. The tar tool is used to merge multiple files and directories into a single archive file, which contains the metadata information of the files and directories, the actual content of the files and the structural information of the directories. The file format is .tar. 2. Application Compression The application target files are compressed using the gzip compression algorithm. Tar itself does not have compression capabilities, but when used in conjunction with the gzip compression algorithm, the files are compressed and packaged. gzip is a widely used lossless data compression algorithm. The archive file generated by tar is compressed, and finally all the application target files are generated into a .tar.gz image file, which effectively reduces the size of the application. The actual file compression rate can reach more than 70%. 3. The application is burned using an FTP server. The application image file is burned using FTP transfer. The target device initializes the network protocol stack through the CPU network port, configures the FTP server, mounts the Flash file system in the root directory, logs into the FTP server on the host computer, and transfers the image file to the target device's Flash file system through the network. 4. Unzip the application. The target machine is configured with a Ramdisk storage device, using a fixed amount of memory as a file system. During operating system startup, the kernel image and file system are loaded into memory together, initializing the memory file system. The application image file is decompressed using the gzip algorithm, with the source file path specified as the Flash file system and the target file path specified as the memory file system. Finally, the .tar archive files of each component or service are output to the memory file system. 5. Application unpacking In the memory file system, the application image file is unpacked using the tar packaging method to accurately restore the application image of each service or component; 6. Application loading The system calls the operating system's interface or method to load the application, configuring the loading path to the memory file system, including the storage paths for executable files, configuration files, dynamic libraries, etc., to complete the application startup. The application image file is replaced by a highly efficient inter-memory copy operation, replacing the copying from the Flash file system to memory, significantly reducing application loading time.
[0025] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for packaging, compressing, and loading applications based on a Flash file system, characterized in that, Including the following steps: The application is packaged using tar and gzip compression, and all target files are generated into a .tar.gz compressed package, which is then transferred to the target machine's Flash file system via FTP. After the target machine boots up, the operating system program creates a memory file system, completes the decompression and unpacking of the .tar.gz compressed package in the memory file system, and finally boots the application from the memory file system.
2. The application packaging, compression, and loading method based on the Flash file system according to claim 1, characterized in that, The application target file contains multiple configuration files, data files, dynamic library files, executable files, and corresponding file directories; Package the application into a tar archive, including: Use tar to combine multiple files and directories into a single archive file; Archived files contain metadata information for files and directories, the actual content of the files, and the structural information of the directories.
3. The application packaging, compression, and loading method based on the Flash file system according to claim 1, characterized in that, Transferred to the target machine's Flash file system via FTP, including: The target device initializes the network protocol stack through the CPU network port, configures the FTP server, mounts the Flash file system in the root directory, logs into the FTP server on the host computer, and transfers the image file to the target device's Flash file system over the network.
4. The application packaging, compression, and loading method based on the Flash file system according to claim 1, characterized in that, After the target machine boots up, the operating system program creates a memory file system, including: The target machine is equipped with a Ramdisk storage device, which uses a fixed amount of memory as a file system. When the operating system of the device starts, the kernel image and the file system are loaded into memory together to complete the initialization of the memory file system.
5. The application packaging, compression, and loading method based on a Flash file system according to claim 1, characterized in that, Perform the decompression and uncompression of .tar.gz compressed packages in the memory file system, including: The application image file is decompressed using the gzip algorithm. The source file path for decompression is specified as the Flash file system, and the target file path for decompression is specified as the memory file system. Finally, the .tar packaged files of each component or service are output to the memory file system. In the memory file system, the application image file is unpacked using the tar packaging method to accurately restore the application image of each service or component.
6. The application packaging, compression, and loading method based on a Flash file system according to claim 1, characterized in that, Booting the application from the memory file system includes: Call the operating system's interface or method to load the application, configure the loading path to the memory file system, including the storage paths for executable files, configuration files, and dynamic libraries, and complete the application startup.
7. An application packaging, compression, and loading device based on a Flash file system, characterized in that, This method is used to perform the application packaging and compression loading method based on the Flash file system as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, include: Memory and processor; The memory is configured to store executable instructions; The processor is configured to implement the application packaging and compression loading method based on the Flash file system as described in any one of claims 1-6 when executing the executable instructions stored in the memory.
9. A computer program product, characterized in that, The computer program product includes instructions that, when executed by a computer, implement the application packaging, compression, and loading method based on the Flash file system as described in any one of claims 1-6.