A fota upgrade method for reducing the number of backup partitions
Patent Information
- Application Number
- CN202111295050.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-03
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-03
AI Technical Summary
[0003]这种有备份分区的分区方案会造成一定的空间浪费,特别是在flash空间比较小的情况下会使flash的使用变得非常的紧张
[0022]本发明的有益效果是:通过在升级过程中将modem文件内容放入system备份分区,下载完成后,在不重启情况下直接覆盖modem主分区,不需要额外的modem备份分区来当作下载缓存器,给mifi设备留出大量空间;节省下来的空间可分配给system主分区和system备份分区,使得可在system主分区和system备份分区中放入更多的应用程序,解决了产品空间紧张问题,并增加了产品功能扩展的空间。
Smart Images

Figure CN114153483B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of firmware upgrade, and in particular to a fota upgrade method for reducing the number of backup partitions. Background Art
[0002] The existing upgrade method requires storing an image file in the primary partition and the backup partition. The current flash layout requires storing three image files in six partitions. Flash is a storage device that stores Linux operating system image files (aboot), modem image files (modem), and root file system (system) image files. Its storage space is divided into six partitions: aboot primary partition, aboot backup partition, modem primary partition, modem backup partition, system primary partition, and system backup partition. Among them, aboot primary partition and aboot backup partition store aboot images, modem primary partition and modem backup partition store modem images, and system primary partition and system backup partition store system images.
[0003] This partitioning scheme with backup partitions will cause a certain amount of space waste, especially when the flash space is relatively small, which will make the use of flash very tight. In some projects that reduce the flash capacity, there is barely enough space after optimizing the space occupation and code; the current space is not abundant and new functions cannot be added, resulting in a decline in product competitiveness. Therefore, under the current situation, it is urgent to optimize the existing upgrade plan to provide reserved space for future new product functions.
[0004] Among the three image files, the modem file is relatively large, and its file size accounts for about 20% of the entire flash. Removing the modem backup partition will leave a lot of space for the MiFi device. The saved space can be allocated to the system primary partition and the system backup partition respectively. More applications can be placed in these two partitions to solve the problem of product space shortage and lay the foundation for expanding product functions in the future. Summary of the invention
[0005] In order to overcome the deficiencies of the prior art, the present invention provides a fota upgrade method for reducing the number of backup partitions to solve the above technical problems.
[0006] The technical method adopted by the present invention to solve its technical problem is: a FOTA upgrade method for reducing the number of backup partitions, and the improvement thereof is: comprising the following steps: S1, making an upgrade file package, storing the modem file content behind the package header, and placing the upgrade file package on the FOTA server to form a FOTA package, wherein the modem file is a modem mirror file; S2, a MiFi device downloads and processes the package header, and obtains the FOTA package from the Fota server; S3, downloading the modem file content in the Fota package to the system backup partition; S4, the MiFi device verifies whether the modem file content in the system backup partition is complete , when it is complete, the modem file content in the system backup partition is copied to the modem main partition, and jump to step S5; when it is incomplete, the MiFi device closes the connection with the Fota server and exits the upgrade; S5, downloads the aboot file content and the system file content in the Fota package, and restarts the MiFi device; S6, during the restart of the MiFi device, the LK boot program copies the aboot file content in the aboot backup partition to the aboot main partition, and copies the system file content in the system backup partition to the system main partition. The upgrade is completed, and LK is the boot program for starting the device.
[0007] In the above method, step S1 comprises the following steps:
[0008] S11, storing the modem file content, the aboot file content and the system file content into an upgrade file package, wherein the package format of the upgrade file package is: package header + modem file content + aboot file content + system file content;
[0009] S12, storing the modem file content after the packet header;
[0010] S13, putting the upgrade file package on the fota server to form a fota package, fota stands for Firmware Over the Air, i.e. firmware upgrade over the air.
[0011] In the above method, step S2 comprises the following steps:
[0012] S21, the mifi device downloads the packet header to the local device, the mifi device is a portable broadband wireless device;
[0013] S22, the upgrade application in the MiFi device identifies the information in the packet header and determines whether the modem file content is stored behind the packet header. When the modem file content is stored behind the packet header, it is downloaded normally. The upgrade application obtains the content of the fota package from the fota server and jumps to step S3; when the modem file content is not stored behind the packet header, the upgrade is exited.
[0014] In the above method, in step S22, the upgrade application identifies the information in the packet header and determines whether the modem file content is stored after the packet header, including the following steps:
[0015] S221, the upgrade application reads the structure array in the packet header;
[0016] S222, identifying the length of the structure array, that is, the number of files included in the fota package;
[0017] S223, according to the length of the structure array, traverse all structure elements of the entire structure array, determine whether the name field in the structure element has a modem string, and find the structure element with a modem string in the name field;
[0018] S224. Determine whether the structure element with the modem character string in the name field is at the first position in the structure array. If it is at the first position, the modem file content is stored after the packet header; if it is not at the first position, the modem file content is not stored after the packet header.
[0019] In the above method, step S5 comprises the following steps:
[0020] S51, download the aboot file content in the fota package to the aboot backup partition, and download the system file content in the fota package to the system backup partition;
[0021] S52, the MiFi device verifies whether the contents of the aboot file in the aboot backup partition and the contents of the system file in the system backup partition are complete. If they are complete, the MiFi device automatically restarts; if they are incomplete, the upgrade is exited.
[0022] The beneficial effects of the present invention are as follows: by placing the modem file content into the system backup partition during the upgrade process, after the download is completed, the modem main partition is directly overwritten without restarting, and no additional modem backup partition is required to serve as a download buffer, leaving a large amount of space for the MiFi device; the saved space can be allocated to the system main partition and the system backup partition, so that more application programs can be placed in the system main partition and the system backup partition, solving the problem of product space shortage and increasing the space for product function expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Attached Figure 1 The present invention is a flowchart of a fota upgrade method for reducing the number of backup partitions. DETAILED DESCRIPTION
[0024] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0025] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.
[0026] Reference Figure 1 , a fota upgrade method for reducing the number of backup partitions of the present invention comprises the following steps:
[0027] S1, make an upgrade file package, store the modem file content behind the package header, and put the upgrade file package on the fota server to form a fota package, where the modem file is the modem image file;
[0028] Specifically, the following steps are included:
[0029] S11, storing the content of the modem file, the content of the aboot file, and the content of the system file into an upgrade file package, wherein the package format of the upgrade file package is: package header + content of the modem file + content of the aboot file + content of the system file, wherein the aboot file is a Linux operating system image file, and the system file is a root file system image file;
[0030] S12, storing the modem file content after the packet header, so that in the subsequent download process, the modem file content can be downloaded first;
[0031] S13, putting the upgrade file package on the fota server to form a fota package, fota stands for Firmware Over the Air, i.e. firmware upgrade over the air.
[0032] S2, the mifi device downloads and processes the packet header and obtains the fota packet from the fota server;
[0033] Specifically, the following steps are included:
[0034] S21, the mifi device downloads the packet header to the local device, the mifi device is a portable broadband wireless device;
[0035] S22, the upgrade application in the MiFi device identifies the information in the packet header and determines whether the modem file content is stored behind the packet header. When the modem file content is stored behind the packet header, it is downloaded normally, and the upgrade application obtains the content of the fota package from the fota server and jumps to step S3; when the modem file content is not stored behind the packet header, the upgrade is exited;
[0036] Specifically, the upgrade application identifies the information in the packet header and determines whether the modem file content is stored after the packet header, including the following steps:
[0037] S221, the upgrade application reads the structure array in the packet header;
[0038] S222, identifying the length of the structure array, that is, the number of files included in the fota package;
[0039] S223, according to the length of the structure array, traverse all the structure elements of the entire structure array, because the fota package contains the modem file content, it is possible to find the structure element with the modem string in the name field by judging whether the name field in the structure element has the modem string;
[0040] S224. Determine whether the structure element with the modem character string in the name field is at the first position in the structure array. If it is at the first position, the modem file content is stored after the packet header; if it is not at the first position, the modem file content is not stored after the packet header.
[0041] S3, download the modem file content in the fota package to the system backup partition, and no additional modem backup partition is needed as a download buffer;
[0042] S4, the MiFi device checks whether the content of the modem file in the system backup partition is complete. If it is complete, the content of the modem file in the system backup partition is copied to the modem main partition, and jumps to step S5; if it is incomplete, the MiFi device closes the connection with the Fota server and exits the upgrade;
[0043] S5. Download the aboot file content and system file content in the fota package, and restart the mifi device;
[0044] Specifically, the following steps are included:
[0045] S51, download the aboot file content in the fota package to the aboot backup partition, and download the system file content in the fota package to the system backup partition;
[0046] S52, the MiFi device verifies whether the contents of the aboot file in the aboot backup partition and the contents of the system file in the system backup partition are complete. If they are complete, the MiFi device automatically restarts; if they are incomplete, the upgrade is exited.
[0047] S6. During the restart of the mifi device, the LK boot program copies the aboot file content in the aboot backup partition to the aboot primary partition, and copies the system file content in the system backup partition to the system primary partition. At this point, all primary partitions, including the modem primary partition, aboot primary partition and system primary partition, are the latest executable files, the upgrade is completed, and LK is the boot program for the device to start up.
[0048] The present invention puts the modem file content into the system backup partition during the upgrade process, and directly overwrites the modem main partition without restarting after the download is completed. No additional modem backup partition is needed to serve as a download buffer, thus leaving a large amount of space for the MiFi device; the saved space can be allocated to the system main partition and the system backup partition, so that more application programs can be placed in the system main partition and the system backup partition, thereby solving the problem of product space shortage and increasing the space for product function expansion.
[0049] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A fota upgrade method to reduce the number of backup partitions, Features: The steps include: S1, make an upgrade file package, store the modem file content behind the package header, and put the upgrade file package on the fota server to form a fota package, where the modem file is the modem image file; S2, the mifi device downloads and processes the packet header and obtains the fota packet from the fota server; S3. Download the modem file content in the fota package to the system backup partition; S4, the MiFi device checks whether the content of the modem file in the system backup partition is complete. If it is complete, the content of the modem file in the system backup partition is copied to the modem main partition, and jumps to step S5; if it is incomplete, the MiFi device closes the connection with the Fota server and exits the upgrade; S5. Download the aboot file content and system file content in the fota package, and restart the mifi device; S6. During the restart of the mifi device, the LK boot program copies the aboot file content in the aboot backup partition to the aboot primary partition, and copies the system file content in the system backup partition to the system primary partition. The upgrade is completed, and LK is the boot program for the device to start up.
2. A fota upgrade method for reducing the number of backup partitions as claimed in claim 1, Features: The step S1 comprises the following steps: S11, storing the modem file content, the aboot file content and the system file content into an upgrade file package, wherein the package format of the upgrade file package is: package header + modem file content + aboot file content + system file content; S12, storing the modem file content after the packet header; S13, putting the upgrade file package on the fota server to form a fota package, fota means Firmware Over the Air, i.e. firmware upgrade over the air.
3. A fota upgrade method for reducing the number of backup partitions as claimed in claim 2, Features: The step S2 comprises the following steps: S21, the mifi device downloads the packet header to the local device, the mifi device is a portable broadband wireless device; S22, the upgrade application in the MiFi device identifies the information in the packet header and determines whether the modem file content is stored behind the packet header. When the modem file content is stored behind the packet header, it is downloaded normally. The upgrade application obtains the content of the fota package from the fota server and jumps to step S3; when the modem file content is not stored behind the packet header, the upgrade is exited.
4. A fota upgrade method for reducing the number of backup partitions as claimed in claim 3, Features: In step S22, the upgrade application identifies the information in the packet header and determines whether the modem file content is stored after the packet header, including the following steps: S221, the upgrade application reads the structure array in the packet header; S222, identifying the length of the structure array, that is, the number of files included in the fota package; S223, according to the length of the structure array, traverse all structure elements of the entire structure array, determine whether the name field in the structure element has a modem string, and find the structure element with a modem string in the name field; S224. Determine whether the structure element with the modem character string in the name field is at the first position in the structure array. If it is at the first position, the modem file content is stored after the packet header; if it is not at the first position, the modem file content is not stored after the packet header.
5. A fota upgrade method for reducing the number of backup partitions as claimed in claim 1, Features: The step S5 comprises the following steps: S51, download the aboot file content in the fota package to the aboot backup partition, and download the system file content in the fota package to the system backup partition; S52, the MiFi device verifies whether the contents of the aboot file in the aboot backup partition and the contents of the system file in the system backup partition are complete. If they are complete, the MiFi device automatically restarts; if they are incomplete, the upgrade is exited.
Citation Information
Patent Citations
Mirror image file update processing method and apparatus and terminal device
CN105446769A
Method and system for remote upgrade supporting firmware automatic recovery function
CN107247603A
Cited By
Methods and systems for deploying software update
US12645447B2
Methods and systems for deploying software update
US20240126533A1
