Invention content
The present invention provides a kind of method for pushing and device of the OTA upgrade package of terminal device, to solve to lead in the prior art
The problem of cause OTA upgrading failures, user experience is poor.
In a first aspect, the present invention provides a kind of method for pushing of the OTA upgrade package of terminal device, including:
Obtain carry remount information;
If the remount information indicates the terminal device by carry, aerial according to acquisition downloads OTA servers
OTA upgrading package informatin, determine whether OTA upgrade package is difference packet;
If the OTA upgrade package is difference packet, stop pushing the OTA upgrade package to the terminal device.
Optionally, it further includes:
If the remount information indicates that by carry, the OTA is not pushed to the terminal device for the terminal device
Upgrade package;
If the remount information indicates the terminal device not by carry, and the OTA upgrade package is full packet, then to
The terminal device pushes the OTA upgrade package.
Optionally, carry remount information is obtained, is specifically included:
Start remount information acquisition services in init processes, read the remount letters in system system subregions
Breath;
The remount information is preserved into the attribute of the remount information acquisition services;Wherein, it is described
The permission of the user group of remount information acquisition services is root authority.
Optionally, it before starting remount information acquisition services, further includes:
Start attribute service in the init processes, the attribute service is used to start the remount acquisition of information
Service.
Optionally, package informatin is upgraded according to the aerial OTA for downloading OTA servers of acquisition, determine OTA upgrade package whether be
Before difference packet, further include:
If detecting, the network type of terminal device connection changes or reaches preset detection cycle, to
The OTA servers send upgrade package solicited message;The upgrade package solicited message includes:Current version information;
Receive the OTA upgrading package informatins that the OTA servers are sent.
Optionally, it after the terminal device pushes the OTA upgrade package, further includes:
Package informatin is upgraded according to the OTA, downloads the OTA upgrade package, and version liter is carried out according to the OTA upgrade package
Grade;The OTA upgrade package information includes the download path of the OTA upgrade package.
Second aspect, the present invention provide a kind of pusher of the OTA upgrade package of terminal device, including:
Acquisition module, for obtaining carry remount information;
Processing module, if the terminal device is indicated by carry for the remount information, according to the aerial of acquisition
The OTA upgrading package informatins of OTA servers are downloaded, determine whether OTA upgrade package is difference packet;
The processing module if it is difference packet to be additionally operable to the OTA upgrade package, stops pushing institute to the terminal device
State OTA upgrade package.
Optionally, the processing module, is additionally operable to:
If the remount information indicates that by carry, the OTA is not pushed to the terminal device for the terminal device
Upgrade package;
If the remount information indicates the terminal device not by carry, and the OTA upgrade package is full packet, then to
The terminal device pushes the OTA upgrade package.
Optionally, acquisition module is specifically used for:
Start remount information acquisition services in init processes, read the remount letters in system system subregions
Breath;
The remount information is preserved into the attribute of the remount information acquisition services;Wherein, it is described
The permission of the user group of remount information acquisition services is root authority.
Optionally, acquisition module is specifically used for:
Start attribute service in the init processes, the attribute service is used to start the remount acquisition of information
Service.
The method for pushing and device of the OTA upgrade package of terminal device provided by the invention, if the remount information obtained refers to
Show terminal device by carry, then package informatin is upgraded according to the aerial OTA for downloading OTA servers of acquisition, determine that OTA upgrade package is
No is difference packet;Further, if OTA upgrade package is difference packet, stop pushing OTA upgrade package to terminal device, avoid
After terminal device downloads upgrade package, occur upgrading failure in escalation process, while rested on after avoiding upgrading failure
The problem of recovery interfaces, user experience is poor.
Term " comprising " and " having " in description and claims of this specification and the attached drawing and they appoint
What is deformed, it is intended that covers non-exclusive include.Such as contain the process of series of steps or unit, method, system, production
The step of product or equipment are not limited to list or unit, but optionally further include the step of not listing or unit or
It optionally further includes for the intrinsic other steps of these processes, method, product or equipment or unit.
Noun according to the present invention is explained first:
The terminal device of meaning of the embodiment of the present invention can be the equipment such as terminal device, tablet computer.Terminal device is right
Before software systems are upgraded, corresponding OTA upgrade package is asked to server first and download the OTA upgrade package, upgraded in OTA
Upgrading is performed according to the selection of user after the completion of packet download.
It is downloaded the time of OTA upgrade package, and reduce development cost to save the storage resource of server and terminal device,
The OTA upgrade package is usually the differential file between two neighboring version.
It in current software upgrade process, need to carry out, system (system) subregion can be carried out under recovery patterns
Verification if that can record remount number in system subregions if terminal device is by carry (remount), sets so as to cause terminal
Standby system subregions change, and therefore, verification can be caused to fail, and upgrade so as to cause OTA and fail, and are lost since OTA upgrades
After losing, terminal device can rest on recovery interfaces, user can be allowed to be at a loss, be for a user it is fatal, seriously
Degree of recognition of the user to product function and reliability is influenced, meanwhile, automatic upgrade function is supported in OTA upgradings, that is, silent
Upgrading if current OTA upgrade package configuration is silent upgrading, once there is the situation of upgrading failure, can lead to silent liter
Grade disabler, user experience are poor.
The method for pushing of the OTA upgrade package of the terminal device of the embodiment of the present invention, it is intended to solve above-mentioned due to terminal device
By OTA upgradings failure, the problem of user experience is poor caused by carry.
Fig. 1 is the flow diagram of one embodiment of method for pushing of the OTA upgrade package of terminal device provided by the invention.Such as
Shown in Fig. 1, method provided in this embodiment, including:
Step 101 obtains carry remount information;
If step 102, remount information instruction terminal equipment, by carry, aerial according to acquisition downloads OTA servers
OTA upgrading package informatin, determine whether OTA upgrade package is difference packet;
If step 103, OTA upgrade package are difference packets, stop pushing OTA upgrade package to terminal device.
Specifically, before upgrading to version, it is thus necessary to determine that whether the terminal device obtains by carry mistake
Whether remount information, the remount information are used to indicate terminal device by carry mistake.
Once terminal device then records remount number and the last time by remount in system subregions specific position
The time of remount, it is only necessary to obtain the value of the position, it is possible to obtain the remount information of present terminal equipment.
If remount information instruction terminal equipment upgrades package informatin by carry, according to the OTA of the OTA servers of acquisition,
Determine whether OTA upgrade package is difference packet.
I.e. before step 101 or after step 101, the OTA upgrading package informatins of OTA servers transmission can be obtained.
In some embodiments, if detecting, the network type of terminal device connection changes or reaches preset
Detection cycle then sends upgrade package solicited message to OTA servers;Upgrade package solicited message includes:Current version information;Example
The model of terminal device can also such as be included.
Receive the OTA upgrading package informatins that OTA servers are sent.
Wherein, OTA, which upgrades package informatin, can include the newest upgrade package letter that the terminal device can upgrade on OTA servers
It ceases and contains specific information to indicate that current upgrade package is full packet or difference packet.It can be in OTA upgrading package informatins
Including download path.
Wherein, the network type of terminal device connection changes for example:Wireless Fidelity (WIreless-Fidelity,
Abbreviation WIFI), 2G, 3G, when switching between 4G.
Reach preset detection cycle, such as 7 days are a detection cycle, which can be in OTA server ends
Configuration, is issued to terminal device.
As long as two above condition meets one of them, communication that will be between triggering terminal equipment and OTA servers,
Communication between the two is that terminal device is actively initiated to OTA servers.
If it is determined that OTA upgrade package is difference packet, then stops pushing OTA upgrade package to terminal device, i.e., do not set to terminal
Standby push OTA upgrade package.
In some embodiments, it further includes:
If remount information indicates that by carry, OTA upgrade package is not pushed to terminal device for the terminal device;
If remount information instruction terminals equipment is not by carry, and OTA upgrade package is full packet, then is pushed to terminal device
OTA upgrade package.
Specifically, as shown in Fig. 2, terminal device from OTA servers receive return OTA upgrade package informatin, parse
After the upgrade package of current OTA server configuration is full packet or difference packet, and judge the remount states of terminal device:
If by remount, the upgrade package is not pushed to terminal device for terminal device.
If terminal device is by remount, and upgrade package is full packet, then pushes the upgrade package to terminal device.
If terminal device is by remount, and upgrade package is difference packet, then does not push the upgrade package to terminal device.
After OTA upgrade package is pushed to terminal device, following operation can also be performed:
Package informatin is upgraded according to OTA, downloads OTA upgrade package, and edition upgrading is carried out according to OTA upgrade package;OTA upgrade package
Information includes the download path of OTA upgrade package.
What after pushing upgrade package, can further determine whether to be upgraded or in when according to the selection operation of user
Between or upgraded under specific network condition.
For example, under WIFI network, seldom carried out in user using the period (such as -5 point of 1:00 AM) of the terminal device
Upgrading.
" judging in advance " of OTA upgradings can be realized through the above scheme, after avoiding terminal device download upgrade package,
" the reporting an error afterwards " of upgrading failure is found in escalation process, while recovery interfaces are rested on after avoiding upgrading failure,
The problem of user experience is poor.
The method for pushing of the OTA upgrade package of the terminal device of the present embodiment, if the remount information instruction terminals obtained are set
It is standby by carry, then package informatin is upgraded according to the aerial OTA for downloading OTA servers of acquisition, determines whether OTA upgrade package is difference
Packet;Further, if OTA upgrade package is difference packet, stop pushing OTA upgrade package to terminal device, avoid terminal device
After downloading upgrade package, occur upgrading failure in escalation process, while recovery interfaces rested on after avoiding upgrading failure,
The problem of user experience is poor.
On the basis of above-described embodiment, optionally, step 101 can specifically be realized in the following way:
Start remount information acquisition services in init processes, read the remount letters in system system subregions
Breath;
The remount information is preserved into the attribute of the remount information acquisition services;Wherein, it is described
The permission of the user group of remount information acquisition services is root authority.
Wherein, init processes can be the initialization process of Android (Android) system.
Root authority is present in Android system, is the superuser right in system, is equivalent to a kind of Windows (behaviour
Make system) administrator (administrator) user right in system.Its with permission all in system, such as start or
Stop a process, delete or increase user, increase or disable hardware etc..
Since terminal device is by after remount, remount information can be recorded in system subregions specific position, normal
Under booting, the upgrading detection program of terminal device can get this before OTA upgrade package push is carried out by certain method
The value of specific position, so as to choose push scheme.Since the permission of system subregions is higher, upgrading detection program is no permission
Read operation is carried out to it, can be taken through creating a service in the rc files of init processes, the power of designated user's group
The mode for being limited to root authority gets the remount information of system subregions.
Wherein, rc files refer to the script file in Android system.
Optionally, it before starting remount information acquisition services, further includes:
Start attribute service in init processes, attribute service is used to start remount information acquisition services.
Specifically, a service defined in/init.rc, the user group permission of the service is root authority, which opens
An executable program is moved, starts attribute service in init processes, when the attribute in attribute service
The value of persist.sys.remount.info is set to 1, starts remount information acquisition services sys_remount_ext, should
Service execution executable program sys_remount_ext reads the remount information of system subregions in program, by remount
Information is saved in the attribute debug.sys.hmct.remount.status of the service.
The upgrading of terminal device detects program when carrying out upgrade package detection, and persist.sys.remount.info is put
Be 1, start above-mentioned service, meanwhile, the upgrade package for judging to be configured on current OTA server be difference packet or full packet and
The value of debug.sys.hmct.remount.status.
If it is determined that terminal device then performs download, upgrading flow not by remount mistakes;
If for terminal device not by remount mistakes, debug.sys.hmct.remount.status values are 0.
If terminal device is by remount, and the upgrade package being configured on server is full packet, then performs download, upgrading stream
Journey.
If terminal device, by remount, debug.sys.hmct.remount.status values are 1
If terminal device is by remount, and the upgrade package being configured on server is difference packet, then does not push and rise to user
Grade packet.
In above-mentioned specific embodiment, by starting remount information acquisition services in init processes, system is read
Remount information in system subregions;Because therefore the permission of the user group of service can be got for root authority
Remount information in system subregions.
Structure charts of the Fig. 3 for one embodiment of pusher of the OTA upgrade package of terminal device provided by the invention, such as Fig. 3
It is shown, the pusher of the OTA upgrade package of the terminal device of the present embodiment, including:
Acquisition module 301, for obtaining carry remount information;
Processing module 302, if the terminal device is indicated by carry for the remount information, according to acquisition
The aerial OTA upgrading package informatins for downloading OTA servers, determine whether OTA upgrade package is difference packet;
The processing module 302 if it is difference packet to be additionally operable to the OTA upgrade package, stops pushing away to the terminal device
Send the OTA upgrade package.
Optionally, the processing module 302, is additionally operable to:
If the remount information indicates that by carry, the OTA is not pushed to the terminal device for the terminal device
Upgrade package;
If the remount information indicates the terminal device not by carry, and the OTA upgrade package is full packet, then to
The terminal device pushes the OTA upgrade package.
Optionally, acquisition module 301 are specifically used for:
Start remount information acquisition services in init processes, read the remount letters in system system subregions
Breath;
The remount information is preserved into the attribute of the remount information acquisition services;Wherein, it is described
The permission of the user group of remount information acquisition services is root authority.
Optionally, acquisition module 301 are specifically used for:
Start attribute service in the init processes, the attribute service is used to start the remount acquisition of information
Service.
Optionally, it further includes:
Sending module, if the network type for detecting the terminal device connection for the processing module changes,
Or reach preset detection cycle, then send upgrade package solicited message to the OTA servers;The upgrade package request packet
It includes:Current version information;
Receiving module upgrades package informatin for receiving the OTA that the OTA servers are sent.
Optionally, the processing module 302, is additionally operable to:
Package informatin is upgraded according to the OTA, downloads the OTA upgrade package, and version liter is carried out according to the OTA upgrade package
Grade;The OTA upgrade package information includes the download path of the OTA upgrade package.
The device of the present embodiment can be used for performing the technical solution of above method embodiment, realization principle and technology
Effect is similar, and details are not described herein again.
Fig. 4 is the structure chart of one embodiment of terminal device provided by the invention, as shown in figure 4, the terminal device includes:
Processor 401 and, for storing the memory 402 of the executable instruction of processor 401.
Wherein, processor 401 is configured to perform via the executable instruction is performed corresponding in preceding method embodiment
Method, specific implementation process may refer to preceding method embodiment, and details are not described herein again.
Optionally, the terminal device of the embodiment of the present invention can also include power supply module, multimedia component and communication set
Part.
Optionally, memory 402 is configured as storing various types of data to support processor 401 in terminal device
Operation.The example of these data includes the instruction of any application program or method for operating on the terminal device, contact person
Data, telephone book data, message, picture, video etc..Memory 402 by any kind of volatibility or non-volatile can be deposited
It stores up equipment or combination thereof is realized, such as static RAM (SRAM), electrically erasable programmable read-only memory
(EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only memory
(ROM), magnetic memory, flash memory, disk or CD.
Power supply module provides electric power for the various assemblies of terminal device.Power supply module can include power-supply management system, one
A or multiple power supplys and other generate, manage and distribute electric power associated component with for terminal device.
Optionally, multimedia component is included in the screen of one output interface of offer between terminal device and user.
In some embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel,
Screen may be implemented as touch screen, to receive input signal from the user.Touch panel can also include one or more
Touch sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or
The boundary of sliding action, but also detect duration and pressure associated with the touch or slide operation.In some implementations
In example, multimedia component can also include a front camera and/or rear camera.When terminal device is in operation mould
Formula, during such as screening-mode or video mode, front camera and/or rear camera can receive external multi-medium data.
Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom energy
Power.
Optionally, communication component be configured to facilitate between terminal device and other equipment by wired or wireless way into
Row communication.
A kind of computer readable storage medium in the embodiment of the present invention is also provided, is stored thereon with computer program, it is described
Corresponding method in preceding method embodiment is realized when computer program is executed by processor, specific implementation process may refer to
Preceding method embodiment, implementing principle and technical effect are similar, and details are not described herein again.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice invention disclosed herein
Its embodiment.The present invention is directed to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Person's adaptive change follows the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.Description and embodiments are considered only as illustratively, and the true scope and spirit of the disclosure are by following
Claims are pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claims
System.