Search

CN-122019008-A - Application packing compression loading method and device based on Flash file system

CN122019008ACN 122019008 ACN122019008 ACN 122019008ACN-122019008-A

Abstract

The invention provides an application packing compression loading method and device based on a Flash file system, wherein the method comprises the steps of performing tar packing and gzip compression on an application program, generating a tar gz compression packet by all target files, and transmitting the tar compression packet to the Flash file system of a target machine through FTP; and after the device target machine is started, the operating system program creates a memory file system, and the decompression and unpacking of the tar.gz compression package are completed in the memory file system, and finally the application program is guided to be loaded from the memory file system. The size of the application program is effectively reduced by compressing the application target file, the copy of the application image file from the Flash file system to the memory is replaced by efficient inter-memory copy operation, and the loading time of the application program is greatly shortened.

Inventors

  • ZHANG TAO
  • HAN CHAO
  • FENG XINLONG
  • ZHU PEILI
  • LIU JINGHAO

Assignees

  • 太原航空仪表有限公司

Dates

Publication Date
20260512
Application Date
20251227

Claims (9)

  1. 1. The application packing compression loading method based on the Flash file system is characterized by comprising the following steps: Performing tar packaging and gzip compression on the application program, and generating a tar.gz compressed package by all target files, and transmitting the tar.gz compressed package to a Flash file system of the target machine through FTP; and after the device target machine is started, the operating system program creates a memory file system, and the decompression and unpacking of the tar.gz compression package are completed in the memory file system, and finally the application program is guided to be loaded from the memory file system.
  2. 2. The Flash file system based application packaging compression loading method according to claim 1, wherein the application target file comprises a plurality of configuration files, data files, dynamic library files, executable files and corresponding file directories; Performing tar packaging on the application program, including: Merging a plurality of files and directories into an archive file by using tar; The archive file contains metadata information of the file and the directory, and actual contents of the file and structural information of the directory.
  3. 3. The Flash file system-based application packaging compression loading method according to claim 1, wherein the method is transmitted to the Flash file system of the target machine through FTP and comprises the following steps: the device target machine initializes a network protocol stack through a CPU network port, configures an FTP server, mounts a Flash file system in a root directory, logs in the FTP server at an upper computer, and transmits an image file to the Flash file system of the target machine through a network.
  4. 4. The Flash file system based application packaging compression loading method according to claim 1, wherein the operating system program creates the memory file system after the device target is started, comprising: The device target machine configures Ramdisk storage device, uses a part of memory with fixed size as a file system, loads the kernel image and the file system into the memory together when the device operating system is started, and completes initialization of the memory file system.
  5. 5. The Flash file system-based application packaging compression loading method according to claim 1, wherein the decompression and unpacking of the tar gz compression package is completed in the memory file system, and the method comprises the following steps: Decompressing the application image file by using a gzip algorithm, designating a decompressed source file path as a Flash file system, designating a decompressed target file path as a memory file system, and finally outputting the star package file of each component or service to the memory file system; in the memory file system, unpacking the application image file by adopting a tar packing method, and accurately restoring the application image of each service or component.
  6. 6. The Flash file system based application packaging compression loading method of claim 1, wherein the booting the application load from the memory file system comprises: And calling an interface or a method for loading the application program by the operating system, configuring a loading path as a memory file system, and completing the starting of the application program, wherein the memory file system comprises an executable file, a configuration file and a storage path of a dynamic library.
  7. 7. An application packaging compression loading device based on a Flash file system, which is used for executing the application packaging compression loading method based on the Flash file system according to any one of claims 1-6.
  8. 8. A computer readable storage medium comprising a memory and a processor; the memory is configured to hold executable instructions; The processor configured to implement the Flash file system based application package compression loading method of any one of claims 1-6 when executing the executable instructions stored in the memory.
  9. 9. A computer program product comprising instructions which, when executed by a computer, implement the Flash file system based application package compression loading method of any of claims 1-6.

Description

Application packing compression loading method and device based on Flash file system Technical Field The invention belongs to the technical field of loading of embedded application programs of avionics systems, and particularly relates to an application packing compression loading method and device based on a Flash file system. Background With the complexity of the application requirements of modern aviation aircrafts, the avionics system is promoted to be changed into services and components, software image files of on-board equipment are not single executable files (bin or elf files) any more, and application target programs simultaneously comprise a large number of configuration files (such as. Ini files), data files (such as. Json files), dynamic library files (such as. So files) and the like, so that the requirements on the on-board equipment file system are higher and higher. The Flash memory is widely used in the field of airborne avionics systems, and particularly aims at meeting the requirements of severe cost, power consumption, volume, weight, starting time and other economic and technical indexes and meeting the increasing technical requirements for certain small-sized airborne equipment, and provides a great challenge for the use of a Flash file system. The sequential reading performance of the Flash file system is good, but when random reading requests are processed, the file system needs to address different storage positions frequently, and internal management mechanisms (such as wear balance and garbage collection) of the Flash memory chip are added, so that the reading performance fluctuates. Especially, as the storage device is used, the fragmentation degree of the file increases, and the random reading performance is reduced more obviously. When the onboard equipment adopts a Flash file system to store a large number of application target files, because the target files are scattered in different storage positions, the executable files randomly read configuration files, data files and dynamic library files from the Flash file system in the starting process, so that the loading of the whole application program needs a large amount of time, and the starting time requirement of the equipment is not met. And the Flash memory is erased in units of blocks and written after being erased, even if only small files are written, the whole blocks are required to be erased first and then new data are written, and the process greatly increases the time cost of writing operation. Under the service and assembly development environments, the number of application target files is large, the file sizes are different, the problem of poor random writing performance of a Flash file system is highlighted, the programming time of equipment application programs is too long, and the overall performance of the system is restricted. Meanwhile, the storage capacity of Flash is limited, the storage capacity of a general Flash storage chip is 32MB or 64MB, and when executable files and a large number of dynamic library files are stored, partial airborne equipment often encounters the condition that the storage space capacity is insufficient or the residual quantity is not up to standard due to too much target program. Disclosure of Invention The invention provides an application packing compression loading method and device based on a Flash file system, which can solve the problem that the starting time of airborne equipment is not satisfied, can effectively shorten the programming time of an application program, and can solve the problem that the storage space capacity of the airborne equipment is not enough or the allowance is not up to standard. The invention provides an application packing compression loading method based on a Flash file system, which comprises the following steps: Performing tar packaging and gzip compression on the application program, and generating a tar.gz compressed package by all target files, and transmitting the tar.gz compressed package to a Flash file system of the target machine through FTP; and after the device target machine is started, the operating system program creates a memory file system, and the decompression and unpacking of the tar.gz compression package are completed in the memory file system, and finally the application program is guided to be loaded from the memory file system. Optionally, the application target file includes a plurality of configuration files, data files, dynamic library files, executable files and corresponding file directories; Performing tar packaging on the application program, including: Merging a plurality of files and directories into an archive file by using tar; The archive file contains metadata information of the file and the directory, and actual contents of the file and structural information of the directory. Optionally, the method transmits to the Flash file system of the target machine through FTP, and comprises the following steps: the d