CN107643898A - Terminal staging method and device - Google Patents

Terminal staging method and device Download PDF

Info

Publication number
CN107643898A
CN107643898A CN201610578920.0A CN201610578920A CN107643898A CN 107643898 A CN107643898 A CN 107643898A CN 201610578920 A CN201610578920 A CN 201610578920A CN 107643898 A CN107643898 A CN 107643898A
Authority
CN
China
Prior art keywords
terminal
aku
partition table
upgrading
capacity
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
CN201610578920.0A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610578920.0A priority Critical patent/CN107643898A/en
Publication of CN107643898A publication Critical patent/CN107643898A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of terminal staging method, the terminal staging method includes:Step A, AKU corresponding to terminal is obtained, and restarts the terminal;Step B, system upgrade is carried out to the terminal using the AKU;Step C, identify in the MISC subregions of the terminal with the presence or absence of default flag bit, be otherwise transferred to and perform step D, be to be transferred to step E;Step D, the current bay table of the terminal is replaced with to the partition table carried in the AKU, the default flag bit is write into the MISC subregions, and execution step B is transferred to after restarting the terminal;Step E, the capacity adjustment code carried in the AKU is performed, the capacity of the user data subregion of the terminal is adjusted to the capacity of user data subregion in the partition table after replacing.The invention also discloses a kind of terminal staging device.The present invention can solve the problem that the problem of end-user listening data subregion capacity is fixed.

Description

Terminal staging method and device
Technical field
The present invention relates to field of terminal technology, more particularly to a kind of terminal staging method and device.
Background technology
As is well known to the skilled person, the terminal based on Android system generally includes system partitioning and user data Subregion, wherein, system partitioning contains whole Android operation system, including Android user interface and the system of all prepackages substantially Application program etc.;User data subregion contains the data of user, such as the program of contact person, short message, setting and user installation Deng.However, in the prior art, after terminal device write-in partition table dispatches from the factory, user is can not to be repaiied by changing partition table Use user data subregion capacity instead.In actual use, the wrong partition table that possible terminal is written with when dispatching from the factory, either User has changed the user data division module of modular terminal, because user can not change partition table so that user is difficult to just User data subregion capacity often is used, the problem of user data subregion capacity fixation be present.
The content of the invention
It is a primary object of the present invention to provide a kind of terminal staging method and device, it is intended to solve the user data of terminal The problem of subregion capacity is fixed.
To achieve the above object, the present invention provides a kind of terminal staging method, and the terminal staging method includes:
Step A, AKU corresponding to terminal is obtained, and restarts the terminal;
Step B, system upgrade is carried out to the terminal using the AKU;
Step C, identify in the MISC subregions of the terminal with the presence or absence of default flag bit, be otherwise transferred to and perform step D, be Then it is transferred to step E;
Step D, the current bay table of the terminal is replaced with to the partition table carried in the AKU, to the MISC The default flag bit is write in subregion, and execution step C is transferred to after restarting the terminal;
Step E, the capacity adjustment code carried in the AKU is performed, by the appearance of the user data subregion of the terminal Amount is adjusted to the capacity of user data subregion in the partition table after replacing.
Alternatively, AKU corresponding to the acquisition terminal includes:
Send AKU and obtain request to default upgrade server;
Receive the upgrading that the default upgrade server obtains the correspondence terminal that request returns based on the AKU Bag.
Alternatively, it is described before the step of obtaining AKU corresponding to terminal, and restarting the terminal, in addition to:
AKU is generated according to current updated contents, and the partition table of upgrading is built into the AKU;
The AKU for the partition table for being built-in with upgrading is stored into the predetermined server.
Alternatively, the AKU by the partition table for being built-in with upgrading store to the step in the predetermined server it Before, in addition to:
The form of the AKU for the partition table for being built-in with upgrading is converted into the recognizable form of the predetermined server;
After format conversion operation is completed, be transferred to perform the AKU by the partition table for being built-in with upgrading store to Step in the predetermined server.
Alternatively, the capacity of the user data subregion by the terminal is adjusted to number of users in the partition table after replacing According to subregion capacity the step of after, in addition to:
Delete the default flag bit in the MISC subregions and the AKU of acquisition.
In addition, to achieve the above object, the present invention also provides a kind of terminal staging device, the terminal staging device bag Include:
Acquisition module, for obtaining AKU corresponding to terminal, and restart the terminal;
Upgraded module, for carrying out system upgrade to the terminal using the AKU;
Identification module, with the presence or absence of default flag bit in the MISC subregions for identifying the terminal;
Replacement module, during for the default flag bit to be not present in the MISC subregions, by the current of the terminal Partition table replaces with the partition table carried in the AKU, and the default flag bit is write into the MISC subregions, is laid equal stress on Open the terminal;
The upgraded module is additionally operable to after the replacement module restarts the terminal, reuses the AKU to institute State terminal and carry out system upgrade;
The identification module is additionally operable to reuse the AKU to terminal progress system in the upgraded module After upgrading, identify and whether there is the default flag bit in the MISC subregions;
Adjusting module, during for the default flag bit being present in the MISC subregions, performing and being taken in the AKU The capacity adjustment code of band, user data in the partition table after replacing is adjusted to by the capacity of the user data subregion of the terminal The capacity of subregion.
Alternatively, the acquisition module is additionally operable to send AKU acquisition request to default upgrade server;It is additionally operable to connect Receive the AKU that the default upgrade server obtains the correspondence terminal that request returns based on the AKU.
Alternatively, the terminal staging device also includes AKU making module, for according to current updated contents life It is built into AKU, and by the partition table of upgrading in the AKU;It is additionally operable to that the upgrading of the partition table of upgrading will be built-in with Bag storage is into the predetermined server.
Alternatively, the AKU makes module and is additionally operable to change the form for being built-in with the AKU of the partition table of upgrading The form that can recognize that for the predetermined server;It is additionally operable to after format conversion operation is completed, the subregion of upgrading will be built-in with The AKU of table is stored into the predetermined server.
Alternatively, the terminal staging device also includes removing module, described pre- in the MISC subregions for deleting If flag bit and the AKU of acquisition.
Terminal staging method and device proposed by the present invention, by restarting terminal twice, upgrading terminals, were realized to end twice The adjustment of the system upgrade and user data subregion capacity at end, wherein, completed when upgrading first time using AKU to end The upgrading of end system, and the partition table for replacing terminal is the partition table that AKU carries;When upgrading for second, AKU is called The capacity adjustment code of carrying, user data point in the partition table after replacing is adjusted to by the capacity of the user data subregion of terminal The capacity in area.Compared to prior art, the present invention can be while upgrading terminals system, to the user data subregion of terminal Capacity is adjusted, overcome user data subregion in the prior art capacity fix the defects of.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of terminal staging method first embodiment of the present invention;
Fig. 2 is the module diagram of terminal staging device first embodiment of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of terminal staging method, reference picture 1, in the first embodiment of terminal staging method of the present invention In, the terminal staging method includes:
Step 10, AKU corresponding to terminal is obtained, and restarts the terminal;
It should be noted that the terminal based on Android system include Boot, System, Recovery, Data, Cache, MISC subregions, wherein,
Boot subregions start terminal, and it includes kernel (kerne) and ramdisk two parts.If without this Individual subregion, terminal can not generally start to Android system.When only necessary, just go by Recovery software formatizations this Individual subregion, once formatting, terminal only reinstalls a new Boot subregion again, can specifically be included by installing one The ROM of Boot subregions is realized, otherwise can not start Android system.
System subregions contain whole Android operation system substantially, except kernel (kerne) and ramdisk.It includes Android user interface and the system application of all prepackages.This subregion is formatted, whole Android system can be deleted, but not Terminal can be caused not start, still one new ROM, that is, new Android system can be installed by entering Recovery patterns.
Recovery subregions may be considered the substitute of a Boot subregion, and terminal can be made to enter Recovery moulds Formula, carry out high-level recovery or Android system maintenance work.It is described in detail on this subregion, may be referred to CWM guide for uses.
Data subregions (i.e. the present embodiment user data subregion to be operated), contain the data of user:As contact person, Short message, the program what user installation is set etc..This subregion is formatted, is essentially equivalent to terminal factory reset, also It is the state after state when terminal system starts for the first time, or last time installation official or third party ROM.
Cache subregions are Android system buffer areas, the data and application program that the most frequentation of preservation system is asked.Format this Subregion, does not interfere with personal data, simply deletes cache contents saved in this subregion, and cache contents can be follow-up Automatically generated again during terminal use.
MISC subregions include some miscellaneous contents:For example some systems are set and systemic-function enables disabling and set.This A little set includes CID (operator or area identity), USB setting and some hardware settings etc..This is one critically important Subregion, if the damage of this subregion or partial data are lost, some specific functions of terminal will be unable to normal work.
The terminal staging method that the present embodiment proposes is performed by terminal staging device, can be right when applied to terminal While the carry out system upgrade of terminal, the capacity of the user data subregion of terminal is adjusted, in order to which user uses.
Specifically, in the present embodiment, terminal staging device is detected to the upgrade command based on terminal, wherein, it is preceding Triggering can be operated by terminal response user by stating upgrade command, can also be triggered by terminal periodic, or other modes accordingly trigger.
When detecting the upgrade command based on terminal, terminal staging device obtains AKU corresponding to terminal.Wherein, eventually Hold update device obtain terminal corresponding to AKU when, can from terminal be attached external memory storage in directly obtain, such as from Search to obtain in the TF card or USB flash disk of terminal insertion and (on condition that user operates AKU corresponding to terminal acquisition in advance, and accordingly store up In these external memory storages that terminal attachment be present);Default support FOTA (Firmware Over-The- can also be based on Air, the aerial download software upgrading of terminal) technology whois lookup obtain terminal corresponding to AKU, and be stored in terminal External memory storage in.In the present embodiment, which kind of mode AKU corresponding to terminal is specifically got using, the present embodiment is not Concrete restriction is done, those skilled in the art can be selected according to being actually needed.
After AKU corresponding to terminal is obtained, terminal staging device restarts terminal, with switching terminal to Recovery Pattern, wherein, Recovery patterns are similar to Windows PE, after terminal enters Recovery patterns, terminal staging device The data or system of terminal inner can be modified, such as carry out brush machine and factory reset operation.
Step 20, system upgrade is carried out to the terminal using the AKU;
After the terminal is completed to restart and enters Recovery patterns, terminal staging device uses the upgrading obtained Bag carries out system upgrade to terminal, and herein, the updating operation that terminal staging device performs can refer to prior art and accordingly perform, and wrap Include the operations such as the source system version of verification terminal.
Step 30, identify in the MISC subregions of the terminal with the presence or absence of default flag bit, be otherwise transferred to execution step S40, it is to be transferred to step S50;
After the system upgrade of terminal is completed using the AKU obtained, MISC points of terminal staging device identification terminal With the presence or absence of default flag bit in area, wherein, the partition table that default flag bit is used to identify in the present embodiment terminal has been replaced.
It is easily understood that due to now to first enter into Recovery patterns, the partition table of terminal and be modification, MISC Subregion will not have the default flag bit, be now transferred to and perform step S40.
Step 40, the current bay table of the terminal is replaced with to the partition table carried in the AKU, to described The default flag bit is write in MISC subregions, and execution step S20 is transferred to after restarting the terminal;
In the present embodiment, when foregoing default flag bit is not present in MISC subregions, terminal staging device replaces terminal Current partition table, realize the upgrading of partition table.
Specifically, terminal staging device parses the partition table of upgrading from the AKU of foregoing acquisition, by working as terminal Preceding partition table replaces with the partition table of the upgrading parsed.Based on described above, it will be appreciated by persons skilled in the art that by The replacement state of terminal partitions table is characterized by the default flag bit in MISC subregions in the present embodiment, now, terminal staging dress Put foregoing default flag bit write-in MISC subregions.
Write into MISC subregions foregoing default flag bit and then it is secondary restart the terminal, and switching terminal is extremely Recovery patterns, it is transferred to and performs step S20, perform updating operation again.It is understood that when time execution updating operation When, due to having been completed the system upgrade to terminal before, the version number of terminal is consistent with the version number of AKU, when After the secondary source version to terminal verifies, that is, complete, when secondary updating operation, not carry out terminal substantial upgrading.
After updating operation is completed, it is transferred to performs step S30 again, with the presence or absence of default in the MISC subregion of identification terminal Flag bit.Based on described above, it will be appreciated by persons skilled in the art that terminal staging device is carried out for the first time to terminal During updating operation, the partition table of terminal is replaced with to the AKU of the upgrading carried in AKU, and accordingly to MISC Foregoing default flag bit is written with subregion.Obvious, when the recognition result of secondary identification operation includes:In the MISC subregions of terminal Foregoing default flag bit be present, now, be transferred to and perform step 50.
Step 50, the capacity adjustment code carried in the AKU is performed, by the user data subregion of the terminal Capacity is adjusted to the capacity of user data subregion in the partition table after replacing.
In the present embodiment, when foregoing default flag bit in the MISC subregions for recognizing terminal be present, point of terminal is illustrated Area's table has been replaced, and now, terminal staging device calls the capacity the being previously written adjustment code of the carrying in AKU, will eventually The capacity of the user data subregion at end is adjusted to the capacity of user data subregion in the partition table after replacing, so as to complete number of users According to the adjustment of subregion capacity.Wherein, in the specific implementation, the execution of foregoing capacity adjustment code can be in the form of resize processes Embody.
In brief, the present embodiment controls terminal to enter Recovery moulds first when carrying out system upgrade to terminal Formula, according to normal upgrading flow, the master notebook data in terminal is verified, will first be upgraded after verification passes through all Mirror image data, finally upgrade partition table, and a flag bit, second of entrance after instruction terminal is restarted are write to MISC subregions Recovery patterns, after Recovery patterns are entered for the second time after terminal is restarted, a upgrading flow is re-executed, it is real Simply verify whether be upgraded to target version on border, after verification passes through, the capacity carried in AKU is adjusted generation Code copy to terminal /tmp catalogues below, and give its operation required for all permissions, then perform the capacity adjustment generation Code, the capacity of the user data subregion of terminal is adjusted to the capacity of user data subregion in the partition table after upgrading, weighed again After opening terminal and normal boot-strap, user is that the user data subregion capacity after adjustment can be used.
Alternatively, in other embodiments, if the capacity of System subregions and user in the partition table carried in AKU The capacity of data partition changes, that is, needs to change the amount of capacity of System subregions, change user data subregion again Amount of capacity, then in the escalation process to terminal, system subregions are filled using whole system mirror images, then call mkfs to enter Journey reformats to remaining user data subregion, generates the ext4 file system of new size.
The terminal staging method that the present embodiment proposes, by restarting terminal twice, upgrading terminals, are realized to terminal twice The adjustment of system upgrade and user data subregion capacity, wherein, use the complete paired terminal system of AKU when upgrading first time The upgrading of system, and the partition table for replacing terminal is the partition table that AKU carries;When upgrading for second, AKU is called to carry Capacity adjustment code, the capacity of the user data subregion of terminal is adjusted to user data subregion in the partition table after replacing Capacity.Compared to prior art, the present invention can be while upgrading terminals system, to the capacity of the user data subregion of terminal Be adjusted, overcome user data subregion in the prior art capacity fix the defects of.
Further, based on first embodiment, the second embodiment of terminal staging method of the present invention is proposed, in the present embodiment In, AKU corresponding to the acquisition terminal includes:
Send AKU and obtain request to default upgrade server;
Receive the upgrading that the default upgrade server obtains the correspondence terminal that request returns based on the AKU Bag.
It should be noted that FOTA refers to by high in the clouds upgrade technique, for the terminal with networking function, such as mobile phone, put down Plate computer, portable electronic device, mobile internet device etc. provide system upgrade service, can use network with demand, Easy extension way gets the system upgrade bag of terminal, and carries out high in the clouds upgrading by FOTA, completes the reparation of terminal system And optimization.The present embodiment considers FOTA aforementioned advantages, and the system upgrade of terminal is carried out using FOTA.Below only for the area Do not illustrate, other can refer to previous embodiment, and here is omitted.
In the present embodiment, when obtaining AKU corresponding to terminal, terminal staging device specifically sends AKU acquisition Request, so that this presets upgrade server when receiving AKU acquisition request, finds it to default upgrade server AKU corresponding to the aforementioned terminals that ground prestores, and AKU corresponding to the terminal found is back to aforementioned terminals, by end Update device is held to carry out system upgrade to terminal.Wherein, presetting upgrade server includes providing FOTA upgrade services clothes for terminal The FOTA servers of business and the data server of other offer data storage services etc..
Corresponding, based on terminal receive AKU corresponding to the terminal that foregoing default upgrade server returns it Afterwards, system upgrade, and the adjustment of user data subregion capacity are carried out to terminal using the AKU, specifically can refer to foregoing reality Example is applied, here is omitted.
Further, in the present embodiment, before step 10, in addition to:
AKU is generated according to current updated contents, and the partition table of upgrading is built into the AKU;
The AKU for the partition table for being built-in with upgrading is stored into the predetermined server.
It should be noted that the terminal staging device of the present embodiment includes two parts, one is used to carry out system to terminal Upgrading, secondly the AKU for making upgrading.
Specifically, terminal staging device produces and generates AKU according to current updated contents, and by the partition table of upgrading It is built into newly-generated AKU.Wherein, current updated contents are the difference of new-old system version.
Alternatively, it is lifting operation efficiency, this document ota_from_target_ that binds foot that can be provided to Google New code is added in files.py, is copied partition table in AKU from structure version to for realizing, and write appearance Amount adjustment code can upgrade by partition table.Accordingly, when making AKU, amended sheet of binding foot can be directly performed, Realize quickly generating for AKU, and partition table is built-in.
Alternatively, when the partition table of built-in upgrading is into AKU, specifically can built-in active/standby partition table to AKU In, to make redundancy backup.
Further, terminal staging device also needs to that new function is being added below in install.c: RegisterFunction (" update_partition_table ", UpdatePtableFn), for really performing foregoing add The capacity adjustment code added.Because the logical partition of terminal versions storage partition table is known to confirmation, as long as so opening solid Earnest manages logical partition number, writes the upgrading that partition table can be achieved in two partition tables being stored in AKU.In addition, it is true Protect partition table to write successfully, it is also necessary to call fsync orders that partition table is synchronized to above the storage device of terminal.
Further, because the present embodiment carries out system upgrade by the way of FOTA, to ensure foregoing predetermined server The AKU of upgrading can correctly be identified, in the present embodiment, the AKU by the partition table for being built-in with upgrading store to Before step in the predetermined server, in addition to:
The form of the AKU for the partition table for being built-in with upgrading is converted into the recognizable form of the predetermined server;
After format conversion operation is completed, be transferred to perform the AKU by the partition table for being built-in with upgrading store to Step in the predetermined server.
Specifically, in the present embodiment, after completing built in partition table, terminal staging device is not immediately by built in The AKU for having the partition table of upgrading is stored to foregoing default upgrade server, but will first be built-in with the liter of the partition table of upgrading The form of level bag is converted to the recognizable form of the predetermined server, for example, the AKU by the partition table for being built-in with upgrading Form be converted to the recognizable upc forms of FOTA servers.
After completing to the format conversion operation of AKU, terminal staging device will be built-in with the liter of the partition table of upgrading Level bag storage into the predetermined server, for triggering terminal updating operation when, it is corresponding to obtain upgrading, before specifically can refer to Embodiment is stated, here is omitted.
In addition, while the AKU for being built-in with the partition table of upgrading is stored into the predetermined server, need to The terminal iidentification for the terminal to be upgraded is associated with the AKU so that in terminal staging, terminal staging device can be got AKU corresponding to terminal where it, the AKU that terminal staging device is sent obtain the end that its place terminal is carried in request End mark, for accordingly finding AKU corresponding to terminal for foregoing default upgrade server and returning.Wherein, terminal iidentification For unique mark terminal, in the specific implementation, IMEI (the International Mobile of terminal can be selected Equipment Identity, International Mobile Station Equipment Identification) it is used as its terminal iidentification.
Alternatively, foregoing predetermined server (can also be built-in with the subregion of upgrading detecting the AKU that newly stores The AKU of table) when, the prompt message of upgrading is sent to corresponding terminal, by terminal display to user, to prompt user to download AKU carries out system upgrade.
Further, based on foregoing first or second embodiments, the 3rd embodiment of terminal staging method of the present invention is proposed, In the present embodiment, after step 50, in addition to:
Delete the default flag bit in the MISC subregions and the AKU of acquisition.
Based on described above, it will be appreciated by persons skilled in the art that terminal staging device passes through in escalation process It whether there is foregoing default flag bit in MISC subregions, whether completing upgrading to the partition table of terminal judges.If complete After secondary updating operation (adjustment for including the system upgrade of terminal and user data area capacity), do not remove when time updating operation The default flag bit write in MISC subregions, when upgrading next time, the capacity for causing user data subregion can not be adjusted.Cause This, the present embodiment is on the basis of previous embodiment, after the updating operation of terminal is completed, adds the MISC for deleting terminal The operation of the default flag bit added in subregion.
Further, since external memory space has the physical store upper limit, when capacity is full, it is impossible to normal to provide storage clothes Business, also just it is not used to store AKU.Therefore, in the present embodiment, after the updating operation of terminal is completed, external storage is empty Between the AKU of middle storage obviously do not continue necessity of storage, terminal staging device can be also deleted directly in external memory space The AKU worked as acquired in time updating operation of storage, to avoid the waste of capacity of external memory space.
The present invention also provides a kind of terminal staging device for performing aforementioned terminals upgrade method, reference picture 2, corresponding to foregoing The first embodiment of terminal staging method, in the first embodiment of terminal staging device of the present invention, the terminal staging device Including:
Acquisition module 10, for obtaining AKU corresponding to terminal, and restart the terminal;
It should be noted that the terminal based on Android system include Boot, System, Recovery, Data, Cache, MISC subregions, wherein,
Boot subregions start terminal, and it includes kernel (kerne) and ramdisk two parts.If without this Individual subregion, terminal can not generally start to Android system.When only necessary, just go by Recovery software formatizations this Individual subregion, once formatting, terminal only reinstalls a new Boot subregion again, can specifically be included by installing one The ROM of Boot subregions is realized, otherwise can not start Android system.
System subregions contain whole Android operation system substantially, except kernel (kerne) and ramdisk.It includes Android user interface and the system application of all prepackages.This subregion is formatted, whole Android system can be deleted, but not Terminal can be caused not start, still one new ROM, that is, new Android system can be installed by entering Recovery patterns.
Recovery subregions may be considered the substitute of a Boot subregion, and terminal can be made to enter Recovery moulds Formula, carry out high-level recovery or Android system maintenance work.It is described in detail on this subregion, may be referred to CWM guide for uses.
Data subregions (i.e. the present embodiment user data subregion to be operated), contain the data of user:As contact person, Short message, the program what user installation is set etc..This subregion is formatted, is essentially equivalent to terminal factory reset, also It is the state after state when terminal system starts for the first time, or last time installation official or third party ROM.
Cache subregions are Android system buffer areas, the data and application program that the most frequentation of preservation system is asked.Format this Subregion, does not interfere with personal data, simply deletes cache contents saved in this subregion, and cache contents can be follow-up Automatically generated again during terminal use.
MISC subregions include some miscellaneous contents:For example some systems are set and systemic-function enables disabling and set.This A little set includes CID (operator or area identity), USB setting and some hardware settings etc..This is one critically important Subregion, if the damage of this subregion or partial data are lost, some specific functions of terminal will be unable to normal work.
The terminal staging device that the present embodiment proposes, can be in the progress system upgrade to terminal when applied to terminal Meanwhile the capacity of the user data subregion of terminal is adjusted, in order to which user uses.
Specifically, in the present embodiment, the acquisition module 10 of terminal staging device is carried out to the upgrade command based on terminal Detecting, wherein, foregoing upgrade command can be operated triggering by terminal response user, can also be triggered by terminal periodic, or other Mode accordingly triggers.
When detecting the upgrade command based on terminal, acquisition module 10 obtains AKU corresponding to terminal.Wherein, obtain Module 10 directly obtains, such as from terminal when obtaining AKU corresponding to terminal in the external memory storage that can be attached from terminal Search to obtain in the TF card or USB flash disk of insertion and (on condition that user operates AKU corresponding to terminal acquisition in advance, and be accordingly stored in In these external memory storages of terminal attachment);Default support FOTA (Firmware Over-The-Air, end can also be based on The aerial download software upgrading at end) technology whois lookup obtain terminal corresponding to AKU, and be stored in the outside of terminal In memory.In the present embodiment, which kind of mode AKU corresponding to terminal is specifically got using, the present embodiment is not done specifically Limitation, those skilled in the art can be selected according to being actually needed.
After AKU corresponding to terminal is obtained, acquisition module 10 restarts terminal, with switching terminal to Recovery moulds Formula, wherein, Recovery patterns are similar to Windows PE, and after terminal enters Recovery patterns, terminal staging device can Modified with the data to terminal inner or system, such as carry out brush machine and factory reset operation.
Upgraded module 20, for carrying out system upgrade to the terminal using the AKU;
After the terminal is completed to restart and enters Recovery patterns, upgraded module 20 is obtained using acquisition module 10 The AKU taken carries out system upgrade to terminal, and herein, it is corresponding that the updating operation that upgraded module 20 performs can refer to prior art Perform, including the operation such as source system version of verification terminal.
Identification module 30, with the presence or absence of default flag bit in the MISC subregions for identifying the terminal;
After the system upgrade that the AKU that upgraded module 20 is obtained using acquisition module 10 completes terminal, identification module With the presence or absence of default flag bit in the MISC subregions of 30 identification terminals, wherein, default flag bit is used to identify in the present embodiment The partition table of terminal has been replaced.
It is easily understood that due to now to first enter into Recovery patterns, the partition table of terminal and be modification, MISC Subregion will not have the default flag bit, and now identification module 30 indicates that replacement module 40 performs the replacement operation of partition table.
Replacement module 40, during for the default flag bit to be not present in the MISC subregions, by working as the terminal Preceding partition table replaces with the partition table carried in the AKU, and the default flag bit is write into the MISC subregions, and Restart the terminal;
The upgraded module 20 is additionally operable to after the replacement module 40 restarts the terminal, reuses the AKU System upgrade is carried out to the terminal;
The identification module 30 is additionally operable to reuse the AKU to terminal progress in the upgraded module 20 After system upgrade, identify and whether there is the default flag bit in the MISC subregions;
In the present embodiment, when foregoing default flag bit is not present in MISC subregions, terminal staging device replaces terminal Current partition table, realize the upgrading of partition table.
Specifically, receive identification module 30 transmission execution replacement operation configured information when, replacement module 40 from The partition table of upgrading is parsed in the AKU that foregoing acquisition module 10 obtains, the current bay table of terminal is replaced with and parsed Upgrading partition table.Based on described above, it will be appreciated by persons skilled in the art that because the present embodiment passes through MISC points Default flag bit in area characterizes the replacement state of terminal partitions table, and now, replacement module 40 writes foregoing default flag bit MISC subregions.
Replacement module 40 write into MISC subregions foregoing default flag bit and then it is secondary restart the terminal, and cut Terminal is changed to Recovery patterns, now upgraded module 20 will perform updating operation again.It is understood that in upgraded module 20 when secondary execution updating operation, due to having been completed the system upgrade to terminal before, the version number of terminal with liter The version number of level bag is consistent, after the secondary source version to terminal verifies, that is, completes when secondary updating operation, not to end End carries out substantial upgrading.
For upgraded module 20 after updating operation is completed, instruction identification module 30 performs the identification of foregoing default flag bit again Operate, with the presence or absence of default flag bit in the MISC subregions of identification terminal.Based on described above, those skilled in the art can manage The partition table of terminal is replaced with AKU by solution, upgraded module 20 when carrying out first time updating operation to terminal The AKU of the upgrading of middle carrying, and foregoing default flag bit is accordingly written with into MISC subregions from replacement module 40.It is aobvious Right, identification module 30 includes when time recognition result of identification operation:Foregoing default flag bit in the MISC subregions of terminal be present, Now, identification module 30 indicates that adjusting module 50 carries out the capacity adjustment operation of user data subregion.
Adjusting module 50, during for the default flag bit be present in the MISC subregions, perform in the AKU The capacity adjustment code of carrying, number of users in the partition table after replacing is adjusted to by the capacity of the user data subregion of the terminal According to the capacity of subregion.
In the present embodiment, when foregoing default flag bit in the MISC subregions that identification module 30 recognizes terminal be present, say The partition table of bright terminal has been replaced, and now, adjusting module 50 calls the capacity the being previously written adjustment of the carrying in AKU Code, the capacity of the user data subregion of terminal is adjusted to the capacity of user data subregion in the partition table after replacing, so as to Complete the adjustment of user data subregion capacity.Wherein, in the specific implementation, the execution of foregoing capacity adjustment code can be with resize The form of process embodies.
In brief, the present embodiment controls terminal to enter Recovery moulds first when carrying out system upgrade to terminal Formula, according to normal upgrading flow, the master notebook data in terminal is verified, will first be upgraded after verification passes through all Mirror image data, finally upgrade partition table, and a flag bit, second of entrance after instruction terminal is restarted are write to MISC subregions Recovery patterns, after Recovery patterns are entered for the second time after terminal is restarted, a upgrading flow is re-executed, it is real Simply verify whether be upgraded to target version on border, after verification passes through, the capacity carried in AKU is adjusted generation Code copy to terminal /tmp catalogues below, and give its operation required for all permissions, then perform the capacity adjustment generation Code, the capacity of the user data subregion of terminal is adjusted to the capacity of user data subregion in the partition table after upgrading.Weigh again After opening terminal and normal boot-strap, user is that the user data subregion capacity after adjustment can be used.
Alternatively, in other embodiments, if the capacity of System subregions and user in the partition table carried in AKU The capacity of data partition changes, that is, needs to change the amount of capacity of System subregions, change user data subregion again Amount of capacity, then in the escalation process to terminal, system subregions are filled using whole system mirror images, then call mkfs to enter Journey reformats to remaining user data subregion, generates the ext4 file system of new size.
The terminal staging device that the present embodiment proposes, by restarting terminal twice, upgrading terminals, are realized to terminal twice The adjustment of system upgrade and user data subregion capacity, wherein, use the complete paired terminal system of AKU when upgrading first time The upgrading of system, and the partition table for replacing terminal is the partition table that AKU carries;When upgrading for second, AKU is called to carry Capacity adjustment code, the capacity of the user data subregion of terminal is adjusted to user data subregion in the partition table after replacing Capacity.Compared to prior art, the present invention can be while upgrading terminals system, to the capacity of the user data subregion of terminal Be adjusted, overcome user data subregion in the prior art capacity fix the defects of.
Further, based on first embodiment, the second embodiment of terminal staging device of the present invention is proposed, corresponding to foregoing The second embodiment of terminal staging method, in the present embodiment, the acquisition module 10 are additionally operable to send AKU acquisition request To default upgrade server;It is additionally operable to receive the correspondence that the default upgrade server obtains request return based on the AKU The AKU of the terminal.
It should be noted that FOTA refers to by high in the clouds upgrade technique, for the terminal with networking function, such as mobile phone, put down Plate computer, portable electronic device, mobile internet device etc. provide system upgrade service, can use network with demand, Easy extension way gets the system upgrade bag of terminal, and carries out high in the clouds upgrading by FOTA, completes the reparation of terminal system And optimization.The present embodiment considers FOTA aforementioned advantages, and the system upgrade of terminal is carried out using FOTA.Below only for the area Do not illustrate, other can refer to previous embodiment, and here is omitted.
In the present embodiment, when obtaining AKU corresponding to terminal, acquisition module 10 specifically sends AKU acquisition please Ask to default upgrade server, so that this presets upgrade server when receiving AKU acquisition request, find its local AKU corresponding to the aforementioned terminals to prestore, and AKU corresponding to the terminal found is back to aforementioned terminals, by terminal Update device carries out system upgrade to terminal.Wherein, presetting upgrade server includes providing FOTA upgrade service services for terminal FOTA servers and other offer data storage services data server etc..
Corresponding, based on terminal receive AKU corresponding to the terminal that foregoing default upgrade server returns it Afterwards, terminal staging device carries out system upgrade, and the adjustment of user data subregion capacity to terminal using the AKU, specifically Previous embodiment is can refer to, here is omitted.
Further, in the present embodiment, the terminal staging device also includes AKU making module, works as basis Preceding updated contents generation AKU, and the partition table of upgrading is built into the AKU;It is additionally operable to that upgrading will be built-in with The AKU of partition table store into the predetermined server.
It should be noted that the terminal staging device of the present embodiment includes two parts, one is used to carry out system to terminal Upgrading, secondly the AKU for making upgrading.
Specifically, AKU makes module produces and generates AKU according to current updated contents, and by the subregion of upgrading Table is built into newly-generated AKU.Wherein, current updated contents are the difference of new-old system version.
Alternatively, it is lifting operation efficiency, this document ota_from_target_ that binds foot that can be provided to Google New code is added in files.py, is copied partition table in AKU from structure version to for realizing, and write appearance Amount adjustment code can upgrade by partition table.Accordingly, when making AKU, amended sheet of binding foot can be directly performed, Realize quickly generating for AKU, and partition table is built-in.
Alternatively, when the partition table of built-in upgrading is into AKU, AKU makes module specifically can be built-in active/standby point Area's table is into AKU, to make redundancy backup.
Further, AKU makes module and also needs to that new function is being added below in install.c: RegisterFunction (" update_partition_table ", UpdatePtableFn), for really performing foregoing add The capacity adjustment code added.Because the logical partition of terminal versions storage partition table is known to confirmation, as long as so opening solid Earnest manages logical partition number, writes the upgrading that partition table can be achieved in two partition tables being stored in AKU.In addition, it is true Protect partition table to write successfully, it is also necessary to call fsync orders that partition table is synchronized to above the storage device of terminal.
Further, because the present embodiment carries out system upgrade by the way of FOTA, to ensure foregoing predetermined server The AKU of upgrading can be correctly identified, in the present embodiment, the AKU makes module and is additionally operable to that upgrading will be built-in with The form of the AKU of partition table is converted to the recognizable form of the predetermined server;It is additionally operable to complete format conversion operation Afterwards, the AKU for the partition table for being built-in with upgrading is stored into the predetermined server.
Specifically, in the present embodiment, after completing built in partition table, AKU making module is not immediately by The AKU for being equipped with the partition table of upgrading is stored to foregoing default upgrade server, but will first be built-in with the partition table of upgrading The form of AKU is converted to the recognizable form of the predetermined server, for example, the upgrading by the partition table for being built-in with upgrading The form of bag is converted to the recognizable upc forms of FOTA servers.
After completing to the format conversion operation of AKU, AKU making module will be built-in with the partition table of upgrading AKU is stored into the predetermined server, for triggering terminal updating operation when, it is corresponding to obtain upgrading, specifically can refer to Previous embodiment, here is omitted.
In addition, while the AKU for being built-in with the partition table of upgrading is stored into the predetermined server, upgrading Pack and make module and associate the terminal iidentification of terminal for needing to upgrade with the AKU so that in terminal staging, acquisition module 10 can get AKU corresponding to its place terminal by terminal iidentification, i.e., the AKU that acquisition module 10 is sent obtains please The terminal iidentification of terminal where it is carried in asking, for accordingly finding liter corresponding to terminal for foregoing default upgrade server Level is wrapped and returned.Wherein, terminal iidentification is used for unique mark terminal, in the specific implementation, the IMEI of terminal can be selected to be used as Its terminal iidentification.
Alternatively, foregoing predetermined server (can also be built-in with the subregion of upgrading detecting the AKU that newly stores The AKU of table) when, the prompt message of upgrading is sent to corresponding terminal, by terminal display to user, to prompt user to download AKU carries out system upgrade.
Further, based on foregoing first or second embodiments, the 3rd embodiment of terminal staging device of the present invention is proposed, Corresponding to the 3rd embodiment of aforementioned terminals upgrade method, in the present embodiment, the terminal staging device also includes removing mould Block, for deleting the default flag bit in the MISC subregions and the AKU of acquisition.
Based on described above, it will be appreciated by persons skilled in the art that terminal staging device passes through in escalation process It whether there is foregoing default flag bit in MISC subregions, whether completing upgrading to the partition table of terminal judges.If complete After secondary updating operation (adjustment for including the system upgrade of terminal and user data area capacity), do not remove when time updating operation The default flag bit write in MISC subregions, when upgrading next time, the capacity for causing user data subregion can not be adjusted.Cause This, the present embodiment is on the basis of previous embodiment, after the updating operation of terminal is completed, adds the MISC for deleting terminal The operation of the default flag bit added in subregion, specific module of removing are completed.
Further, since external memory space has the physical store upper limit, when capacity is full, it is impossible to normal to provide storage clothes Business, also just it is not used to store AKU.Therefore, in the present embodiment, after the updating operation of terminal is completed, external storage is empty Between the AKU of middle storage obviously do not continue necessity of storage, removing module can also directly delete in external memory space and stores When the AKU acquired in time updating operation, to avoid the waste of capacity of external memory space.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of terminal staging method, it is characterised in that the terminal staging method includes:
Step A, AKU corresponding to terminal is obtained, and restarts the terminal;
Step B, system upgrade is carried out to the terminal using the AKU;
Step C, identify in the MISC subregions of the terminal with the presence or absence of default flag bit, be otherwise transferred to and perform step D, be to turn Enter step E;
Step D, the current bay table of the terminal is replaced with to the partition table carried in the AKU, to the MISC subregions The middle write-in default flag bit, and it is transferred to execution step B after restarting the terminal;
Step E, the capacity adjustment code carried in the AKU is performed, the capacity of the user data subregion of the terminal is adjusted The capacity of user data subregion in the whole partition table for after replacement.
2. terminal staging method according to claim 1, it is characterised in that AKU bag corresponding to the acquisition terminal Include:
Send AKU and obtain request to default upgrade server;
Receive the AKU that the default upgrade server obtains the correspondence terminal that request returns based on the AKU.
3. terminal staging method according to claim 2, it is characterised in that it is described to obtain AKU corresponding to terminal, And before the step of restarting the terminal, in addition to:
AKU is generated according to current updated contents, and the partition table of upgrading is built into the AKU;
The AKU for the partition table for being built-in with upgrading is stored into the predetermined server.
4. terminal staging method according to claim 3, it is characterised in that the liter of the partition table that upgrading will be built-in with Before level bag storage to the step in the predetermined server, in addition to:
The form of the AKU for the partition table for being built-in with upgrading is converted into the recognizable form of the predetermined server;
After format conversion operation is completed, it is transferred to the execution AKU by the partition table for being built-in with upgrading and stores to described Step in predetermined server.
5. according to the terminal staging method described in claim any one of 1-4, it is characterised in that the user by the terminal The capacity of data partition was adjusted to after the step of capacity of user data subregion in the partition table after replacing, in addition to:
Delete the default flag bit in the MISC subregions and the AKU of acquisition.
6. a kind of terminal staging device, it is characterised in that the terminal staging device includes:
Acquisition module, for obtaining AKU corresponding to terminal, and restart the terminal;
Upgraded module, for carrying out system upgrade to the terminal using the AKU;
Identification module, with the presence or absence of default flag bit in the MISC subregions for identifying the terminal;
Replacement module, during for the default flag bit to be not present in the MISC subregions, by the current bay of the terminal Table replaces with the partition table carried in the AKU, the default flag bit is write into the MISC subregions, and restart institute State terminal;
The upgraded module is additionally operable to after the replacement module restarts the terminal, reuses the AKU to the end End carries out system upgrade;
The identification module is additionally operable to reuse the AKU to terminal progress system upgrade in the upgraded module Afterwards, identify and whether there is the default flag bit in the MISC subregions;
Adjusting module, during for the default flag bit be present in the MISC subregions, perform what is carried in the AKU Capacity adjusts code, and the capacity of the user data subregion of the terminal is adjusted into user data subregion in the partition table after replacing Capacity.
7. terminal staging device according to claim 6, it is characterised in that the acquisition module is additionally operable to send AKU Request is obtained to default upgrade server;It is additionally operable to receive the default upgrade server to be based on the AKU and obtain request returning The AKU for the correspondence terminal returned.
8. terminal staging device according to claim 7, it is characterised in that the terminal staging device also includes AKU Module is made, for generating AKU according to current updated contents, and the partition table of upgrading is built into the AKU; It is additionally operable to store the AKU for being built-in with the partition table of upgrading into the predetermined server.
9. terminal staging device according to claim 8, it is characterised in that the AKU making module is additionally operable to will be interior The form for being equipped with the AKU of the partition table of upgrading is converted to the recognizable form of the predetermined server;It is additionally operable to complete lattice After formula conversion operation, the AKU for the partition table for being built-in with upgrading is stored into the predetermined server.
10. according to the terminal staging device described in claim any one of 6-9, it is characterised in that the terminal staging device is also Including removing module, for deleting the default flag bit in the MISC subregions and the AKU of acquisition.
CN201610578920.0A 2016-07-21 2016-07-21 Terminal staging method and device Pending CN107643898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610578920.0A CN107643898A (en) 2016-07-21 2016-07-21 Terminal staging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610578920.0A CN107643898A (en) 2016-07-21 2016-07-21 Terminal staging method and device

Publications (1)

Publication Number Publication Date
CN107643898A true CN107643898A (en) 2018-01-30

Family

ID=61109096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610578920.0A Pending CN107643898A (en) 2016-07-21 2016-07-21 Terminal staging method and device

Country Status (1)

Country Link
CN (1) CN107643898A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109358864A (en) * 2018-12-13 2019-02-19 晶晨半导体(上海)股份有限公司 Method for upgrading system and device
CN109656603A (en) * 2019-01-15 2019-04-19 Oppo广东移动通信有限公司 Method for upgrading system, device, storage medium and electronic equipment
CN111338663A (en) * 2018-12-19 2020-06-26 成都鼎桥通信技术有限公司 System upgrading method, terminal and storage medium
WO2023000777A1 (en) * 2021-07-23 2023-01-26 荣耀终端有限公司 Method for performing restarting during upgrade process of recovery mode, and terminal
WO2023005370A1 (en) * 2021-07-30 2023-02-02 荣耀终端有限公司 Method for upgrading operating system, device, storage medium, and computer program product
CN111142906B (en) * 2019-12-25 2023-11-10 浙江大华技术股份有限公司 Method, device and equipment for iterating equipment firmware upgrading scheme
CN117687663A (en) * 2024-02-04 2024-03-12 湖北芯擎科技有限公司 OTA-based partition dynamic adjustment method, device, equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109358864A (en) * 2018-12-13 2019-02-19 晶晨半导体(上海)股份有限公司 Method for upgrading system and device
CN111338663A (en) * 2018-12-19 2020-06-26 成都鼎桥通信技术有限公司 System upgrading method, terminal and storage medium
CN111338663B (en) * 2018-12-19 2023-06-13 成都鼎桥通信技术有限公司 System upgrading method, terminal and storage medium
CN109656603A (en) * 2019-01-15 2019-04-19 Oppo广东移动通信有限公司 Method for upgrading system, device, storage medium and electronic equipment
CN111142906B (en) * 2019-12-25 2023-11-10 浙江大华技术股份有限公司 Method, device and equipment for iterating equipment firmware upgrading scheme
WO2023000777A1 (en) * 2021-07-23 2023-01-26 荣耀终端有限公司 Method for performing restarting during upgrade process of recovery mode, and terminal
WO2023005370A1 (en) * 2021-07-30 2023-02-02 荣耀终端有限公司 Method for upgrading operating system, device, storage medium, and computer program product
CN115686584A (en) * 2021-07-30 2023-02-03 荣耀终端有限公司 Operating system upgrading method, device, storage medium and computer program product
CN115686584B (en) * 2021-07-30 2023-11-17 荣耀终端有限公司 Operating system upgrading method, device, storage medium and computer program product
CN117687663A (en) * 2024-02-04 2024-03-12 湖北芯擎科技有限公司 OTA-based partition dynamic adjustment method, device, equipment and storage medium
CN117687663B (en) * 2024-02-04 2024-04-16 湖北芯擎科技有限公司 OTA-based partition dynamic adjustment method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107643898A (en) Terminal staging method and device
US8583907B2 (en) Electronic device having an alterable configuration and methods of manufacturing and configuring the same
CN101026848B (en) Mobile terminal and software update method
CN105573780B (en) A kind of mobile terminal operating system upgrade method and device based on container
CN109062598B (en) Safe OTA (over the air) upgrading method and system
EP1770512A2 (en) Method and system for updating software
KR101007739B1 (en) Method and system for providing fota service
CN101610499A (en) The upgrade method of wireless data card and system
CN108027741A (en) Document handling method, device, terminal and storage medium based on patch upgrading
CN110597542B (en) Software automatic OTA (over the air) upgrading method and device and electronic equipment
CN104918114B (en) A kind of operating system update method and device
CN106201613A (en) Preheating software is installed
CN113821235B (en) Operating system data updating method, device, storage medium and program product
CN105867962A (en) System upgrading method and device
CN112463191A (en) File updating method and device, equipment and storage medium
TW201621647A (en) Operating system updating method
CN105765533A (en) Method and apparatus for firmware virtualization
CN109002305B (en) Method and system for updating equipment program
CN112860291B (en) Firmware upgrading method and device
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN102073541B (en) Data access method and mobile terminal
CN102043640A (en) Flash system and program updating method thereof
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN114706608A (en) Method for upgrading firmware and electronic equipment
CN114880003A (en) System upgrading method of intelligent terminal, intelligent terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180130

WD01 Invention patent application deemed withdrawn after publication