CN112416406B - Terminal equipment upgrading method, device, terminal equipment and medium - Google Patents

Terminal equipment upgrading method, device, terminal equipment and medium Download PDF

Info

Publication number
CN112416406B
CN112416406B CN202011376388.7A CN202011376388A CN112416406B CN 112416406 B CN112416406 B CN 112416406B CN 202011376388 A CN202011376388 A CN 202011376388A CN 112416406 B CN112416406 B CN 112416406B
Authority
CN
China
Prior art keywords
version
upgrade
operating system
packet
upgrading
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.)
Active
Application number
CN202011376388.7A
Other languages
Chinese (zh)
Other versions
CN112416406A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011376388.7A priority Critical patent/CN112416406B/en
Publication of CN112416406A publication Critical patent/CN112416406A/en
Application granted granted Critical
Publication of CN112416406B publication Critical patent/CN112416406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a terminal equipment upgrading method, a terminal equipment upgrading device, a terminal equipment, a computer equipment and a storage medium. The method in one embodiment comprises: in a state of running a first operating system, using a basic installation package of a stored system basic version to restore the system version of a second operating system which is not currently in a running state to the system basic version; and upgrading the second operating system restored to the system basic version by using a system upgrading delta package, and upgrading the second operating system to the system latest version, wherein the system upgrading delta package is a delta package between the basic installation package and the installation package of the system latest version. The method can reduce the maintenance cost of the differential packet, realize silence upgrading and has high disaster tolerance.

Description

Terminal equipment upgrading method, device, terminal equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a terminal device upgrading method, a terminal device upgrading apparatus, a terminal device, a computer device, and a storage medium.
Background
With the development of computer technology, in the use process of terminal equipment, a situation that a system used by the terminal equipment needs to be upgraded is involved. In the conventional upgrade scheme of the terminal device, after the terminal device is started, the local version of the terminal device is compared with the latest version of the server to confirm whether the terminal device needs to be upgraded by communicating with the server. If the upgrade is needed, the upgrade package is downloaded from the server for upgrade. In the conventional upgrade technique, when a terminal device downloads an upgrade package from a server, the server usually searches for a difference package between an old version of a system installed on the terminal device and a new version of a new system of the server based on the old version of the system installed on the terminal device, and sends the difference package to the terminal device for updating. However, different terminal devices are updated frequently, and some may be updated after the server issues a plurality of different new versions, so that the system versions of the different terminal devices are different, so that the server needs to maintain a delta packet between the different versions, and the maintenance cost of the delta packet is high.
Disclosure of Invention
Based on this, it is necessary to provide a terminal device upgrading method, apparatus, terminal device, computer device and storage medium in order to solve the above technical problems.
A method for upgrading a terminal device, the method comprising:
in a state of running a first operating system, using a basic installation package of a stored system basic version to restore the system version of a second operating system which is not currently in a running state to the system basic version;
and upgrading the second operating system restored to the system basic version by using a system upgrading delta package, and upgrading the second operating system to the system latest version, wherein the system upgrading delta package is a delta package between the basic installation package and the installation package of the system latest version.
In one embodiment, before using the basic installation package of the stored system basic version to restore the system version of the second operating system that is not currently in a running state to the system basic version, the method further includes the steps of:
and acquiring a system upgrade differential packet, and storing the system upgrade differential packet into a differential packet storage area.
In one embodiment, the upgrade script is a shell script.
In one embodiment, after the system upgrade delta package is acquired and before the system upgrade delta package is stored in the delta package storage area, the method further comprises:
and carrying out validity check on the obtained system upgrading difference quantity packet.
A method for upgrading a terminal device, the method comprising:
detecting a differential packet issuing triggering condition;
when the triggering condition of the differential packet issuing is met, acquiring a system upgrading differential packet, wherein the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and sending the system upgrade delta packet to the terminal equipment.
In one embodiment, when a system upgrade request sent by the terminal device is received, it is determined that a delta packet issuing trigger condition is satisfied.
In one embodiment, when it is determined that a new system version is released and a corresponding system upgrade delta packet is generated, it is determined that a delta packet release trigger condition is satisfied.
In one embodiment, the method further comprises the steps of: and using the generated system upgrade delta packet to cover the stored system upgrade delta packet.
A terminal equipment upgrade apparatus, the apparatus comprising:
the version recovery module is used for recovering the system version of the second operating system which is not currently in the running state to the system basic version by using the stored basic installation package of the system basic version in the running state of the first operating system;
And the upgrade module is used for upgrading the second operating system restored to the system basic version by using a system upgrade delta package, and upgrading the second operating system to the system latest version, wherein the system upgrade delta package is a delta package between the basic installation package and the installation package of the system latest version.
A terminal equipment upgrade apparatus, the apparatus comprising:
the winding part detection module is used for detecting a differential quantity package issuing triggering condition;
the system comprises a differential packet acquisition module, a system upgrading differential packet generation module and a system updating module, wherein the differential packet acquisition module is used for acquiring a system upgrading differential packet when a differential packet issuing triggering condition is met, and the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and the sending module is used for sending the system upgrade delta packet to the terminal equipment.
A terminal device, the terminal device comprising: the system comprises a processor, a first operating system storage area for storing a first operating system, a second operating system storage area for storing a second operating system, a differential packet storage area for storing a system upgrade differential packet, and a basic packet storage area for storing an installation packet of a basic version of the system, wherein the system upgrade differential packet is a differential packet between an installation packet of the latest version of the system and an installation packet of the basic version of the system;
And the processor uses the basic installation package to restore the system version of the second operating system to the system basic version in the state of running the first operating system, uses the system upgrading delta package to upgrade the second operating system restored to the system basic version to the latest system version.
In one embodiment, the upgrade script is a shell script.
In one embodiment, the processor executes a pre-upgrade script, decompresses the system upgrade delta package through the pre-upgrade script, and invokes an upgrade script in the system upgrade delta package to upgrade, and upgrades the second operating system from the system base version to the system latest version.
In one embodiment, after the processor upgrades the second operating system to the latest version of the system, the device is modified to start the system parameters or to modify the flag bit of the predetermined disk location, so that the second operating system operates at the next boot.
In one embodiment, when the processor operates in the second operating system at the next power-on, if a system rollback instruction is received, modifying a device starting system parameter or modifying a flag bit of a predetermined disk position according to the system rollback instruction, so that the processor operates in the first operating system at the next power-on, and deleting the stored system upgrade delta packet according to the system rollback instruction.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
detecting a differential packet issuing triggering condition;
when the triggering condition of the differential packet issuing is met, acquiring a system upgrading differential packet, wherein the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and sending the system upgrade delta packet to the terminal equipment.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the embodiments described above.
According to the terminal upgrading method, the terminal device computer device and the storage medium, when the terminal needs to be upgraded, the server provides the system upgrading delta packet between the latest system version and the basic system version for the terminal, when the terminal device upgrades, the terminal device is aimed at the second operating system which is not in the running state at present, and the terminal device is firstly restored to the basic system version and then is upgraded to the latest system version by using the system upgrading delta packet, so that no matter what version the terminal device is currently, the terminal device can be upgraded to the latest system version by using the system upgrading delta packet, the server also only needs to maintain the system upgrading delta packet between the latest system version and the basic system version, the maintenance cost of the delta packet is low, the running use of the first operating system which runs at present is not affected in the upgrading process of the terminal device, and the silent upgrading is realized.
Drawings
FIG. 1 is an application environment diagram of a terminal device upgrade method in one embodiment;
fig. 2 is a flow chart of a method for upgrading a terminal device in one embodiment;
fig. 3 is a flow chart of a method for upgrading a terminal device according to another embodiment;
FIG. 4 is a schematic diagram of an interaction flow during an upgrade of a terminal device in one embodiment;
FIG. 5 is a flow chart comparing a terminal device upgrade method and a conventional method according to an embodiment;
FIG. 6 is a block diagram of an apparatus for upgrading a terminal device according to an embodiment;
FIG. 7 is a block diagram showing an upgrade apparatus of a terminal device according to another embodiment;
FIG. 8 is a schematic diagram of a memory partition of a terminal device in one embodiment;
FIG. 9 is a diagram illustrating a comparison of memory partitioning of a terminal device and a legacy terminal device, according to one embodiment;
fig. 10 is a schematic diagram of an internal structure of a terminal device according to an embodiment;
FIG. 11 is a schematic diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The terminal equipment upgrading method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal device 102 communicates with the server 104 via a network. When the terminal device 102 leaves the factory, an operating system is installed, so that the terminal device 102 can run the operating system to realize relevant functions of the terminal device. The operating system running in the terminal device 102 may need to be updated based on various requirements such as development and function update, and the server 104 determines a system upgrade delta packet between the two versions based on a latest system version of the operating system and a system base version of the operating system, and sends the system upgrade delta packet to the terminal device 102, so that the terminal device 102 updates its operating system based on the system upgrade delta packet. The terminal device 102 stores two operating systems, one of which is running and the other is acting as a backup. After receiving the system upgrade delta packet, the terminal device 102 upgrades the operating system which is not in the running state, so that the running of the terminal device 102 is not affected. The terminal 102 may be any possible terminal device, and in some embodiments of the present application, the terminal 102 may be a dedicated device such as a vehicle. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a terminal device upgrading method is provided, and an example of application of the method to the terminal device 102 in fig. 1 is described, including the following steps S201 and S202.
Step S201: and in a state of running the first operating system, using the basic installation package of the stored system basic version to restore the system version of the second operating system which is not currently in a running state to the system basic version.
The terminal equipment stores two operating systems, and when one operating system runs, the other operating system is used as a backup. The first operating system refers to an operating system which is currently running by the terminal equipment, and the second operating system refers to an operating system which is not running by the terminal equipment and is in a backup state. The system basic version refers to the earliest released system version of the operating system, and is usually installed on the terminal equipment when the terminal equipment leaves the factory.
The basic installation package is an installation package of a system basic version, and refers to an installation package corresponding to a system version which is released earliest by the operating system, and generally refers to an installation package of an operating system installed on the terminal equipment when the terminal equipment leaves a factory. When the terminal equipment leaves the factory, besides the basic system version is installed, an installation package of the basic system version is stored on the terminal equipment, so that the terminal equipment can restore the factory setting based on the basic installation package, and the upgrading operation of the terminal equipment can be executed based on the basic installation package.
In some embodiments, before restoring the system version of the second operating system that is not currently in the running state to the system base version using the stored base installation package of the system base version, the method further includes the steps of:
and acquiring a system upgrade differential packet, and storing the system upgrade differential packet into a differential packet storage area.
Thus, the upgrade process can be performed after the system upgrade delta package is determined and obtained and stored in the delta package storage area.
When the terminal device detects that the system upgrade differential packet exists in the mobile storage device, the terminal device acquires the system upgrade differential packet from the mobile storage device. The embodiment of the application does not specifically limit the mode of acquiring the system upgrade delta packet by the terminal equipment. In the following related embodiments, a system upgrade delta package obtained from a server will be described as an example.
After the system upgrading differential packet is acquired, the acquired system upgrading differential packet can be subjected to validity check, and after the validity check is passed, the system upgrading differential packet is stored in a differential packet storage area. To ensure that the obtained and stored system upgrade delta package is a legal delta package. The validity check may specifically include various possible check manners, for example, checking the integrity of the system upgrade delta packet, checking that the system upgrade delta packet is sent by a legal server, and so on. The specific verification method may be any possible verification method, for example, when the integrity of the system upgrade delta packet is verified, the server may calculate the generated system upgrade delta packet to obtain a verification code, and carry the verification code in the system upgrade delta packet. When the terminal equipment receives the system upgrading differential packet, the check code is calculated in the same mode by the received system upgrading differential packet, and is compared with the check code carried by the system upgrading differential packet, and if the comparison is consistent, the check code is considered to be complete. And when the validity of the server is checked, a certificate can be issued for the server by a third party, and the validity is checked by the certificate carried in the system upgrading delta packet sent by the server. It will be appreciated that in other embodiments, other ways of verifying, and other content requiring verification, may be used.
When the validity check fails, the system upgrade difference packet can be obtained again from the server, and the specific re-obtaining time is not limited. In addition, in the process of downloading the system upgrade delta packet from the server, if the terminal equipment is powered off or restarted, the system upgrade delta packet is not downloaded completely, so that after the terminal equipment is started, the system upgrade delta packet can be downloaded again or continuously, and particularly can be downloaded in a breakpoint continuous mode. The breakpoint continuous transmission refers to dividing a downloading task into a plurality of parts during downloading, and each part adopts a thread to upload or download. If a fault is encountered, the part which is not finished can be continuously uploaded and downloaded from the part which is already uploaded or downloaded, and the part which is not finished is not needed to be uploaded and downloaded from the beginning, so that time is saved and the speed is improved.
When the system version of the second operating system which is not currently in a running state is restored to the system basic version by using the basic installation package of the stored system basic version, any possible manner may be used, for example, a manner of restoring the second operating system to a factory setting is adopted to restore the system basic version.
Step S202: and upgrading the second operating system restored to the system basic version by using a system upgrading delta package, and upgrading the second operating system to the system latest version, wherein the system upgrading delta package is a delta package between the basic installation package and the installation package of the system latest version.
The latest version of the system refers to the latest version of the system that a developer develops for the operating system, typically adding new functionality to the original version of the system, and/or optimizing relevant performance, etc.
In one embodiment, using the system upgrade delta package to upgrade the second operating system restored to the system base version, and upgrade the second operating system to the system latest version, the method may include the steps of:
and executing a pre-upgrading script, decompressing the system upgrading delta packet through the pre-upgrading script, calling the upgrading script in the system upgrading delta packet to upgrade, and upgrading the second operating system from the system basic version to the system latest version.
The pre-upgrading script is also called as a pre-upgrading script in the embodiment of the application, so that the pre-upgrading script is executed before the upgrading script in the system upgrading delta packet is called, the upgrading script in the upgrading packet is decompressed through the pre-upgrading script, and the upgrading script in the upgrading packet is called for upgrading, so that the upgrading script is classified, and the system upgrading script is flexible and convenient.
In one embodiment, after upgrading the second operating system to the latest version of the system, the method further includes: and modifying the equipment starting system parameters so that the second operating system operates when the equipment is started next time. Therefore, after the second operating system is updated to the latest version of the system, the device starting system parameters also need to be modified, so that the terminal device can run on the second operating system updated to the latest version of the system when the terminal device is started next time. If the equipment starting system parameters are not modified, the terminal equipment still operates in the first operating system when being started next time.
In some embodiments, after upgrading the second operating system to the latest version of the system, further comprising: and writing a flag bit in a preset disk position, so that the second operating system operates when the flag bit is read in the preset disk position when the computer is started next time. Therefore, after the second operating system is upgraded to the latest version of the system, a flag bit can be written in a preset disk position, and the flag bit is used for identifying that the second operating system is upgraded to the new version, so that the second operating system upgraded to the latest version of the system can be operated when the system is started next time. If the flag bit is not written in the preset disk position, the terminal equipment still operates in the first operating system when the terminal equipment is started next time. The predetermined disk location may be any possible disk location, as long as it is accessed before a specific operating system is executed during the start-up process of the terminal device.
It will be appreciated that in other embodiments, the marking may be performed in the terminal device in other manners, and the terminal device may read information of the marking when turned on, so as to instruct the terminal device to operate in the second operating system through the marking. In the following related embodiments, modification of the device start-up system parameters is described as an example. In the case of other markers, the processing can be performed in a similar manner.
In some embodiments, when the device start system parameter is modified or the flag bit of the predetermined disk position is modified, the terminal device runs on the second operating system updated to the latest version of the system when starting next time, if a system rollback instruction is received, the device start system parameter is modified or the flag bit of the predetermined disk position is modified according to the system rollback instruction, so that the terminal device runs on the first operating system when starting next time, and the stored system upgrade delta packet is deleted according to the system rollback instruction. Therefore, when the latest released system version has a problem and needs to be recalled, the system version can be conveniently backed back to an earlier version and can be backed back remotely by receiving a system back instruction of the server and modifying the equipment starting parameters to directly run on the first operating system when the system is started next time.
After the device starting system parameters are modified or the flag bit of the preset disk position is modified according to the system rollback instruction, when the device is started to run on the first operating system next time, for the second operating system which is updated, the system version of the second operating system which is not in a running state at the moment can be restored to the system basic version based on a basic installation package of the stored system basic version.
In some embodiments, after the device startup system parameter is modified or the flag bit of the predetermined disk location is modified according to the system rollback instruction, when the device is started up and runs on the first operating system next time, the updated second operating system may not be processed, but after the latest released system version test passes or after the updated system version is reissued, in the manner in the embodiment described above, the system version of the second operating system is updated to the updated system version after the system version test passes or after the released updated system version is reissued based on the latest system upgrade delta packet corresponding to the system base version after the test passes or the updated system version corresponds to the system base version. As described above, when the embodiment of the application updates, the system upgrade delta packet is restored to the basic version and then updated to the latest version, so that the normal use of the equipment is not affected in the upgrade process, the possible influence of directly updating on the basis of the system version with the problem is avoided, and the processing mode is convenient and simple.
In one embodiment, the system types of the first operating system and the second operating system are the same, and when the terminal device is started up next time and is running in the second operating system updated to the latest version of the system, the first operating system which is not in a running state may be updated without using the system update delta packet. Therefore, under the condition that the system types of the first operating system and the second operating system are the same, when the terminal equipment is started up next time and runs on the second operating system, the first operating system is in a backup state, and the second operating system is updated, so that the first operating system can be updated without the system upgrading difference packet, and the first operating system can be quickly backed up to the first operating system of an earlier version without backing up to a system basic version when the latest version of the system has a problem.
In one embodiment, the system upgrade delta packet may be deleted after the upgrade process modifies the device start system parameters or modifies the flag bit of the predetermined disk location. Therefore, when the terminal equipment is started up next time and is operated to upgrade to the second operating system of the latest version of the system, the first operating system which is in a backup state is not updated because the stored system upgrade delta packet does not exist, and the operated second operating system is the latest version of the system. So that when a problem occurs with the latest version of the system, it is possible to quickly rollback to the earlier version of the first operating system.
It should be understood that, when the terminal device is running in the process of upgrading to the second operating system of the latest version of the system, if the server issues an updated system version again, for example, the latest version of the system of the second operating system is V3.0, and the server issues an updated system version V4.0 again, the server issues an updated system upgrade delta packet between the installation packet of the updated system version V4.0 and the basic installation packet, at this time, the first operating system in the backup state may be updated by using the updated system upgrade delta packet and adopting the method of the embodiment of the present application as described above. At this time, the first operating system in the backup state is actually equivalent to the second operating system that has not been upgraded in the above embodiment.
In one embodiment, as shown in fig. 3, a terminal device upgrading method is provided, and an example of application of the method to the server 104 in fig. 1 is described, including the following steps S301 and S302.
Step S301: detecting the triggering condition of the differential packet.
The differential packet issues a trigger condition, which is a condition that triggers the server to send the system upgrade differential packet to the terminal device. Based on different actual technical requirements, different differential packet issuing triggering conditions can be set.
In some embodiments, the server may determine that the delta packet issuing triggering condition is satisfied when receiving a system upgrade request sent by the terminal device.
When knowing that the server issues a new system version, the terminal device can send a system upgrading request to the server when determining that the version of the terminal device is lower than the latest version of the system. Therefore, when the server receives the system upgrading request of the terminal equipment, the server can determine the triggering condition of the differential packet issuing and can directly enter the subsequent steps. For example, the terminal device may periodically send a latest version query request to the server to learn the latest version of the system of the server. The server may actively send information of the latest version of the system to the terminal device when a new system version is released. After obtaining the information of the latest version of the system of the server, the terminal device can compare the latest version with the version of the terminal device to confirm whether a system upgrading request needs to be sent to the server.
In another implementation, the terminal device may periodically send a system upgrade request to the server, and the system upgrade request carries current system version information of the terminal device. And the server compares the system version information with the information of the latest version of the system, if the system version information is inconsistent with the information of the latest version of the system, the terminal equipment is considered to need to be updated, and the condition that the differential packet issuing triggering condition is met is confirmed to be met, so that the subsequent processing process is entered. When the system versions of the first operating system and the second operating system stored in the terminal device are different, the current system version information of the terminal device can be the system version information with higher version. For example, if the system version information of the first operating system is V2.3 and the system version information of the second operating system is V2.0, and the higher the number is, the newer the version is, the more current system version information of the terminal device should be V2.3.
In some embodiments, when a new system version is released and when it is determined in the recorded related information that the system upgrade delta packet is not sent to the terminal device, the delta packet release triggering condition may be considered to be satisfied, so as to actively send the system upgrade delta packet of the latest version of the system to the terminal device.
Step S302: and when the differential packet issuing triggering condition is met, acquiring a system upgrading differential packet, wherein the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version.
The system basic version refers to the earliest released system version of the operating system, and is usually installed on the terminal equipment when the terminal equipment leaves the factory. The basic installation package is an installation package of a system basic version, and refers to an installation package corresponding to a system version which is released earliest by the operating system, and generally refers to an installation package of the operating system installed on the terminal equipment when the terminal equipment leaves the factory. When the terminal equipment leaves the factory, besides the basic system version is installed, an installation package of the basic system version is stored on the terminal equipment, so that the terminal equipment can restore the factory setting based on the basic installation package, and the upgrading operation of the terminal equipment can be executed based on the basic installation package.
The latest version of the system refers to the latest version of the system that a developer develops for the operating system, typically adding new functionality to the original version of the system, and/or optimizing relevant performance, etc.
Before the system upgrade delta packet is acquired, the system upgrade delta packet needs to be generated and stored, and in one embodiment, the system upgrade delta packet may be generated in the following manner in steps S3021 to S3024.
Step S3021: and generating an original delta package based on the installation package of the latest version of the system and the basic installation package.
When generating the original difference package based on the installation package of the latest version of the system and the basic installation package, any difference between the installation package of the latest version of the system and the basic installation package can be used, and the difference upgrading package of the installation package of the latest version of the system and the basic installation package can be obtained. Taking an operating system as an example and an Android system as an example, when a basic installation package is generated, a make otaplapackage tool of the Android system can be used for obtaining all system installation packages. When the system or the application needs to be updated due to modification, a make otaplapackage tool can be used to obtain a new system installation package, namely an installation package of the latest version of the system. Then, a ta_from_target_files tool of the Android system can be used to obtain a difference packet between the ta_from_target_files and the difference packet, which is called an original difference packet in the embodiment of the present application. The basic installation package is marked as base. Zip, the installation package of the latest version of the system is marked as target. Zip, and the original delta package obtained by using the ta_from_target_files tool can be marked as update_src_ota.
Step S3022: decompressing the original delta packet to obtain an original upgrade script in the original delta packet.
The obtained complete original delta package can be decompressed, so that the content contained in the decompressed package, such as an original upgrade script, is obtained. It will be appreciated that after the original delta package is decompressed, the obtained delta package may contain other content, such as a system catalog, in addition to the original upgrade script.
Step S3023: and rewriting grammar in the original upgrade script into a shell script to obtain a rewritten upgrade script.
Taking the system type of the operating system as an Android system as an example, it can be found that in the generated original upgrade script, the grammar of the original upgrade script is similar to that of the shell script, and the shell script can be applied to various different systems, such as a Linux system, an Android system, a QNX system and the like, so that the original upgrade script is rewritten into the shell script, and the original upgrade script can be applied to the operating systems of various system types, thereby improving the universality and the cross-platform applicability.
Specifically, when the writing is performed, the writing may be performed in combination with the syntax structures of the original upgrade script and the shell script, for example:
for a command of deleting a file/data/init.log, the grammar content in the original script file is: delete ("/data/init. Log"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: rm-f/data/init. Log
Aiming at a command for deleting a folder/data/dalvik-cache, the grammar content in the original script file is as follows: delete_recovery ("/data-cache"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: rm-rf/data/dalvik-cache.
For the command of the my.zip file to/system in the decompressed ROM package, the grammar content in the original script file is as follows: package_extract_file ("my.zip", "/system"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: tar-zxvf my.
It will be appreciated that other commands may be rewritten in a similar manner, and are not intended to be exhaustive in the present embodiments.
Step S3024: and repackaging based on the rewritten upgrade script to generate the system upgrade delta packet.
After obtaining the rewritten upgrade script, the upgrade script can be repackaged based on the rewritten upgrade script to generate a final system upgrade delta package. When repacking, the repacking method includes the step of including the rewritten upgrade script and other decompressed contents which are not processed after the decompression.
After the system upgrade delta packet is generated, the new system upgrade delta packet can be further used to cover the stored system upgrade delta packet, namely, the server side is ensured to only store the delta packet between the latest system version and the system basic version, so that the maintenance cost of the server is reduced. In some embodiments, the newly generated system upgrade delta packet may be stored first, then the previously stored system upgrade delta packet is still kept for a period of time, and then the newly generated system upgrade delta packet is deleted after the new system is stable.
Step S303: and sending the system upgrade delta packet to the terminal equipment.
When the system upgrade delta packet is sent to the terminal equipment, the system upgrade delta packet can be sent based on a communication mode between a server and the terminal equipment, and can be sent in a breakpoint continuous mode, so that time is saved, and speed is improved.
In one embodiment, after the system upgrade delta packet is sent to the terminal device, the method may further include the steps of:
and sending a system rollback instruction to the terminal equipment, wherein the system rollback instruction is used for indicating the terminal equipment to modify equipment starting system parameters or modify a marker bit of a preset disk position, so that the terminal equipment runs in a first operating system which is not updated by using the system upgrading differential packet when being started next time.
Therefore, when the latest released system version has a problem and needs to be recalled, the system rollback instruction can be sent to the terminal equipment to instruct the terminal equipment to directly run on the first operating system when the terminal equipment is started up next time by modifying the equipment starting parameters, so that the terminal equipment can be conveniently rolled back to an earlier version, and the terminal equipment can be remotely instructed to rollback the system version.
Based on the embodiments described above, fig. 4 shows a schematic interaction diagram at the time of upgrading of the terminal device in one embodiment.
In practical use, a base installation package base.zip of a system base version of an operating system is required to be made, the system base version is installed on a published terminal device, and meanwhile, the base installation package can be simultaneously burnt in a storage area of the terminal device. When the terminal equipment has two partitions for storing the operating systems, a first operating system storage area and a second operating system storage area, the system which is burnt by the basic version of the system and the operating systems which are burnt by the two operating system storage areas are the same when the first operating system storage area and the second operating system storage area are burnt. Meanwhile, in the case that two different partitions exist in the terminal device to store the basic installation package and the system upgrade delta package respectively, the basic installation package base. Zip can be programmed in a basic package storage area of the terminal device for storing the basic installation package. At this time, the delta package storage area of the terminal device to store the system upgrade delta package does not store any installation package.
In the actual startup use process of the terminal equipment after leaving the factory, the operating systems for burning the two operating system storage areas are the same, so that any one of the first operating system and the second operating system can be used for running. Typically, which operating system is running may be specified in advance, for example by setting a UBoot parameter to indicate which operating system is started at device power-on.
After the terminal equipment leaves the factory for a period of time, an operating system used by the terminal equipment may need to be modified, a new system version can be released, and a difference packet between an installation packet of the latest version of the system and a basic installation packet is generated for downloading of each terminal equipment.
Taking an operating system as an example and an Android system as an example, the server can obtain a basic installation package base. Zip by using a make otaplapackage tool of the Android system. When the system or application has a modification to be upgraded, a make otaplackage tool can be used to obtain the latest version of the installation package target. Then, a ta_from_target_files tool of the Android system can be used to obtain an original difference packet update_src_ota.zip of difference between the ta_from_target_files and the file.
The server then decompresses the original delta package update_src_ota.zip, resulting in a directory structure in one embodiment as follows:
Figure GDA0004058887650000141
Figure GDA0004058887650000151
wherein in the directory structure, the system directory is mainly used for updating some applications of the system or some libraries used by the applications, and the updater-script is an original upgrade script. Further analysis of the updater-script upgrade script may find that its syntax structure is very similar to the shell script syntax under linux/android/qnx, so that it is rewritten to rewrite the original upgrade script to the shell script. For example:
For a command of deleting a file/data/init.log, the grammar content in the original script file is: delete ("/data/init. Log"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: rm-f/data/init. Log
Aiming at a command for deleting a folder/data/dalvik-cache, the grammar content in the original script file is as follows: delete_recovery ("/data-cache"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: rm-rf/data/dalvik-cache.
For the command of the my.zip file to/system in the decompressed ROM package, the grammar content in the original script file is as follows: package_extract_file ("my.zip", "/system"). And (3) rewriting the grammar into a shell script, so that the grammar content in the shell script becomes: tar-zxvf my.
Therefore, after the update-script in the decompressed update_src_ota_zip is rewritten, the update-script is repackaged, and the update_dst_ota_zip of the more general and flexible upgrade package is obtained.
And in the process of using the terminal equipment after starting up, the latest version information of the system is queried from the server at fixed time or based on the received instruction. And comparing the obtained information of the latest version of the system of the server with the highest version of the system version information stored by the server, and when the information is inconsistent with the highest version of the system version information, indicating that the update is required, sending a system update request to the server, obtaining a system update delta packet update_dst_ota.zip of the latest version of the system from the server, and storing the delta packet update_dst_ota.zip in a delta packet storage area of the terminal equipment.
After the system upgrade differential packet update_dst_ota.zip is downloaded, because the terminal equipment is a double-system partition, after the upgrade packet is checked to be qualified, the terminal equipment can upgrade without restarting the system, thus the upgrade is completely quiesced, and the vehicle-to-machine can be normally used in the upgrade process. The method comprises the steps that when a first operating system is currently running, a pre-upgrading script is executed in the process of running the first operating system, the system upgrading differential packet is decompressed through the pre-upgrading script, the upgrading script in the system upgrading differential packet is called to upgrade, a stored basic installation packet base.zip of a system basic version is used first, the system version of a second operating system which is not currently in a running state is restored to the system basic version, and then the system upgrading differential packet update_dst_ota.zip stored in a differential packet storage area is used for upgrading the second operating system to the latest system version.
Through the above process, the server only needs to maintain a latest installation package of the latest version of the system and a base installation package base. For example, assume that the system upgrade version is denoted as A, B, C, D, E in turn, i.e., the delta package Δba is maintained when the system version is upgraded to version B. And when the system version is updated again and the system version is updated to the C version, only the delta packet delta CA is required to be maintained, the delta packet delta BA is not required to be maintained, and the other steps are performed. When the terminal equipment is upgraded, the system is firstly returned to the system basic version and then is upgraded to the latest version, so that the terminal equipment can completely and directly upgrade from the A version to the C version even if the terminal equipment misses the time for upgrading the A version to the B version. Moreover, as can be seen by combining the flow comparison diagram shown in fig. 5, compared with the traditional upgrading method, the method has the advantages that the user needs to be prompted, the equipment is restarted after the user agrees, the upgrading script is called to decompress the upgrading package after the equipment is restarted, and then the decompressed upgrading package is adopted for upgrading. The mode of the embodiment of the application does not need to restart, the upgrading is completely quiesced, the terminal equipment can be normally used in the upgrading process, and in the upgrading process, a pre upgrading script is executed first, so that the upgrading script in the upgrading package is decompressed and called for upgrading, the upgrading script is classified, and the specific upgrading process is in the script of the upgrading package and is more flexible and convenient. The upgrade script is a rewritten shell script, can be used for systems such as a linux system, an android system and a qnx system, and improves the universality and cross-platform property of the scheme of the embodiment of the application.
After the second operating system is updated to the latest version of the system, the device starting system parameter Uboot is required to be modified or the flag bit of the preset disk position is required to be modified, so that the terminal device operates on the second operating system updated to the latest version of the system when the terminal device is started next time. Under the condition that the device starting system parameter Uboot is modified or the flag bit of the preset disk position is modified, the terminal device can run in a second operating system updated to the latest version of the system when being started next time.
The terminal equipment upgrading method provided by the embodiment of the application greatly improves disaster tolerance in the process of upgrading the terminal equipment, for example:
if the power is off or the terminal equipment is restarted in the downloading process of the system upgrading delta packet, the system upgrading delta packet is incomplete and cannot pass verification, the first operating system still operates when the system upgrading delta packet is started next time, and breakpoint continuous transmission can be performed on the system upgrading delta packet which is not downloaded.
If power is off or restarted in the process of upgrading by using the System upgrading delta packet, for example, the System is currently running in the first operating System Sytem1, and in the process of upgrading the second operating System Sytem 2, because the upgrading process is not completed, the device starting System parameter UBoot or the flag bit of the preset disk position is not modified, the delta packet storage area still stores the delta packet, and after the next power-on, the System still enters the first operating System Sytem1, and the upgrading script is re-executed, so that the situation that the power-on cannot be started is avoided.
If the upgrade fails due to unknown reasons, for example, the second operating System2 is upgraded currently in the first operating System1, because the upgrade process is not completed, the device starting System parameter UBoot or the flag bit of the predetermined disk position is not modified, the delta packet storage area still stores the delta packet, after the next starting, the System still enters the first operating System1, and the upgrade script is re-executed, so that the situation that the terminal device changes the board brick cannot occur.
If the terminal device is restored to the factory setting under the condition that the network is not available, for example, the first operating System Sytem1 and the second operating System System2 are brushed to be the System base version, and the differential packet storage area still stores the differential packet, so that the upgrade script can still be executed to upgrade to the new version.
If the newly released version has a problem, the server can also issue a command to the vehicle machine, rewrite the System parameter UBoot or the flag bit of the preset disk position of the equipment, and automatically switch to the first operating System1 with a more stable version when the equipment is started next time, thereby achieving the purpose of remotely backing back the version.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts may include a plurality of steps or stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in rotation or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 6, there is provided a terminal device upgrade apparatus, which may be provided in a terminal device, including:
the version restoration module 601 is configured to restore, in a state in which the first operating system is running, a system version of a second operating system that is not currently in a running state to a system base version using a stored base installation package of the system base version;
and the upgrade module 602 is configured to upgrade the second operating system restored to the system base version to the system latest version by using a system upgrade delta package, where the system upgrade delta package is a delta package between the base installation package and the installation package of the system latest version.
In one embodiment, the upgrade module 602 executes a pre-upgrade script, decompresses the system upgrade delta package through the pre-upgrade script, and invokes an upgrade script in the system upgrade delta package to upgrade, so as to upgrade the second operating system from the system base version to the system latest version.
In one embodiment, the upgrade script is a shell script.
In one embodiment, the upgrade module 602 modifies the device boot system parameters after upgrading the second operating system to the latest version of the system, so that the second operating system is operated at the next boot.
In one embodiment, the upgrade module 602 writes a flag bit in a predetermined disk location after upgrading the second operating system to the latest version of the system, so that the second operating system operates when the flag bit is read in the predetermined disk location when the second operating system is started next time.
In one embodiment, the system further includes a system rollback module, when the terminal device runs in the second operating system, if a system rollback instruction is received, modifying a device start system parameter or modifying a flag bit of the predetermined disk position according to the system rollback instruction, so that the terminal device runs in the first operating system when being started next time, and deleting the stored system upgrade delta packet according to the system rollback instruction.
In one embodiment, the upgrade module 602 further deletes the system upgrade delta package after modifying the device boot system parameters or modifying the flag bit of the predetermined disk location.
In one embodiment, as shown in fig. 7, there is provided a terminal device upgrading apparatus, which may be provided in a server, including:
the winding piece detection module 701 is used for detecting a differential packet release triggering condition;
the delta packet obtaining module 702 is configured to obtain a system upgrade delta packet when a delta packet issuing trigger condition is satisfied, where the system upgrade delta packet is a delta packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
And a sending module 703, configured to send the system upgrade delta packet to the terminal device.
In one embodiment, the system upgrade delta package generating module is further configured to generate the system upgrade delta package.
In one embodiment, the delta packet generation module includes:
the original package generation module is used for generating an original delta package based on the installation package of the latest version of the system and the basic installation package;
the decompression module is used for decompressing the original difference packet to obtain an original upgrade script in the original difference packet;
the rewrite module is used for rewriting the grammar in the original upgrade script into a shell script to obtain a rewritten upgrade script;
and the repackaging module is used for repackaging based on the rewritten upgrade script to generate the system upgrade delta packet.
In one embodiment, the delta packet generation module further uses the generated system upgrade delta packet to cover the stored system upgrade delta packet.
In one embodiment, the system further includes a rollback control module, configured to send a system rollback instruction to the terminal device, where the system rollback instruction is configured to instruct the terminal device to modify a device startup system parameter or modify a flag bit of a predetermined disk location, so that the terminal device runs a first operating system that is not updated by using the system upgrade delta packet when the terminal device is started next time.
For specific limitations of the terminal device upgrading apparatus, reference may be made to the above limitation of the terminal device upgrading method, and no further description is given here. The modules in the terminal equipment upgrading device can be realized in whole or in part by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, there is provided a terminal device including a processor and a memory area, where, as shown in fig. 8, the memory area includes: the system comprises a first operating system storage area for storing a first operating system, a second operating system storage area for storing a second operating system, a differential packet storage area for storing a system upgrade differential packet, and a basic packet storage area for storing an installation packet of a basic version of the system, wherein the system upgrade differential packet is a differential packet between an installation packet of the latest version of the system and an installation packet of the basic version of the system.
And the processor uses the basic installation package to restore the system version of the second operating system to the system basic version in the state of running the first operating system, and uses the system upgrading delta package to upgrade the second operating system restored to the system basic version to the latest system version.
A schematic diagram of the memory partition of the terminal device of the present application in comparison to a conventional terminal device in one embodiment is shown in fig. 9. As shown in 9-1 of fig. 9, the conventional terminal device has a UBOOT storage area, a UBOOT Flag Param storage area, a SyStem1 storage area, a User Config Data storage area, and a factory SyStem package storage area to store UBOOT parameters, UBOOT Flag Param, an operating SyStem1, user configuration Data User Config Data, and base package base. Only one system storage area exists, so that the operation of terminal equipment can be influenced in the equipment upgrading process, and the system needs to be restarted.
As shown in fig. 9-2, the terminal device provided in this embodiment of the present application includes a UBOOT storage area, a UBOOT Flag Param storage area, a first operating SyStem storage area System1, a second operating SyStem storage area System2, a User Config Data storage area, an OTA delta packet storage area, and a factory SyStem packet storage area, so as to store UBOOT parameters, UBOOT Flag Param, one operating SyStem System1, another operating SyStem System2, user configuration Data User Config Data, a SyStem upgrade delta packet, and a base Data packet base. Therefore, because of the double system partitions, after the system upgrading difference packet is checked to be qualified, the system can be upgraded without restarting the system, the system is completely quiesced and upgraded, and the vehicle and the machine can be normally used in the upgrading process. In addition, by setting the system upgrading delta packet, the breakpoint continuous downloading of the system upgrading delta packet can be realized, and if a fault occurs in the upgrading process, the terminal equipment can be upgraded again after the next starting up, so that the normal use of the terminal equipment is not affected.
In one embodiment, the processor executes a pre-upgrade script, decompresses the system upgrade delta package through the pre-upgrade script, and invokes an upgrade script in the system upgrade delta package to upgrade, and upgrades the second operating system from the system base version to the system latest version.
In one embodiment, the upgrade script is a shell script.
In one embodiment, after the processor upgrades the second operating system to the latest version of the system, the device is modified to start the system parameters or to modify the flag bit of the predetermined disk location, so that the second operating system operates at the next boot.
In one embodiment, when the processor operates in the second operating system at the next power-on, if a system rollback instruction is received, modifying a system starting parameter of the device or modifying a flag bit of the predetermined disk position according to the system rollback instruction, so that the processor operates in the first operating system at the next power-on, and deleting the stored system upgrade delta packet according to the system rollback instruction.
The specific limitation of the upgrading of the processor of the terminal device can be referred to the limitation of the upgrading method of the terminal device, and will not be described herein. An internal structure diagram of the terminal device in one embodiment may be as shown in fig. 10. The computer device comprises a processor, a memory, a communication interface connected by a system bus, and in some possible product forms the terminal device may also comprise a display screen and input means. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The nonvolatile storage medium stores a first operating system, a second operating system, a computer program, a system upgrade delta package, and a base installation package. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for conducting wired or wireless communication with an external server, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a terminal device upgrade method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 11. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing a system upgrade delta package between the latest version of the system and the basic version of the system. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a terminal device upgrade method.
It will be appreciated by those skilled in the art that the structures shown in fig. 10 and 11 are merely block diagrams of portions of structures related to the aspects of the present application and are not intended to limit the computer device on which the aspects of the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or may have different arrangements of components.
In one embodiment, a computer device is provided that includes a memory having a computer program stored therein and a processor that performs the server processing steps described above in connection with an upgrade of a terminal device.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps performed by a terminal device or server as described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (33)

1. The terminal equipment upgrading method is characterized in that the terminal equipment stores two operating systems, and when one operating system runs, the other operating system is used as a backup; the method comprises the following steps:
in a state of running a first operating system, using a basic installation package of a stored system basic version to restore the system version of a second operating system which is not currently in a running state to the system basic version; the system types of the first operating system and the second operating system are the same, and the system basic version refers to the earliest released system version of the operating system;
And upgrading the second operating system restored to the system basic version by using a system upgrading delta package, and upgrading the second operating system to the system latest version, wherein the system upgrading delta package is a delta package between the basic installation package and the installation package of the system latest version.
2. The method of claim 1, wherein using a system upgrade delta package to upgrade the second operating system restored to the system base version, the second operating system to a system latest version, comprises:
and executing a pre-upgrading script, decompressing the system upgrading delta packet through the pre-upgrading script, calling the upgrading script in the system upgrading delta packet to upgrade, and upgrading the second operating system from the system basic version to the system latest version.
3. The method of claim 2, wherein the upgrade script is a shell script.
4. The method of claim 1, wherein before restoring the system version of the second operating system that is not currently in operation to the system base version using the stored base installation package of the system base version, further comprising the steps of:
And acquiring a system upgrade differential packet, and storing the system upgrade differential packet into a differential packet storage area.
5. The method of claim 4, wherein after obtaining the system upgrade delta package and before storing the system upgrade delta package in the delta package storage area, further comprising:
and carrying out validity check on the obtained system upgrading difference quantity packet.
6. The method of claim 1 or 2, wherein after upgrading the second operating system to the latest version of the system, further comprising:
modifying the equipment starting system parameters so that the equipment is operated on the second operating system when the equipment is started next time;
or alternatively
And writing a flag bit in a preset disk position, so that the second operating system operates when the flag bit is read in the preset disk position when the computer is started next time.
7. The method of claim 6, further comprising the step of:
when the second operating system is operated when the computer is started next time, if a system rollback instruction is received, modifying the equipment starting system parameter or modifying the marker bit of the preset disk position according to the system rollback instruction, so that the computer is operated on the first operating system when the computer is started next time, and deleting the stored system upgrading differential packet according to the system rollback instruction.
8. The method of claim 6, wherein the method further comprises:
after modifying the system parameters of equipment or modifying the flag bit of the preset disk position, deleting the system upgrade delta packet;
or alternatively
And when the second operating system is operated at the next starting, the first operating system is not upgraded by using the system upgrade delta packet.
9. A method for upgrading a terminal device, the method comprising:
detecting a differential packet issuing triggering condition;
when the triggering condition of the differential packet issuing is met, acquiring a system upgrading differential packet, wherein the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and sending the system upgrading delta packet to the terminal equipment, so that the terminal equipment upgrades the second operating system restored to the system basic version by using the system upgrading delta packet under the condition that the first operating system is in an operating state and the system version of the second operating system which is not in the operating state is restored to the system basic version by using the stored basic installation packet of the system basic version, and upgrades the second operating system to the system latest version, wherein the system basic version refers to the system version which is released by the operating system earliest.
10. The method of claim 9, wherein the generating the system upgrade delta package comprises:
generating an original delta package based on the installation package of the latest version of the system and the basic installation package;
decompressing the original differential packet to obtain an original upgrade script in the original differential packet;
the grammar in the original upgrade script is rewritten into a shell script, and a rewritten upgrade script is obtained;
and repackaging based on the rewritten upgrade script to generate the system upgrade delta packet.
11. The method of claim 9, further comprising the step of:
and sending a system rollback instruction to the terminal equipment, wherein the system rollback instruction is used for indicating the terminal equipment to modify equipment starting system parameters or modify a marker bit of a preset disk position, so that the terminal equipment runs in a first operating system which is not updated by using the system upgrading differential packet when being started next time.
12. The method of claim 9, wherein upon receiving a system upgrade request sent by the terminal device, determining that a delta packet delivery trigger condition is satisfied.
13. The method of claim 9, wherein upon determining that a new system version is released and that a corresponding system upgrade delta package is generated, determining that a delta package release trigger condition is satisfied.
14. The method according to claim 9, wherein the method further comprises: and using the generated system upgrade delta packet to cover the stored system upgrade delta packet.
15. The terminal equipment upgrading device is characterized in that the terminal equipment stores two operating systems, and when one operating system runs, the other operating system is used as a backup; the device comprises:
the version recovery module is used for recovering the system version of the second operating system which is not currently in the running state to the system basic version by using the stored basic installation package of the system basic version in the running state of the first operating system; the system types of the first operating system and the second operating system are the same, and the system basic version refers to the earliest released system version of the operating system;
and the upgrade module is used for upgrading the second operating system restored to the system basic version by using a system upgrade delta package, and upgrading the second operating system to the system latest version, wherein the system upgrade delta package is a delta package between the basic installation package and the installation package of the system latest version.
16. The apparatus of claim 15, wherein the upgrade module executes a pre-upgrade script, decompresses the system upgrade delta package via the pre-upgrade script, and invokes an upgrade script within the system upgrade delta package to upgrade, upgrading the second operating system from the system base version to the system latest version.
17. The apparatus of claim 16, wherein the upgrade script is a shell script.
18. The apparatus of claim 15, wherein the upgrade module modifies device boot system parameters after upgrading the second operating system to a latest version of the system so that the second operating system is run at a next boot.
19. The apparatus of claim 15, wherein the upgrade module writes a flag bit in a predetermined disk location after upgrading the second operating system to a latest version of the system, such that the second operating system is operated when the flag bit is read in the predetermined disk location at a next power-on.
20. The apparatus of claim 18, further comprising a system rollback module that, when a terminal device is running in the second operating system, if a system rollback instruction is received, modifies the device start-up system parameters according to the system rollback instruction so that the terminal device runs in the first operating system at a next power-on time, and deletes the stored system upgrade delta package according to the system rollback instruction.
21. The apparatus of claim 19, further comprising a system rollback module configured to modify a flag bit of the predetermined disk location according to the system rollback instruction when a terminal device is running in the second operating system, so that the terminal device runs in the first operating system at a next power-on time, and delete the stored system upgrade delta package according to the system rollback instruction.
22. A terminal equipment upgrade apparatus, the apparatus comprising:
the winding part detection module is used for detecting a differential quantity package issuing triggering condition;
the system comprises a differential packet acquisition module, a system upgrading differential packet generation module and a system updating module, wherein the differential packet acquisition module is used for acquiring a system upgrading differential packet when a differential packet issuing triggering condition is met, and the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and the sending module is used for sending the system upgrading delta packet to the terminal equipment, so that the terminal equipment upgrades the second operating system restored to the system basic version by using the system upgrading delta packet under the condition that the first operating system is in an operating state and the system version of the second operating system which is not in the operating state is restored to the system basic version by using the stored basic installation packet of the system basic version, and upgrades the second operating system to the latest system version, wherein the system basic version refers to the system version which is released by the operating system earliest.
23. The apparatus of claim 22, further comprising a delta package generation module to generate the system upgrade delta package.
24. The apparatus of claim 23, wherein the delta packet generation module comprises:
the original package generation module is used for generating an original delta package based on the installation package of the latest version of the system and the basic installation package;
the decompression module is used for decompressing the original difference packet to obtain an original upgrade script in the original difference packet;
the rewrite module is used for rewriting the grammar in the original upgrade script into a shell script to obtain a rewritten upgrade script;
and the repackaging module is used for repackaging based on the rewritten upgrade script to generate the system upgrade delta packet.
25. The apparatus of claim 23, wherein the delta package generation module further overlays a stored system upgrade delta package with the generated system upgrade delta package.
26. The apparatus of claim 22, further comprising a rollback control module configured to send a system rollback instruction to the terminal device, where the system rollback instruction is configured to instruct the terminal device to modify a device startup system parameter or modify a flag bit of a predetermined disk location, so that the terminal device runs a first operating system that is not updated with the system upgrade delta package when the terminal device is next powered on.
27. A terminal device storing two operating systems, one operating system being a backup when the other operating system is running; the terminal device includes: a processor, further comprising: a first operating system storage area for storing a first operating system, a second operating system storage area for storing a second operating system, a delta package storage area for storing a system upgrade delta package, and a base package storage area for storing an installation package of a base version of the system, wherein the system upgrade delta package is a delta package between an installation package of a latest version of the system and an installation package of the base version of the system; the system types of the first operating system and the second operating system are the same, and the system basic version refers to the earliest released system version of the operating system;
and the processor uses a basic installation package to restore the system version of the second operating system to the system basic version in the state of running the first operating system, uses the system upgrading delta package to upgrade the second operating system restored to the system basic version to the latest version of the system.
28. The terminal device of claim 27, wherein the processor executes a pre-upgrade script, decompresses the system upgrade delta package via the pre-upgrade script, and invokes an upgrade script within the system upgrade delta package to upgrade, upgrading the second operating system from the system base version to the system latest version.
29. The terminal device of claim 28, wherein the upgrade script is a shell script.
30. The terminal device of claim 27, wherein after the processor upgrades the second operating system to a latest version of the system, the device boot system parameters are modified or a flag bit of a predetermined disk location is modified so that the next boot up is performed on the second operating system.
31. The terminal device of claim 27, wherein the processor modifies a device start-up system parameter or modifies a flag bit of a predetermined disk location according to the system back-off instruction if a system back-off instruction is received when the processor runs on the second operating system next time, so that the processor runs on the first operating system next time and deletes the stored system upgrade delta package according to the system back-off instruction.
32. A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
detecting a differential packet issuing triggering condition;
when the triggering condition of the differential packet issuing is met, acquiring a system upgrading differential packet, wherein the system upgrading differential packet is a differential packet between a basic installation packet of a system basic version and an installation packet of a system latest version;
and sending the system upgrading delta packet to a terminal device, so that the terminal device upgrades the second operating system restored to the system basic version by using the system upgrading delta packet under the condition that the first operating system is in an operating state and the system version of the second operating system which is not in the operating state is restored to the system basic version by using a basic installation packet of the stored system basic version, and upgrades the second operating system to the system latest version, wherein the system basic version refers to the system version which is released by the operating system earliest.
33. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 14.
CN202011376388.7A 2020-11-30 2020-11-30 Terminal equipment upgrading method, device, terminal equipment and medium Active CN112416406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011376388.7A CN112416406B (en) 2020-11-30 2020-11-30 Terminal equipment upgrading method, device, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011376388.7A CN112416406B (en) 2020-11-30 2020-11-30 Terminal equipment upgrading method, device, terminal equipment and medium

Publications (2)

Publication Number Publication Date
CN112416406A CN112416406A (en) 2021-02-26
CN112416406B true CN112416406B (en) 2023-06-23

Family

ID=74829020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011376388.7A Active CN112416406B (en) 2020-11-30 2020-11-30 Terminal equipment upgrading method, device, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN112416406B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115729586B (en) * 2021-06-15 2023-10-20 荣耀终端有限公司 Operating system upgrade method, device, storage medium and computer program product
CN113419756A (en) * 2021-06-18 2021-09-21 杭州海康威视数字技术股份有限公司 File upgrading method and device and electronic equipment
CN113721959A (en) * 2021-08-30 2021-11-30 联想(北京)有限公司 Information processing method and device and electronic equipment
CN114268941A (en) * 2021-12-27 2022-04-01 北京自如信息科技有限公司 Target equipment upgrading method, device, equipment and storage medium
CN114389951A (en) * 2022-03-02 2022-04-22 深圳震有科技股份有限公司 Seamless upgrading method under 5G network, network equipment and storage medium
CN115756554B (en) * 2023-02-13 2023-06-30 美云智数科技有限公司 Version upgrading method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101668081A (en) * 2009-09-24 2010-03-10 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and automatic upgrading method thereof
CN104391728A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Software upgrading delta pack acquiring method, corresponding upgrading method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8959205B2 (en) * 2009-07-31 2015-02-17 Hewlett-Packard Development Company, L.P. Method and system to recognize and inventory applications
CN106293814B (en) * 2016-07-29 2020-02-07 北京小米移动软件有限公司 Upgrading method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101668081A (en) * 2009-09-24 2010-03-10 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and automatic upgrading method thereof
CN104391728A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Software upgrading delta pack acquiring method, corresponding upgrading method and device

Also Published As

Publication number Publication date
CN112416406A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN112416406B (en) Terminal equipment upgrading method, device, terminal equipment and medium
US7275153B2 (en) Booting and boot code update system using boot strapper code to select between a loader and a duplicate backup loader
KR101003888B1 (en) Tri-phase boot process in electronic devices
US8539471B2 (en) Updating firmware of an electronic device
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
US20170322796A1 (en) Device and method for updating firmware and firmware update system
US20110004871A1 (en) Embedded electronic device and firmware updating method thereof
CN109086078B (en) Android system upgrading method and device, server and mobile terminal
CN106951284B (en) User interface upgrading method and device based on android system application and intelligent terminal
US20170052779A1 (en) Method and Device for Running Version File
CN110597542A (en) Automatic OTA (over the air) software upgrading method and device and electronic equipment
CN106843947B (en) Method and device for processing code defects
KR20170067826A (en) Updating of firmware
CN110597545A (en) Hot patch intelligent upgrading method and system based on OTA component
CN114116023A (en) Operating system starting method, operating system starting device, storage medium and computer program product
CN106775874B (en) System upgrading method of terminal equipment
KR20070038681A (en) Method and system for updating firmware
JP2009009391A (en) Updating software self-update method and portable terminal device
CN111913733A (en) Method and device for making automatic upgrade package, computer equipment and storage medium
CN113821234B (en) Operating system upgrade method, apparatus, storage medium, and computer program product
CN113766554A (en) Method and device for acquiring WiFi calibration data and WiFi equipment calibration test system
US11768669B2 (en) Installing application program code on a vehicle control system
CN112860287A (en) System program upgrading method and device, computer equipment and storage medium
CN104049985A (en) Cross-file-system version on-line upgrading method and device
KR102142905B1 (en) Automatic Restoring Method of User File System in Communication Terminal

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