CN109101279A - A kind of compatible starting method of multi version system - Google Patents

A kind of compatible starting method of multi version system Download PDF

Info

Publication number
CN109101279A
CN109101279A CN201810671468.1A CN201810671468A CN109101279A CN 109101279 A CN109101279 A CN 109101279A CN 201810671468 A CN201810671468 A CN 201810671468A CN 109101279 A CN109101279 A CN 109101279A
Authority
CN
China
Prior art keywords
data
version
subregion
verification
data subregion
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.)
Granted
Application number
CN201810671468.1A
Other languages
Chinese (zh)
Other versions
CN109101279B (en
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.)
Allwinner Technology Co Ltd
Original Assignee
Allwinner Technology 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 Allwinner Technology Co Ltd filed Critical Allwinner Technology Co Ltd
Priority to CN201810671468.1A priority Critical patent/CN109101279B/en
Publication of CN109101279A publication Critical patent/CN109101279A/en
Application granted granted Critical
Publication of CN109101279B publication Critical patent/CN109101279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention includes a kind of compatible starting method of multi version system, which is characterized in that this method comprises: the system for burning generates corresponding version number, and generates corresponding backup for each system version;When system electrification, successively each data subregion is verified;S30 then detects the corresponding data subregion of all versions, if it exists holonomic system when verification is damaged to one or more data subregions, then destroys the corresponding data subregion of checked system;S40, restarting, and the detected holonomic system data subregion of the step S30 is selected successively to be verified, complete compatibility starting.The invention has the benefit that by being embedded in the data structure comprising version number information in partition data, so that the version number of each subregion of detection can be passed through on startup, the subregion of selection version adaptation is started, and avoids being used in mixed way new-old system, and then avoid compatibility issue.

Description

A kind of compatible starting method of multi version system
Technical field
The present invention relates to a kind of compatible starting methods of multi version system, belong to computer field.
Background technique
Many products for the considerations of supporting OTA perhaps anti-locking system deliberated or be not intended to the considerations of destroying or in order to Reach certain other purposes, need there are standby system, when existing system is destroyed or needs to upgrade, can be switched to In another set of system, prevent product from can not start.
Existing technical solution burning one or more standby system usually on flash when starting, can pass through certain Integrity verification scheme verifies the subregion that will start according to specified priority, if verification failure, it tries from another A subregion starting.
In certain operations, especially OTA operating process power down, flash data may be destroyed and to exist in flash more The system of a version starts if verifying when restarting according to particular order, may be used in mixed way new-old system, such as using old The kernel mirror image of the boot image starting new system of system, leads to compatibility issue.
According to the prior art problem proposed, spy's citing is illustrated, specific as follows:
By taking following system (table 1) as an example, system includes data backup, kernel, and starting can be verified in the BROM of IC by solidifying TOC0, TOC0 can verify starting TOC1, TOC1 verification starting KERNEL and ROOTFS, wherein IC is integrated circuit, and BROM is only Rdma read mirror image, ROOTFS are root file system, and KERNEL is kernel, and flash is flash memory, and TOC is uncorrected data.
On flash, above-mentioned four parts of data are had backup, as shown in the table, are distinguish with suffix AB, wherein TOC0 It is uncorrected data with TOC1, KERNEL and ROOTFS are then stored in the subregion that partition table is divided.For convenience, rear literary fame Word " subregion " is the subregion of broad sense, also works as Composition Region to the region TOC0 and TOC1.
TOC0_A TOC1_A KERNEL_A ROOTFS_A
TOC0_B TOC1_B KERNEL_B ROOTFS_B
Table 1
The prior art during startup, only judges integrality, and it is A that starting, which can first attempt to verification starting suffix, every time The subregion that verification starting suffix is B is just attempted in subregion, verification failure.
It is described in further detail as, when electrifying startup, solidifies and will use certificate verification TOC0_A in the BROM of IC, if Verification passes through, and starts TOC0_A, otherwise attempts verification starting TOC0_B.For TOC0, verification starting TOC1_A, school are first attempted to It tests failure and then attempts verification starting TOC1_B.For TOC1, verification starting KERNEL_A and ROOTFS_A, verification can be first attempted to Verification starting KERNEL_B and ROOTFS_B is then attempted in failure.
Its shortcoming is that if different versions may be used in mixed way in start-up course there are the system of multiple versions in flash This partition data, leads to compatibility issue.To be V1 there are version number in system and for the two systems of V2 is in version number, Consider following situation A (table 2), for some reason, the data on flash are destroyed TOC0_A, can not pass through verification.
V2 (damage) V2# V2# V2#
V1# V1 V1# V1
Table 2
When then starting, if map logo has shown in the subregion of " # ", can successively it start, the TOC0_B of V1 version, V2 version TOC1_A, KERNEL_A and ROOTFS_A.Wherein there may be new and old compatibilities by the TOC1_A of the TOC0_B and V2 version of V1 version Problem.
Consider following situation B (table 3), for some reason, the data on flash are destroyed KERNEL_A, can not be passed through Verification.
V2# V2# V2 (damage) V2#
V1 V1 V1# V1
Table 3
When then starting, can successively it start, the TOC0_A of V2 version, the TOC1_A of V2 version, the KERNEL_B of V1 version, V2 The ROOTFS_A of version.Wherein there may be new and old compatibilities by the TOC1_A and ROOTFS_B of KERNEL_B the and V2 version of V1 version Problem.
During OTA, according to actual OTA update scheme, there may be more complicated situations for subregion.
Summary of the invention
In view of the deficiencies of the prior art, technical solution of the present invention provides a kind of compatible starting side of multi version system Method, by being embedded in the data structure comprising version number information in partition data, so that on startup can be by detecting each point The version number in area selects the subregion of version adaptation to be started, avoids being used in mixed way new-old system.
Technical solution of the present invention includes a kind of compatible starting method of multi version system, which is characterized in that this method It include: S10, flash memory system generates corresponding version number in programming system, for the system of institute's burning, each system version is drawn It is divided into multiple data subregions, and generates corresponding backup for each system version;S20, when system electrification, successively to each data Subregion is verified, if verifying the normal starting if, if verification is not verified by the data subregion to multiple versions, And record verification data;S30, when verification is damaged to one or more data subregions, then to the corresponding data of all versions point Area is detected, if it exists holonomic system, then is destroyed the corresponding data subregion of checked system;S40 is opened again It is dynamic, and the detected holonomic system data subregion of the step S30 is selected successively to be verified, complete compatibility starting.
According to the compatible starting method of the multi version system, wherein step S10 further include: S11, to flash memory burn When recording system, the system of institute's burning is divided into multiple uncorrected data subregions being arranged successively, kernel data subregion and root file system System data subregion, wherein uncorrected data subregion is multiple;S12 is the corresponding version of the corresponding multiple data partition identifications of each system This number, when with multiple systems, system version number progress is incremented by successively, and wherein version number's splicing is on data subregion.
In a preferred embodiment, this method further include: described to splice the version number in data subregion in data It is also verified together when subregion is verified.
According to the compatible starting method of the multi version system, wherein including: to data to the verification of data subregion The data integrity of subregion is verified, and, call corresponding certificate to be verified.
According to the compatible starting method of the multi version system, wherein step S20 further include: if first data point It when area can not pass through verification, then restarts and other data subregions is selected to be verified, recording first data subregion can not lead to Cross the version number of verification;If not first data subregion can not pass through verification, then the data subregion detected and corresponding is recorded System version number and the S30 that gos to step.
According to the compatible starting method of the multi version system, wherein step S30 further include: obtain the step The verification data of S20, and multiple data subregions of checked system version are destroyed, record destroyed data subregion Version number;All subregions of multiple systems are traversed, all data subregions of available system version is searched, meets the requirements if finding System version, then execute restart.
According to the compatible starting method of the multi version system, wherein step S30 further include: when restarting read The version number of record, execution are skipped and are verified to the data subregion of satisfactory system version, and compatibility starting is completed.
The invention has the benefit that by being embedded in the data structure comprising version number information in partition data, so that The subregion of version adaptation can be selected to be started by the version number of each subregion of detection on startup, avoid being used in mixed way new Old system, and then avoid compatibility issue.
Detailed description of the invention
Fig. 1 show the overview flow chart of embodiment according to the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, right in the following with reference to the drawings and specific embodiments The present invention is described in detail.The compatibility that the compatible starting method of multi version system of the invention is suitable for flash memory system opens It is dynamic.
Fig. 1 show the overview flow chart of embodiment according to the present invention.S10, flash memory system is in programming system, for institute The system of burning generates corresponding version number, each system version is divided into multiple data subregions, and be each system version Generate corresponding backup;S20 when system electrification, successively verifies each data subregion, if verify pass through if normally open It is dynamic, the data subregion of multiple versions is verified not if if verification, and record verification data;S30, when verification is to one Or when the damage of multiple data subregions, then the corresponding data subregion of all versions is detected, if it exists holonomic system, then it will The corresponding data subregion of the system of verification is destroyed;S40, restarting, and select the detected holonomic system of step S30 Data subregion is successively verified, and compatibility starting is completed.
Technical solution of the present invention is further described technical solution of the present invention by such as following table 4-7: design one A data structure comprising version number.When generating each partition data, be spliced on partition data, jointly by certificate or certain The protection of integrity verification scheme.The new system for update is generated every time, is incremented version number.When starting, knot The version number's state for closing each subregion may be selected suitable subregion and be started.It avoids being used in mixed way the inconsistent subregion of version, Lead to compatibility issue.Judged according to version number, there are many specific starting strategies.The following are a kind of strategy each stage, First judge that the next stage version number of all optional subregions then starts if there is matched version number, if do not deposited Judging the integrality of all subregions and version number on flash, then to determine whether there is consistent available system of a set of version number System.And try to start the set system.
On flash, above-mentioned four parts of data are had backup, as shown in table 4 below, are distinguish with suffix AB.
TOC0_A TOC1_A KERNEL_A ROOTFS_A
TOC0_B TOC1_B KERNEL_B ROOTFS_B
Table 4
When initial burning, there are two systems in flash, two systems are consistent other than version number.
V2 V2 V2 V2
V1 V1 V1 V1
Table 5
When electrifying startup, solidify and verify TOC0_A in the certificate that the BROM of IC will use TOC0_A, if verification is logical It crosses, starts TOC0_A, subsequent partitions are started by TOC0_A.If verification does not pass through, BROM is verified using the certificate of TOC0_B TOC0_B starts TOC0_B, starts subsequent partitions by TOC0_B if verification passes through.
Consider following situation A, for some reason, the data on flash are destroyed TOC1_A, can not pass through verification.
V2 (damage) V2 V2 V2
V1# V1# V1# V1#
Table 6
When then starting, as shown in frame red in figure, can successively it start, the TOC0_B of V1 version, TOC0_B judge choosing The subsequent TOC1 with oneself version match is selected, the TOC1_B of V1 version is then chosen, and so on, V1 version can be chosen KERNEL and ROOTFS finally starts the system of a whole set of V1 version.
Consider following situation B (table 7), for some reason, the data on flash are destroyed KERNEL_A, can not be passed through Verification.
V2 V2 V2 (damage) V2
V1 V1 V1 V1
Table 7
Start at this time, will start the TOC1_A of the TOC0_A and V2 version of V2 version.In the TOC1 stage, determine subsequent KERNEL_A verification failure, and KERNEL_B is verified successfully but version and itself version mismatch.Then starting detection scans institute After there are eight subregions, the V1 system there are complete set is judged.Then the TOC0_A that V2 version is on flash is deliberately destroyed (optionally, further destroying the TOC1_A for being in V2 version) makes that verification can not be passed through when its starting next time.Then restart.
After restarting, each subregion state is as shown in table 8 below.
V2 (damage) V2 (damage) V2 (damage) V2
V1# V1# V1# V1#
Table 8
TOC0_A in V2 version is destroyed, and the BROM meeting successful TOC0_B of selection check is started, TOC0_B The subsequent subregion with identical version number can be selected to be started according to the version number V1 of itself.Finally start a whole set of V1 editions This system.
It, can be with as long as determining in flash there are a whole set of complete system in the case where more complicated Start the set system by actively destroying certain subregions.It, also can be according to strategy to the greatest extent if there is no a whole set of complete system The preferable subregion of amount selection compatibility is started.Key be in subregion must with the even more information of version number information, Start-up course could judge partition information and select how to start, avoid possible compatibility issue according to predetermined policy in this way.
The above, only presently preferred embodiments of the present invention, the invention is not limited to above embodiment, as long as It reaches technical effect of the invention with identical means, all should belong to protection scope of the present invention.In protection model of the invention Its technical solution and/or embodiment can have a variety of different modifications and variations in enclosing.

Claims (7)

1. a kind of compatible starting method of multi version system, which is characterized in that this method comprises:
S10, flash memory system generate corresponding version number in programming system, for the system of institute's burning, each system version are drawn It is divided into multiple data subregions, and generates corresponding backup for each system version;
S20 when system electrification, successively verifies each data subregion, if verify pass through if normal starting, if verification is obstructed It crosses, the data subregion of multiple versions is verified, and record verification data;
S30 then detects the corresponding data subregion of all versions when verification is damaged to one or more data subregions, Holonomic system if it exists then destroys the corresponding data subregion of checked system;
S40, restarting, and the detected holonomic system data subregion of the step S30 is selected successively to be verified, complete compatibility Property starting.
2. the compatible starting method of multi version system according to claim 1, which is characterized in that the step S10 Further include:
The system of institute's burning when to flash recordable system, is divided into multiple uncorrected data subregions being arranged successively, interior nucleus number by S11 According to subregion and root file system data subregion, wherein uncorrected data subregion is multiple;
S12 is the corresponding version number of the corresponding multiple data partition identifications of each system, when with multiple systems, system version This number progress is incremented by successively, and wherein version number's splicing is on data subregion.
3. the compatible starting method of multi version system according to claim 1 or 2, which is characterized in that this method is also wrapped It includes:
The splicing is also verified together when data subregion is verified in the version number of data subregion.
4. the compatible starting method of multi version system according to claim 1, which is characterized in that described to data subregion Verification include: the data integrity of data subregion is verified, and, call corresponding certificate to be verified.
5. the compatible starting method of multi version system according to claim 1, which is characterized in that the step S20 Further include:
If first data subregion can not pass through verification, restart and other data subregions is selected to be verified, record is first A data subregion can not pass through the version number of verification;
If not first data subregion can not pass through verification, then the data subregion detected and corresponding system version number are recorded simultaneously Go to step S30.
6. the compatible starting method of multi version system according to claim 1, which is characterized in that the step S30 Further include:
The verification data of the step S20 are obtained, and multiple data subregions of checked system version are destroyed, are recorded The version number of destroyed data subregion;
All subregions of multiple systems are traversed, all data subregions of available system version are searched, if finding satisfactory System version then executes and restarts.
7. the compatible starting method of multi version system according to claim 1 or 6, which is characterized in that the step S30 further include:
The version number recorded is read when restarting, execution skips and carries out school to the data subregion of satisfactory system version It tests, completes compatibility starting.
CN201810671468.1A 2018-06-26 2018-06-26 Compatibility starting method of multi-version system Active CN109101279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810671468.1A CN109101279B (en) 2018-06-26 2018-06-26 Compatibility starting method of multi-version system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810671468.1A CN109101279B (en) 2018-06-26 2018-06-26 Compatibility starting method of multi-version system

Publications (2)

Publication Number Publication Date
CN109101279A true CN109101279A (en) 2018-12-28
CN109101279B CN109101279B (en) 2021-08-24

Family

ID=64845052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810671468.1A Active CN109101279B (en) 2018-06-26 2018-06-26 Compatibility starting method of multi-version system

Country Status (1)

Country Link
CN (1) CN109101279B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138343A (en) * 2020-09-04 2022-03-04 青岛海信移动通信技术股份有限公司 Terminal and terminal starting method
CN115328563A (en) * 2022-10-09 2022-11-11 荣耀终端有限公司 System starting method and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205396A1 (en) * 2003-03-11 2004-10-14 Chien-Hao Wu Computer system capable of operating in multiple operation modes and the operating method thereof
CN101188516A (en) * 2007-12-21 2008-05-28 康佳集团股份有限公司 A highly reliable and self-adapted remote update method for network device software system
CN101782859A (en) * 2010-03-18 2010-07-21 上海乐毅信息科技有限公司 Upgrading method of embedded system in application
US20120137288A1 (en) * 2010-11-29 2012-05-31 International Business Machines Corporation Virtualization of vendor specific configuration and management of self-virtualizing input/output device
CN102622280A (en) * 2011-01-06 2012-08-01 苏州科达科技有限公司 Control method and control device used for software version upgrade and based on dual file system
CN103106092A (en) * 2013-02-18 2013-05-15 青岛海信宽带多媒体技术有限公司 System software updating method and device in terminal appliance
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104484241A (en) * 2014-12-10 2015-04-01 广东欧珀移动通信有限公司 Terminal system file backup and recovery method and device
CN107273160A (en) * 2017-06-09 2017-10-20 青岛海信电器股份有限公司 A kind of method and device of edition upgrading
CN107301070A (en) * 2017-06-20 2017-10-27 福州汇思博信息技术有限公司 A kind of upgrade method and terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205396A1 (en) * 2003-03-11 2004-10-14 Chien-Hao Wu Computer system capable of operating in multiple operation modes and the operating method thereof
CN101188516A (en) * 2007-12-21 2008-05-28 康佳集团股份有限公司 A highly reliable and self-adapted remote update method for network device software system
CN101782859A (en) * 2010-03-18 2010-07-21 上海乐毅信息科技有限公司 Upgrading method of embedded system in application
US20120137288A1 (en) * 2010-11-29 2012-05-31 International Business Machines Corporation Virtualization of vendor specific configuration and management of self-virtualizing input/output device
CN102622280A (en) * 2011-01-06 2012-08-01 苏州科达科技有限公司 Control method and control device used for software version upgrade and based on dual file system
CN103106092A (en) * 2013-02-18 2013-05-15 青岛海信宽带多媒体技术有限公司 System software updating method and device in terminal appliance
CN103677947A (en) * 2014-01-03 2014-03-26 深圳英飞拓科技股份有限公司 Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux
CN104484241A (en) * 2014-12-10 2015-04-01 广东欧珀移动通信有限公司 Terminal system file backup and recovery method and device
CN107273160A (en) * 2017-06-09 2017-10-20 青岛海信电器股份有限公司 A kind of method and device of edition upgrading
CN107301070A (en) * 2017-06-20 2017-10-27 福州汇思博信息技术有限公司 A kind of upgrade method and terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
陈 屴: "Android云终端的系统备份与还原方案", 《福建电脑》 *
麦田_SUN: "linux系统下备份多个根文件系统", 《HTTPS://BLOG.CSDN.NET/LAOWU1001/ARTICLE/DETAILS/48657259》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138343A (en) * 2020-09-04 2022-03-04 青岛海信移动通信技术股份有限公司 Terminal and terminal starting method
CN115328563A (en) * 2022-10-09 2022-11-11 荣耀终端有限公司 System starting method and electronic equipment

Also Published As

Publication number Publication date
CN109101279B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
TWI643130B (en) SYSTEM AND METHOD FOR AUTO-ENROLLING OPTION ROMs IN A UEFI SECURE BOOT DATABASE
CN106020865A (en) System upgrading method and device
CN107783776B (en) Processing method and device of firmware upgrade package and electronic equipment
CN107729198B (en) Android system firmware verification method and device
US9891862B2 (en) Forensic data acquisition apparatus and method for guaranteeing integrity of flash memory in smart device
CN106293782A (en) A kind of method for upgrading system and terminal
CN105760191A (en) Embedded system equipment programming mass production method
CN105468384A (en) Vehicle-mounted controller programming system and method, server and programming terminal
US6205561B1 (en) Tracking and managing failure-susceptible operations in a computer system
CN112732310A (en) Firmware upgrading method, system, equipment and medium based on embedded boot partition
CN109101279A (en) A kind of compatible starting method of multi version system
CN104866768A (en) Startup control method and device for ATM (Automatic Teller Machine) operating system
US7885647B2 (en) Secure booting method and mobile terminal for the same
US20080184073A1 (en) Power on self test method
CN105159727A (en) Firmware upgrade processing method, apparatus and system
CN102122258A (en) Method for repairing damaged embedded equipment file system
US8949588B1 (en) Mobile telephone as bootstrap device
CN112015587B (en) Method and device for enhancing reliability of operating system
CN107885536A (en) Startup method, embeded processor and the storage device of a kind of embeded processor
CN106445737A (en) Multi-backup starting method
CN104751881B (en) flash memory burning method
JPH1011282A (en) Installing system and executing system for software
US7490232B2 (en) Disk device using disk to rewrite firmware and firmware determination method
CN114625399A (en) System upgrading method and related device, equipment and storage medium
CN101211267A (en) Customized basic input output system updating method

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
GR01 Patent grant
GR01 Patent grant