CN113641382A - Partitionable system updating method and storage medium - Google Patents

Partitionable system updating method and storage medium Download PDF

Info

Publication number
CN113641382A
CN113641382A CN202110852584.5A CN202110852584A CN113641382A CN 113641382 A CN113641382 A CN 113641382A CN 202110852584 A CN202110852584 A CN 202110852584A CN 113641382 A CN113641382 A CN 113641382A
Authority
CN
China
Prior art keywords
unit
partition
partitionable
upgrade
ith
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
Application number
CN202110852584.5A
Other languages
Chinese (zh)
Inventor
余智超
许自缘
林刘迪铭
陈委问
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rockchip Electronics Co Ltd
Original Assignee
Rockchip Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Rockchip Electronics Co Ltd filed Critical Rockchip Electronics Co Ltd
Priority to CN202110852584.5A priority Critical patent/CN113641382A/en
Publication of CN113641382A publication Critical patent/CN113641382A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing

Abstract

A method for updating a partitionable system and a storage medium thereof, wherein the method comprises the following steps that when the system needs to be upgraded, a storage block with the size larger than the upgrade file of the largest partitionable functional unit in all the partitionable functional units in the system is divided in a storage space to be used as an upgrade auxiliary partition; sorting all n partition units according to size, downloading the upgrade files corresponding to the first partition unit to an upgrade auxiliary partition, deleting the files in the first partition unit, downloading the upgrade files corresponding to the ith partition unit to the (i-1) th partition unit, deleting the files in the ith partition unit, and taking i as 2 to n. According to the technical scheme, when only one partition-sized storage space is left in the system, normal operation of the upgrade space can be completed, so that backup upgrade of system firmware upgrade on small storage equipment is promoted, and the problem that in the prior art, backup upgrade needs at least the same storage space as the existing firmware is solved.

Description

Partitionable system updating method and storage medium
Technical Field
The present invention relates to the field of system firmware update, and in particular, to an optimized update method and storage medium for a novel partitionable system.
Background
Regarding the upgrading concept of firmware, although the patent of CN102693145A in the prior art is directed to differential upgrading, there are also concepts of block upgrading and upgrading backup space. The prior art is to backup all the old version software data before the offset address which is depended by the new version software data after the offset address a. For the firmware of N partitions, the size of N × 2 is still needed to update, and a technical scheme for updating files that can save more space in a partition-able system needs to be provided.
Disclosure of Invention
Therefore, it is desirable to provide a file update solution that can be partitioned into a system more space-saving.
In order to achieve the above object, the inventor provides a method for updating a partitionable system, which includes the following steps that when a system needs to be updated, a storage block with a size larger than an update file of the largest partitionable functional unit in all the partitionable functional units in the system is partitioned from a storage space to serve as an update auxiliary partition;
correspondingly partitioning the memory addresses of all n separable functional units to obtain n partition units,
sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
Specifically, the method further comprises the steps of downloading the upgrade file corresponding to the ith partition unit to the ith-1 partition unit, deleting the file in the ith partition unit, and marking the starting path of the ith separable functional unit as the ith-1 separable unit.
Specifically, the separable functional units comprise a kernel unit, a rootfs unit, an OEM unit, and an APP unit.
Optionally, the upgrade file corresponding to the ith partition unit is downloaded to the (i-1) th partition unit, and the file in the ith partition unit is deleted only after the upgrade file in the (i-1) th partition unit is verified.
Specifically, the method further comprises the step of pre-reading the size of the upgrade file of the largest separable functional unit in all the upgrade files.
A partitionable system updates the storage medium, store the computer program, the said computer program is carried out when being run and includes the following step, when the system needs to upgrade, divide out the memory block greater than the size of the staging file of the largest partitionable functional unit in all partitionable functional units in the system in the memory space, as the auxiliary partition of staging;
correspondingly partitioning the memory addresses of all n separable functional units to obtain n partition units,
sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
Specifically, the computer program further executes the steps of downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and marking the starting path of the ith partitionable function unit as the (i-1) th partitionable unit when the computer program is executed.
Specifically, the separable functional units comprise a kernel unit, a rootfs unit, an OEM unit, and an APP unit.
Further, the computer program further executes the steps of downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, and deleting the file in the ith partition unit after checking the upgrade file in the (i-1) th partition unit.
Specifically, the computer program further performs a step of, when executed, pre-reading the size of the upgrade file of the largest dividable functional unit among all the upgrade files.
By the technical scheme, normal upgrading space operation can be completed when only one partition-sized storage space is left in the system, so that backup upgrading of system firmware upgrading on small storage equipment is promoted, and the problem that in the prior art, backup upgrading at least needs the same storage space as the existing firmware is solved.
Drawings
FIG. 1 is a flow chart of a method for updating a partitionable system according to an embodiment of the present invention;
fig. 2 is a diagram illustrating an upgrade process and a partition change condition of a system according to an embodiment of the present invention.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1, a method for updating a partitionable system includes the following steps, when the system needs to be upgraded, S2, dividing a storage space into a storage block with a size larger than an upgrade file of a largest partitionable functional unit among all partitionable functional units in the system, taking the storage block as an upgrade auxiliary partition, and correspondingly partitioning storage addresses of all n partitionable functional units to obtain n partition units. In the system, the separable functional units may be functional units with a near root directory, such as kernel units, rootfs units, OEM units, APP units, etc., that can be verified for full functionality. In other embodiments, the separable functional units may also be functional units with different loading stages in the starting process of the system, for example, rootfs is a user mode program and a file system, kernel is a kernel, and the loaded time nodes are different and are divided into different partitions. In other classifications, the functional unit may also be a functional unit with a different mirror file system, for example, a kernel does not have a so-called file system and a rootfs has a file system.
S3, sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and S4, downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
Through the scheme, the cyclic backup can be carried out only by the storage space in the system having the storage block with the size larger than the upgrade file of the largest separable functional unit in all separable functional units in the system, the upgrade file corresponding to the ith partition unit is downloaded to the (i-1) th partition unit, the file in the ith partition unit is deleted, and the iteration is continued, so that the upgrade files of the separable functional units in all the partition units are all updated finally. The requirement of firmware upgrading in the electronic device with small storage space is met.
In a further embodiment, the method further comprises the steps of downloading the upgrade file corresponding to the ith partition unit to the ith-1 th partition unit, deleting the file in the ith partition unit, and marking the starting path of the ith partitionable function unit as the ith-1 st partitionable unit. Through the steps, the new functional unit can be started through a new path, the problem that the functional unit is not correct when the system runs is avoided, and possible errors of the system are reduced.
In other embodiments, the upgrade file corresponding to the ith partition unit is downloaded to the (i-1) th partition unit, and the file in the ith partition unit is deleted only after the upgrade file in the (i-1) th partition unit is verified. According to the scheme, after the newly downloaded upgrade file is verified, if the integrity of the upgrade file can be verified, the upgrade file can be normally compatible, the file in the original storage position is deleted, the problem that the system runs the new upgrade file incorrectly is avoided, and possible errors of the system are reduced.
In the embodiment shown in fig. 1, step S1 is further included to pre-read the size of the upgrade file of the largest separable functional unit among all the upgrade files. The step can read all the upgrading files in advance and find out the size of the upgrading file of the largest divisible functional unit, so that the size of the upgrading auxiliary partition needing to be divided can be directly determined in advance, the possibility of insufficient size of the upgrading auxiliary partition is reduced, and the feasibility and the fault tolerance rate of the scheme are improved.
In other embodiments, the upgrade auxiliary partition may be further divided by dividing all the storage space into +1 equal-sized storage blocks according to the number of the separable functional units, where the separable functional units are respectively stored and operated in different partitions, and an extra block serves as the upgrade auxiliary partition. This also does not create the problem of the upgrade file being larger than the upgrade auxiliary partition size. Further, in the embodiment shown in fig. 2, we take the separable functional units including a kernel partition, a rootfs partition, and an OEM partition as an example, and perform a flow description:
firstly, dividing a system storage space (assumed to be 16M) into 4 spaces with the same size, wherein each storage space is 4M, three partitions store kernel A, rootfs A and OEMA of a running system, and a blank partition is reserved and is an upgrade auxiliary partition (F partition).
The upgrade flow of the system can be seen from the left part of fig. 2, and the partition change situation in each step can be seen from the right part of fig. 2. Specifically, in the first step, the kernel is upgraded, the upgrade file kernel B is downloaded to the upgrade auxiliary partition F partition, after the kernel B to be verified can be upgraded successfully, the next time the kernel B is started from the F partition is marked, and meanwhile, the kernel A in the K partition is emptied. The second step is that: and downloading the rootfs B to the K partition, marking the starting rootfs B from the K partition after the rootfs B can be successfully upgraded and emptying the rootfs A in the R partition. The third step: and downloading the OEM B to the R partition, marking the next time of starting the OEM from the R partition after the OEM B to be verified can be successfully upgraded, and simultaneously emptying the OEMA in the O partition. And finishing upgrading.
The benefit of the above scheme is. Assuming that the number of partitions of a certain product system is N and the number of partitions required for normal AB upgrade is 2 × N, the number of partitions required is N +1 by the method described in this patent. Aiming at the aforementioned products with 3 partitions, the A/B upgrade is realized by 6 partitions in the normal way, and the A/B upgrade can be completed by only 4 partitions with the same size. The storage space of the product is saved, and the method can be stated as follows: the A/B upgrading is realized on a small-capacity storage space. Secondly, when the version is updated next time, such as the version C, the current O partition is empty and can be used for downloading the target version of one partition, such as kernel C, and the updating of the version C can be completed by repeating the steps, so that the subsequent iteration version is convenient.
A partitionable system updates the storage medium, store the computer program, the said computer program is carried out when being run and includes the following step, when the system needs to upgrade, divide out the memory block greater than the size of the staging file of the largest partitionable functional unit in all partitionable functional units in the system in the memory space, as the auxiliary partition of staging;
correspondingly partitioning the memory addresses of all n separable functional units to obtain n partition units,
sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
Specifically, the computer program further executes the steps of downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and marking the starting path of the ith partitionable function unit as the (i-1) th partitionable unit when the computer program is executed.
Specifically, the separable functional units comprise a kernel unit, a rootfs unit, an OEM unit, and an APP unit.
Further, the computer program further executes the steps of downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, and deleting the file in the ith partition unit after checking the upgrade file in the (i-1) th partition unit.
Specifically, the computer program further performs a step of, when executed, pre-reading the size of the upgrade file of the largest dividable functional unit among all the upgrade files. It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (10)

1. A method for updating a partitionable system is characterized by comprising the following steps of dividing a storage space into storage blocks with the size larger than an upgrade file of the largest partitionable functional unit in all the partitionable functional units in the system as an upgrade auxiliary partition when the system needs to be upgraded;
correspondingly partitioning the memory addresses of all n separable functional units to obtain n partition units,
sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
2. The method for updating the partitionable system of claim 1, further comprising the steps of downloading an upgrade file corresponding to an ith partition unit to the ith-1 partition unit, deleting the file in the ith partition unit, and marking a start path of the ith partitionable function unit as the ith-1 partitionable unit.
3. The partitionable system update method of claim 1, wherein the partitionable functional units comprise a kernel unit, a rootfs unit, an OEM unit, an APP unit.
4. The method for updating a partitionable system of claim 1, wherein the upgrade file corresponding to the ith partition unit is downloaded to the (i-1) th partition unit, and the file in the (i) th partition unit is deleted only after the upgrade file in the (i-1) th partition unit is checked.
5. The partitionable system updating method of claim 1 further comprising the step of pre-reading the size of the upgrade file for the largest partitionable functional unit of all upgrade files.
6. A partitionable system update storage medium is characterized in that a computer program is stored, and when the computer program is executed, the computer program comprises the following steps of dividing a storage space into a storage block with the size larger than an update file of the largest partitionable functional unit in all partitionable functional units in a system as an update auxiliary partition when the system needs to be updated;
correspondingly partitioning the memory addresses of all n separable functional units to obtain n partition units,
sorting all the n partition units according to size, downloading the upgrade files corresponding to the first partition unit to the upgrade auxiliary partition, deleting the files in the first partition unit,
and downloading the upgrade file corresponding to the ith partition unit to the (i-1) th partition unit, deleting the file in the ith partition unit, and taking i from 2 to n.
7. The partitionable system update storage medium of claim 6, wherein the computer program, when executed, further performs steps including downloading an upgrade file corresponding to an ith partition unit to an ith-1 th partition unit, and marking a start path of the ith partitionable function unit as the ith-1 partitionable unit after deleting files in the ith partition unit.
8. The partitionable system update storage medium of claim 6, wherein the partitionable functional units comprise a kernel unit, a rootfs unit, an OEM unit, an APP unit.
9. The partitionable system update storage medium of claim 6, wherein the computer program, when executed, further performs the steps of downloading an upgrade file corresponding to an ith partition unit to an (i-1) th partition unit, and checking the upgrade file in the (i-1) th partition unit to delete the file in the ith partition unit.
10. The partitionable system update storage medium of claim 6, wherein the computer program when executed further performs a step of pre-reading a size of an upgrade file of a largest partitionable functional unit of all upgrade files.
CN202110852584.5A 2021-07-27 2021-07-27 Partitionable system updating method and storage medium Pending CN113641382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110852584.5A CN113641382A (en) 2021-07-27 2021-07-27 Partitionable system updating method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110852584.5A CN113641382A (en) 2021-07-27 2021-07-27 Partitionable system updating method and storage medium

Publications (1)

Publication Number Publication Date
CN113641382A true CN113641382A (en) 2021-11-12

Family

ID=78418538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110852584.5A Pending CN113641382A (en) 2021-07-27 2021-07-27 Partitionable system updating method and storage medium

Country Status (1)

Country Link
CN (1) CN113641382A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040008007A (en) * 2002-07-15 2004-01-28 에임텍 주식회사 Method of upgrading firmware for wireless terminal
US20110093516A1 (en) * 2006-08-23 2011-04-21 Zte Corporation implementation method for updating the terminals in batches
CN106802813A (en) * 2016-12-06 2017-06-06 智车优行科技(北京)有限公司 Method, device and vehicle for aerial firmware upgrade
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
US20180275908A1 (en) * 2017-03-27 2018-09-27 Arris Enterprises Llc Method for providing software stack migration
CN109905256A (en) * 2017-12-07 2019-06-18 阿里巴巴集团控股有限公司 A kind of firmware update and device
CN110311960A (en) * 2019-06-19 2019-10-08 浙江吉利控股集团有限公司 A kind of method for upgrading software, device, equipment and storage medium
CN111045712A (en) * 2019-12-17 2020-04-21 杭州涂鸦信息技术有限公司 Single system upgrading method and system with backup function

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040008007A (en) * 2002-07-15 2004-01-28 에임텍 주식회사 Method of upgrading firmware for wireless terminal
US20110093516A1 (en) * 2006-08-23 2011-04-21 Zte Corporation implementation method for updating the terminals in batches
CN106802813A (en) * 2016-12-06 2017-06-06 智车优行科技(北京)有限公司 Method, device and vehicle for aerial firmware upgrade
US20180275908A1 (en) * 2017-03-27 2018-09-27 Arris Enterprises Llc Method for providing software stack migration
CN107315616A (en) * 2017-06-30 2017-11-03 郑州云海信息技术有限公司 A kind of loading method of firmware, device and electronic equipment
CN109905256A (en) * 2017-12-07 2019-06-18 阿里巴巴集团控股有限公司 A kind of firmware update and device
CN110311960A (en) * 2019-06-19 2019-10-08 浙江吉利控股集团有限公司 A kind of method for upgrading software, device, equipment and storage medium
CN111045712A (en) * 2019-12-17 2020-04-21 杭州涂鸦信息技术有限公司 Single system upgrading method and system with backup function

Similar Documents

Publication Publication Date Title
CN1304946C (en) Booting and boot code update method and system thereof
US9792105B2 (en) Method and system for booting and automatically updating software, and recovering from update error, and computer readable recording medium storing method
US7036007B2 (en) Firmware architecture supporting safe updates and multiple processor types
CN110134426A (en) A kind of embedded system upgrade method, device and terminal device
EP1241571A2 (en) Methods and apparatus for upgrading firmware in an embedded system
CN104918114B (en) A kind of operating system update method and device
CN107247603A (en) Support the remote upgrade method and system of firmware auto restore facility
CN106155915B (en) Data storage processing method and device
CN110032339B (en) Data migration method, device, system, equipment and storage medium
CN110096300B (en) FPGA program file backup management system, operation method and upgrading method
CN108170455B (en) Upgrade package packaging method and upgrade method
CN109086078B (en) Android system upgrading method and device, server and mobile terminal
CN111796856A (en) Differential upgrading method and device, storage medium and computer equipment
CN110874239A (en) Air firmware differential upgrading method and device for electronic equipment
CN114443081A (en) Terminal upgrading method and terminal
US7904896B2 (en) Program rewriting system, boot loader, storage medium, and electronic control unit
CN112860291B (en) Firmware upgrading method and device
CN113641382A (en) Partitionable system updating method and storage medium
US7490321B2 (en) Method for updating firmware via determining program code
CN113094077A (en) System differential upgrading method and device, intelligent terminal and storage medium
CN113791812A (en) Firmware upgrading method and storage equipment
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
CN107967160B (en) Method and device for updating operating system file through Boot Loader
KR102375290B1 (en) Firmware Update Device and Update Method
CN105278993A (en) Linux system based drive module upgrading method and apparatus

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