CN111158729A - System upgrading method, device, equipment and storage medium - Google Patents

System upgrading method, device, equipment and storage medium Download PDF

Info

Publication number
CN111158729A
CN111158729A CN201911422473.XA CN201911422473A CN111158729A CN 111158729 A CN111158729 A CN 111158729A CN 201911422473 A CN201911422473 A CN 201911422473A CN 111158729 A CN111158729 A CN 111158729A
Authority
CN
China
Prior art keywords
partition
upgrading
processed
upgrade
storage file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911422473.XA
Other languages
Chinese (zh)
Inventor
刘庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Priority to CN201911422473.XA priority Critical patent/CN111158729A/en
Publication of CN111158729A publication Critical patent/CN111158729A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses a system upgrading method, a device, equipment and a storage medium, wherein the method comprises the following steps: detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file; if yes, the to-be-processed partition of the system is not upgraded; if not, upgrading the to-be-processed partition of the system. The partition which is upgraded is recorded in the identification storage file, and if abnormal conditions such as power failure occur, the partition which is not upgraded is upgraded when being upgraded again, and the recorded partition which is upgraded is not upgraded any more, so that the whole upgrading process is avoided running again, the upgrading efficiency of the system upgrading process is improved, and the failure risk caused by repeated upgrading is reduced.

Description

System upgrading method, device, equipment and storage medium
Technical Field
The present invention relates to the field of system upgrade, and in particular, to a method, an apparatus, a device, and a storage medium for system upgrade.
Background
For upgrading most systems, The upgrading of FOTA (Firmware Over-The-Air software upgrading of a mobile terminal) is to upgrade partitions one by one according to a preset upgrading sequence in a Recovery mode, equipment based on an Android System generally comprises partitions such as Boot, System, Userdata, Cache, Recovery and Misc, different partitions are generally used for storing different types of data, and The conditions of The partitions may be slightly different for different third-party equipment manufacturers. If power failure occurs in the upgrading process, after power is re-powered on, the recovery mode is re-entered, but the whole upgrading process is repeated again, and even if part of partitions are upgraded successfully, the partitions are re-upgraded again, so that the time of the whole upgrading process is too long, the upgrading efficiency is low, and meanwhile, the risk of upgrading failure is increased.
Disclosure of Invention
The invention mainly aims to provide a system upgrading method, a system upgrading device, system upgrading equipment and a storage medium, and aims to solve the technical problems of low upgrading efficiency and high failure risk in the existing system upgrading process.
In order to achieve the above object, the present invention provides a system upgrading method, which includes the following steps:
detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
if yes, the to-be-processed partition of the system is not upgraded;
if not, upgrading the to-be-processed partition of the system.
Optionally, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further includes:
detecting whether the identification storage file exists in the current upgrading equipment or not;
if not, creating the identification storage file under a preset file path of the current upgrading equipment;
if yes, executing the following steps: and detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file.
Optionally, if so, after the step of not upgrading the partition to be processed of the system, the method further includes:
detecting whether the identifier storage file has a partition identifier of a partition to be processed of a next system;
if yes, the partition to be processed of the next system is not upgraded;
if not, upgrading the partition to be processed of the next system.
Optionally, if not, after the step of upgrading the partition to be processed of the system, the method further includes:
and after upgrading all the partitions, deleting the identification storage file.
Optionally, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further includes:
downloading an upgrading data packet, and carrying out data integrity verification on the upgrading data packet;
if the data integrity of the upgrade data packet is not verified, the upgrade data packet is downloaded again, and the data integrity of the newly downloaded upgrade data packet is verified;
if the data integrity of the upgrade data packet passes the verification, executing the following steps: detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
correspondingly, if not, the step of upgrading the to-be-processed partition of the system comprises the following steps:
and if not, upgrading the to-be-processed partition of the system based on the upgrading data packet.
Optionally, before the step of downloading the upgrade data package and performing data integrity check on the upgrade data package, the method further includes:
acquiring the latest version number corresponding to the system and the version number corresponding to the system which is started currently;
comparing the latest version number corresponding to the system with the version number corresponding to the system which is started currently;
if the latest version number corresponding to the system is inconsistent with the version number corresponding to the currently started system, executing the following steps: and downloading the upgrade data packet.
Optionally, if not, after the step of upgrading the partition to be processed of the system, the method further includes:
and after the upgrading of the system to-be-processed partition is finished, recording the partition identification of the system to-be-processed partition in the identification storage file.
Further, to achieve the above object, the present invention further provides a system upgrading apparatus, including:
the system upgrading device comprises:
the identification detection module is used for detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file;
the maintaining module is used for not upgrading the to-be-processed partition of the system if the to-be-processed partition of the system is in the presence of the maintenance module;
and the upgrading module is used for upgrading the to-be-processed partition of the system if the to-be-processed partition is not updated.
Further, to achieve the above object, the present invention also provides a system upgrade apparatus, which includes a memory, a processor, and a system upgrade program stored in the memory and executable on the processor, and when executed by the processor, the system upgrade program implements the steps of the system upgrade method as described above.
Further, to achieve the above object, the present invention also provides a storage medium, on which a system upgrade program is stored, and the system upgrade program implements the steps of the system upgrade method as described above when executed by a processor.
The method comprises the steps of detecting whether a partition identifier of a partition to be processed of a system exists in an identifier storage file; if yes, the to-be-processed partition of the system is not upgraded; if not, upgrading the to-be-processed partition of the system. The partition which is upgraded is recorded in the identification storage file, and if abnormal conditions such as power failure occur, the partition which is not upgraded is upgraded when being upgraded again, and the recorded partition which is upgraded is not upgraded any more, so that the whole upgrading process is avoided running again, the upgrading efficiency of the system upgrading process is improved, and the failure risk caused by repeated upgrading is reduced.
Drawings
FIG. 1 is a schematic structural diagram of an apparatus hardware operating environment according to an embodiment of the system upgrade apparatus of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of the system upgrade method of the present invention;
FIG. 3 is a functional block diagram of a system upgrade apparatus according to a preferred embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, in The prior art, for The upgrade of most systems, The full-scale upgrade of FOTA (Firmware Over-The-Air software upgrade of a mobile terminal) is to upgrade partitions one by one according to a preset upgrade sequence in a Recovery mode, devices based on an Android System generally include, but are not limited to, partitions such as Boot, System, Userdata, Cache, Recovery, and Misc, generally different partitions are used for storing different types of data, and The partition conditions may be slightly different for different third-party device manufacturers. If power failure occurs in the upgrading process, after power is re-powered on, the recovery mode is re-entered, but the whole upgrading process is repeated again, and even if part of partitions are upgraded successfully, the partitions are re-upgraded again, so that the time of the whole upgrading process is too long, the upgrading efficiency is low, and meanwhile, the risk of upgrading failure is increased.
Based on the above-mentioned defects, the present invention provides a system upgrade device, and referring to fig. 1, fig. 1 is a schematic structural diagram of a device hardware operating environment according to an embodiment of the system upgrade device of the present invention.
As shown in fig. 1, the system upgrade apparatus may include: a processor 1001, e.g. a CPU, a communication bus 1002, a user interface 1003 to be analyzed, a network interface 1004, a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The to-be-analyzed user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional to-be-analyzed user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware configuration of the system upgrade apparatus shown in fig. 1 does not constitute a limitation of the system upgrade apparatus, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module to be analyzed, and a system upgrade program. The operating system is a program for managing and controlling system upgrading equipment and software resources, and supports the operation of a network communication module, a user interface module to be analyzed, a system upgrading program and other programs or software; the network communication module is used to manage and control the network interface 1004; the to-be-analyzed user interface module is used for managing and controlling the to-be-analyzed user interface 1003.
In the hardware structure of the system upgrading device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface to be analyzed 1003 is mainly used for connecting a client and performing data communication with the client; the processor 1001 may call a system upgrade program stored in the memory 1005 and perform the following operations:
detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
if yes, the to-be-processed partition of the system is not upgraded;
if not, upgrading the to-be-processed partition of the system.
Further, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further includes:
detecting whether the identification storage file exists in the current upgrading equipment or not;
if not, creating the identification storage file under a preset file path of the current upgrading equipment;
if yes, executing the following steps: and detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file.
Further, if yes, after the step of not upgrading the partition to be processed of the system, the method further includes:
detecting whether the identifier storage file has a partition identifier of a partition to be processed of a next system;
if yes, the partition to be processed of the next system is not upgraded;
if not, upgrading the partition to be processed of the next system.
Further, if not, after the step of upgrading the partition to be processed of the system, the method further includes:
and after upgrading all the partitions, deleting the identification storage file.
Further, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further includes:
downloading an upgrading data packet, and carrying out data integrity verification on the upgrading data packet;
if the data integrity of the upgrade data packet is not verified, the upgrade data packet is downloaded again, and the data integrity of the newly downloaded upgrade data packet is verified;
if the data integrity of the upgrading data packet passes the verification, executing the step of detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
correspondingly, if not, the step of upgrading the to-be-processed partition of the system comprises the following steps:
and if not, upgrading the to-be-processed partition of the system based on the upgrading data packet.
Further, before the step of downloading the upgrade data package and performing data integrity check on the upgrade data package, the method further includes:
acquiring the latest version number corresponding to the system and the version number corresponding to the system which is started currently;
comparing the latest version number corresponding to the system with the version number corresponding to the system which is started currently;
if the latest version number corresponding to the system is inconsistent with the version number corresponding to the currently started system, executing the following steps: and downloading the upgrade data packet.
Further, if not, after the step of upgrading the partition to be processed of the system, the method further includes:
and after the upgrading of the system to-be-processed partition is finished, recording the partition identification of the system to-be-processed partition in the identification storage file.
The specific implementation of the system upgrade apparatus of the present invention is substantially the same as the embodiments of the system upgrade method described below, and is not described herein again.
The invention also provides a system upgrading method.
And (3) system upgrading: refers to an operation of updating or replacing a system of a terminal by a certain method.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the system upgrade method according to the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than presented herein.
In each embodiment of the system upgrading method, the execution subject may be a system upgrading device, or may be the current upgrading device itself, and for convenience of description, the current upgrading device is used as the execution subject in the present embodiment. The system upgrading method comprises the following steps:
step S10, detecting whether the identification storage file has the partition identification of the system partition to be processed;
in The prior art, for upgrading most systems, FOTA (Firmware Over The Air, Over-The-Air software upgrade of a mobile terminal) full-scale upgrade is to upgrade partitions one by one according to a preset upgrade sequence in a Recovery mode, devices based on an Android System generally include but are not limited to partitions such as Boot, System, user data, Cache, Recovery, Misc and The like, generally different partitions are used for storing different types of data, and The partition conditions may be slightly different for different third-party device manufacturers. If power failure occurs in the upgrading process, after power is re-powered on, the recovery mode is re-entered, but the whole upgrading process is repeated again, and even if part of partitions are upgraded successfully, the partitions are re-upgraded again, so that the time of the whole upgrading process is too long, the upgrading efficiency is low, and meanwhile, the risk of upgrading failure is increased.
In order to solve the technical problems of low upgrading efficiency and high failure risk in the system upgrading process in the prior art, the embodiment of the invention provides a system upgrading method, which aims to record the partition which is upgraded already, only upgrade the partition which is not upgraded before and not upgrade the recorded partition which is upgraded already when abnormal conditions such as power failure occur, so that the whole upgrading process is avoided running again, the upgrading efficiency in the system upgrading process is improved, and the failure risk caused by repeated upgrading for many times is reduced.
The system upgrading method in the embodiment is suitable for system upgrading of equipment based on an Android system and is also suitable for system upgrading of electronic products of other systems. For convenience of description, the present embodiment is described by taking system upgrade of an Android system-based device as an example. The Android System-based device generally includes, but is not limited to, partitions such as Boot, System, Userdata, Cache, Recovery, and Misc, generally, different partitions are used for storing different types of data, and for different third-party device manufacturers, the partition conditions may be slightly different, and this embodiment is not specifically limited herein.
In this embodiment, in the system upgrade process, the partition identifier of the system partition that has completed the upgrade may be recorded by the identifier storage file, specifically, the partition identifier of the partition may be recorded in the identifier storage file every time one partition is upgraded, or the partition identifiers of the two partitions may be recorded in the identifier storage file every time two partitions are upgraded, and the recording frequency of the partition identifier of the partition that has completed the upgrade, that is, the frequency of how many partitions complete the recording of the partition identifiers of the partitions per liter may be set by a user or an operation and maintenance person as needed. The partition identifier may be used to distinguish different system to-be-processed partitions, where the partition identifiers of different system to-be-processed partitions are different. The operation and maintenance personnel may set a corresponding partition identifier for each partition of the device in advance, where the partition identifier may be a name or a number of each partition, or a name or a number of an upgrade stage corresponding to each partition.
In this embodiment, the system upgrade process is to upgrade partitions of the device according to a preset upgrade order based on a preset upgrade script. Whether the system upgrading process is forced to be interrupted due to abnormal conditions such as power failure or not, the equipment records the partition identification of the partition which is upgraded in the upgrading process, detects whether the partition identification of other partitions exists in the identification storage file or not before upgrading of other partitions, and then determines whether the partition to be processed of the system is upgraded or not according to whether the partition to be processed of the system is upgraded or not.
Specifically, if the system upgrade process is not interrupted due to abnormal conditions such as power failure, the upgrade of all partitions can be completed without interruption, so that the whole system upgrade process is completed.
If the system upgrading process is forced to be interrupted due to abnormal conditions such as power failure and the like, after the equipment overcomes the abnormal conditions, for example, the equipment is powered on again, the equipment can rerun the upgrading process according to the preset upgrading script, but if part of the partitions are upgraded before the power failure and the corresponding partition identifications are recorded in the identification storage file, before upgrading treatment or upgrading treatment is carried out on each partition again, the partition identifications of the partitions to be processed of the system can be obtained, whether the partition identifications of the partitions to be processed of the system exist in the identification storage file is detected, whether the partition to be processed of the system is upgraded is determined, and whether the partition to be processed of the system is upgraded is determined according to the upgrading completion condition of the partition to be processed of the system.
It can be understood that the identification storage file is not erased due to the update interruption caused by the abnormal conditions such as power failure, the preferred file path of the identification storage file is/cache/recovery, and the identifiers of different partitions in the identification storage file can be separated by line breaks.
Step S20, if yes, the system partition to be processed is not upgraded;
and step S30, if not, upgrading the to-be-processed partition of the system.
In this embodiment, if it is detected that the partition identifier of the partition to be processed of the system exists in the identifier storage file before the partition to be processed of the system is updated, it is described that the device has completed updating the partition to be processed of the system, and it is not necessary to update the partition to be processed of the system again, and if it is detected that the partition identifier of the partition to be processed of the system does not exist in the identifier storage file, it is described that the device has not completed updating the partition to be processed of the system, and therefore it is necessary to update the partition to be processed of the system.
The embodiment detects whether the partition identifier of the partition to be processed of the system exists in the identifier storage file; if yes, the to-be-processed partition of the system is not upgraded; if not, upgrading the to-be-processed partition of the system. The partition which is upgraded is recorded in the identification storage file, and if abnormal conditions such as power failure occur, the partition which is not upgraded is upgraded when being upgraded again, and the recorded partition which is upgraded is not upgraded any more, so that the whole upgrading process is avoided running again, the upgrading efficiency of the system upgrading process is improved, and the failure risk caused by repeated upgrading is reduced.
Further, a second embodiment of the system upgrading method according to the present invention is provided, before the step S10, the method further includes:
step S101, downloading an upgrading data packet, and carrying out data integrity verification on the upgrading data packet;
step S102, if the data integrity of the upgrade data packet is not verified, the upgrade data packet is downloaded again, and the data integrity of the newly downloaded upgrade data packet is verified;
if the data integrity of the upgrade data packet passes the verification, executing step S10;
correspondingly, the step S30 includes:
and if not, upgrading the to-be-processed partition of the system based on the upgrading data packet.
In this embodiment, after the upgrade data packet is downloaded, data integrity check needs to be performed on the upgrade data packet, so as to prevent the upgrade data packet from being illegally tampered in the data transmission process, and ensure data security. If the data integrity of the upgrade data packet is verified to be passed, which indicates that the upgrade data packet is not illegally tampered, the device may be upgraded based on the upgrade data packet, that is, step S10 is executed, and when it is detected that the partition identifier of the partition to be processed of the system does not exist in the identifier storage file, the partition to be processed of the system is upgraded based on the upgrade data packet; if the data integrity check of the upgrade data packet fails, it is indicated that the upgrade data packet may be illegally tampered, and if the upgrade data packet is directly used for system upgrade, many potential safety hazards may be brought, so that the upgrade data packet needs to be downloaded again, and the data integrity check of the newly downloaded upgrade data packet is performed, until the data integrity check is passed, the downloaded upgrade data is used for performing system upgrade on the equipment.
Further, if the data integrity check of the upgrade data package fails, the newly downloaded upgrade data package also fails to pass the data integrity check, the number of times that the data integrity check fails is recorded, when the number of times that the data integrity check fails is greater than or equal to a preset number threshold, a data tampering prompt is displayed on the current upgrade device, and the data tampering prompt can also be sent to a preset management terminal to prompt a user or operation and maintenance personnel that the system upgrade data package is illegally tampered, so that the operation and maintenance personnel can take information safety protection measures in time.
Further, the data integrity check of the upgrade data package in step S101 is performed through a hash algorithm and a key logarithm. Specifically, the upgrade data package producer uses a hash algorithm and a secret key to hash the upgrade data package to obtain a hash value, then the hash value and the upgrade data package are uploaded to the cloud end together for downloading, after the download party downloads the upgrade data package, the upgrade data package is hashed by using the same hash algorithm and the same secret key to obtain the hash value, if the obtained hash value is the same as the hash value uploaded to the cloud end by the upgrade data package producer, it is indicated that the data is not tampered, and otherwise, the data is not tampered. The Hash Algorithm may be selected from the MD5 Message Digest Algorithm (Message-Digest Algorithm MD5) or the Secure Hash Algorithm (SHA, Secure Hash Algorithm), which is not limited in this embodiment.
Further, before the step S101, the method further includes:
step S1011, obtaining the latest version number corresponding to the system and the version number corresponding to the system which is started currently;
step S1012, comparing the latest version number corresponding to the system with the version number corresponding to the currently enabled system;
if the latest version number corresponding to the system is not consistent with the version number corresponding to the currently enabled system, step S101 is executed.
In this embodiment, after the device is turned on, the device may monitor, according to a certain frequency or in real time, whether a system currently enabled by the device needs to be upgraded, specifically, obtain a version number corresponding to the system currently enabled by the device and a latest version number corresponding to the system, compare the version number and the latest version number, and if the version number corresponding to the system currently enabled by the device is consistent with the latest version number corresponding to the system, it indicates that the system currently enabled by the device is already the latest version system, and does not need to be upgraded, and does not need to download an upgrade data packet of the system corresponding to the latest version number; if the version number corresponding to the system currently started by the equipment is not consistent with the latest version number corresponding to the system, the system currently started by the equipment is not the latest version system and needs to be upgraded, so that an upgrade data packet of the system corresponding to the latest version number is downloaded, and the equipment is upgraded by the upgrade data packet.
According to the method and the device, whether the upgrade data package is downloaded or not is determined according to whether the latest version number corresponding to the system is consistent with the version number corresponding to the system which is started by the device currently, and the device can be guaranteed to download the upgrade data package of the new version and perform system upgrade when the device has the upgrade data package of the new version, so that a user can use the system of the new version as soon as possible, and user experience is improved.
Further, before the step S10, the method further includes:
detecting whether the identification storage file exists in the current upgrading equipment or not;
if not, creating the identification storage file under a preset file path of the current upgrading equipment;
if yes, go to step S10.
The recovery mode refers to a mode (similar to windows PE or DOS) capable of modifying data or a system inside an Android, and may also be referred to as an Android recovery mode, and in the recovery mode, a new Android system may be flushed, or an existing system may be backed up or upgraded, and factory settings (formatted data and cache) may also be recovered here.
In this embodiment, when the current upgrade device enters a recovery mode and before the system upgrade is performed on the current upgrade device, it is further required to determine whether an identifier storage file exists in the current upgrade device, and if so, step S10 is executed; if the identifier storage file does not exist in the current upgrading equipment, the identifier storage file needs to be created under a preset file path, the preferred file path of the identifier storage file is/cache/recovery, the identifier storage file cannot be erased due to upgrading interruption caused by abnormal conditions such as power failure, different partition identifiers in the identifier storage file can be separated by line changing symbols, of course, a user or operation and maintenance personnel can set a storage path for the identifier storage file according to needs, and the identifier storage file can be erased due to upgrading interruption caused by abnormal conditions such as power failure.
Of course, if the current upgrade device is based on another system, the current upgrade device is performed before the current upgrade device enters the system upgrade mode corresponding to the system (similar to the recovery mode of the android system), and the system upgrade is performed on the current upgrade device.
According to the embodiment, the identification storage file is automatically created in the above manner, so that a realization basis can be provided for continuous upgrading of the equipment after power interruption and restarting in the upgrading process.
Further, a third embodiment of the system upgrading method according to the present invention is provided, where after the step S30, the method further includes:
detecting whether the identifier storage file has a partition identifier of a partition to be processed of a next system;
if yes, the partition to be processed of the next system is not upgraded;
if not, upgrading the partition to be processed of the next system.
In this embodiment, the system upgrade process is to upgrade partitions of the device according to a preset upgrade sequence based on a preset upgrade script, and if it is detected that a partition identifier of a partition to be processed of the system exists in an identifier storage file, it indicates that the upgrade of the partition to be processed of the system has been completed, and the upgrade does not need to be performed again, so that the partition to be processed of the system is not upgraded this time, and then the upgrade of a next partition to be processed of the system is confirmed according to the preset upgrade script, specifically, it is detected whether a partition identifier of a next partition to be processed of the system exists in the identifier storage file, and if the partition identifier does not exist, the next partition to be processed of the system is upgraded; if the upgrade of the next system to-be-processed partition is finished, the upgrade of the subsequent partitions is confirmed continuously according to the preset upgrade script, and therefore the upgrade of all the partitions is finished successfully.
By the method, when the equipment re-executes the upgrading script, the repeated upgrading of the upgraded partitions can be avoided.
Further, after the step S30, the method further includes:
and after the upgrading of the system to-be-processed partition is finished, recording the partition identification of the system to-be-processed partition in the identification storage file.
In this embodiment, in the system upgrade process, the partition identifier of the partition that has completed the upgrade is recorded by the identifier storage file, specifically, the partition identifier of the partition is recorded in the identifier storage file every time one partition is upgraded.
Further, the partition identifiers of the two partitions may be recorded in the identifier storage file every time the two partitions are upgraded, and the recording frequency of the partition identifiers of the partitions that have been upgraded, that is, the frequency of how many partitions per liter of hierarchy record the partition identifiers of the partitions, may be set by a user or an operation and maintenance person as needed. The partition identifier may be used to distinguish different partitions, and the partition identifiers of different partitions are different. The operation and maintenance personnel may set a corresponding partition identifier for each partition of the device in advance, where the partition identifier may be a name or a number of each partition, or a name or a number of an upgrade stage corresponding to each partition.
Further, after the step S30, the method further includes:
and after upgrading all the partitions, deleting the identification storage file.
In this embodiment, after the upgrade of all the partitions is completed, that is, after a complete system upgrade is completed, the device deletes the identifier storage file, so as to avoid that the identifier storage file of the system upgrade at this time affects the next system upgrade.
Further, after the step S30, the method further includes:
after upgrading is completed for all partitions, the BCB block is cleared.
Generally, Android has three startup modes: the system comprises a Fastboot mode, a Recovery mode and a MainSystem mode, wherein in the Recovery mode, the device writes a starting parameter of the system into a BCB (boot control block, a start control information block), so as to ensure that the device is in an abnormal condition such as crash or abnormal power failure in the process of system upgrade, and when the device is restarted next time, the Bootloader guides the device to enter the Recovery mode according to an indication in the BCB block, thereby continuing the system upgrade operation. After the upgrade of all the partitions is completed, namely after one complete System upgrade is completed, the device deletes the identification storage file to avoid the influence of the identification storage file of the System upgrade on the next System upgrade, and can also clear the BCB block, namely clear the indication in the BCB block, so that the device enters a Main System mode, namely a Main System mode, which is a normal working mode entered by the Android normal boot when the device is restarted next time.
The Bootloader is a first section of code executed by the embedded system after being powered on, and after the Bootloader completes initialization of the CPU and related hardware, the Bootloader loads an operating system image or a solidified embedded application program into a memory and then jumps to a space where the operating system is located, so as to start the operating system to run.
Of course, if the current upgrade device is based on other systems, in this embodiment, after upgrading all the partitions, data similar to the BCB block of the android system is cleared, so that the device enters a normal operating mode when being restarted next time, that is, a mode that a user can use the device normally.
The invention also provides a system upgrading device.
Referring to fig. 3, fig. 3 is a functional module schematic diagram of a first embodiment of the system upgrading apparatus of the present invention. The system upgrading device comprises:
the identifier detection module 10 is configured to detect whether a partition identifier of a partition to be processed in the system exists in the identifier storage file;
a maintaining module 20, configured to not upgrade the partition to be processed of the system if the partition to be processed of the system is updated;
and the upgrading module 30 is used for upgrading the to-be-processed partition of the system if the to-be-processed partition is not updated.
Further, the system upgrading apparatus further includes:
the file detection module is used for detecting whether the identification storage file exists in the current upgrading equipment or not;
the file creating module is used for creating the identification storage file under the preset file path of the current upgrading equipment if the current upgrading equipment is not upgraded;
and the identification detection module is also used for detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file if the identification detection module is used for detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file.
Further, the maintaining module includes:
the next system to-be-processed partition detection unit is used for detecting whether the partition identification of the next system to-be-processed partition exists in the identification storage file;
a next system to-be-processed partition maintaining unit, configured to not upgrade the next system to-be-processed partition if the next system to-be-processed partition is determined to be the next system to-be-processed partition;
and the next system to-be-processed partition upgrading unit is used for upgrading the next system to-be-processed partition if the next system to-be-processed partition is not upgraded.
Further, the system upgrading apparatus further includes:
and the deleting module is used for deleting the identification storage file after upgrading of all the partitions is completed.
Further, the system upgrading apparatus further includes:
the download checking module is used for downloading the upgrade data packet and carrying out data integrity checking on the upgrade data packet;
the re-downloading verification module is used for re-downloading the upgrading data packet and carrying out data integrity verification on the newly-downloaded upgrading data packet if the data integrity verification of the upgrading data packet is not passed;
and the identification detection module is also used for detecting whether the partition identification of the partition to be processed of the system exists in the identification storage file or not if the data integrity of the upgrading data packet is verified.
Correspondingly, the upgrading module comprises:
and the data packet upgrading unit is used for upgrading the to-be-processed subarea of the system based on the upgrading data packet if the to-be-processed subarea of the system is not upgraded.
Further, the system upgrading apparatus further includes:
the version number acquisition module is used for acquiring the latest version number corresponding to the system and the version number corresponding to the system which is started currently;
a version number comparison module for comparing the latest version number corresponding to the system with the version number corresponding to the system which is currently started;
the download checking module is further configured to, if the latest version number corresponding to the system is not consistent with the version number corresponding to the currently enabled system, execute the following steps: and downloading an upgrading data packet and carrying out data integrity verification on the upgrading data packet.
Further, the system upgrading apparatus further includes:
and the partition identification recording module is used for recording the partition identification of the partition to be processed in the system into the identification storage file after the partition to be processed in the system is upgraded.
The specific implementation of the system upgrading device of the present invention is basically the same as that of the above system upgrading method, and is not described herein again.
In addition, the embodiment of the invention also provides a storage medium.
The storage medium has stored thereon a system upgrade program, which when executed by the processor implements the steps of the system upgrade method as described above.
The specific implementation of the storage medium of the present invention is substantially the same as the embodiments of the system upgrade method described above, and will not be described herein again.
The present invention is described in connection with the accompanying drawings, but the present invention is not limited to the above embodiments, which are only illustrative and not restrictive, and those skilled in the art can make various changes without departing from the spirit and scope of the invention as defined by the appended claims, and all changes that come within the meaning and range of equivalency of the specification and drawings that are obvious from the description and the attached claims are intended to be embraced therein.

Claims (10)

1. A system upgrade method, characterized in that the system upgrade method comprises the steps of:
detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
if yes, the to-be-processed partition of the system is not upgraded;
if not, upgrading the to-be-processed partition of the system.
2. The system upgrade method according to claim 1, wherein, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further comprises:
detecting whether the identification storage file exists in the current upgrading equipment or not;
if not, creating the identification storage file under a preset file path of the current upgrading equipment;
if yes, executing the following steps: and detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file.
3. The method for upgrading a system according to claim 1, wherein if yes, after the step of not upgrading the partition to be processed of the system, the method further comprises:
detecting whether the identifier storage file has a partition identifier of a partition to be processed of a next system;
if yes, the partition to be processed of the next system is not upgraded;
if not, upgrading the partition to be processed of the next system.
4. The system upgrading method according to claim 1, wherein if not, after the step of upgrading the partition to be processed of the system, the method further comprises:
and after upgrading all the partitions, deleting the identification storage file.
5. The system upgrade method according to claim 1, wherein, before the step of detecting whether the partition identifier of the partition to be processed in the system exists in the identifier storage file, the method further comprises:
downloading an upgrading data packet, and carrying out data integrity verification on the upgrading data packet;
if the data integrity of the upgrade data packet is not verified, the upgrade data packet is downloaded again, and the data integrity of the newly downloaded upgrade data packet is verified;
if the data integrity of the upgrade data packet passes the verification, executing the following steps: detecting whether a partition identifier of a partition to be processed of the system exists in the identifier storage file;
correspondingly, if not, the step of upgrading the to-be-processed partition of the system comprises the following steps:
and if not, upgrading the to-be-processed partition of the system based on the upgrading data packet.
6. The system upgrade method according to claim 5, wherein before the step of downloading the upgrade data package and performing data integrity check on the upgrade data package, the method further comprises:
acquiring the latest version number corresponding to the system and the version number corresponding to the system which is started currently;
comparing the latest version number corresponding to the system with the version number corresponding to the system which is started currently;
if the latest version number corresponding to the system is inconsistent with the version number corresponding to the currently started system, executing the following steps: and downloading the upgrade data packet.
7. The system upgrading method according to any one of claims 1 to 6, wherein, if not, after the step of upgrading the partition to be processed of the system, the method further comprises:
and after the upgrading of the system to-be-processed partition is finished, recording the partition identification of the system to-be-processed partition in the identification storage file.
8. A system upgrade apparatus, comprising:
the identification detection module is used for detecting whether the partition identification of the system to-be-processed partition exists in the identification storage file;
the maintaining module is used for not upgrading the to-be-processed partition of the system if the to-be-processed partition of the system is in the presence of the maintenance module;
and the upgrading module is used for upgrading the to-be-processed partition of the system if the to-be-processed partition is not updated.
9. A system upgrade device, characterized in that the system upgrade device comprises a memory, a processor and a system upgrade program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the system upgrade method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a system upgrade program, which when executed by a processor implements the steps of the system upgrade method according to any one of claims 1-7.
CN201911422473.XA 2019-12-30 2019-12-30 System upgrading method, device, equipment and storage medium Pending CN111158729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911422473.XA CN111158729A (en) 2019-12-30 2019-12-30 System upgrading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911422473.XA CN111158729A (en) 2019-12-30 2019-12-30 System upgrading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111158729A true CN111158729A (en) 2020-05-15

Family

ID=70560722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911422473.XA Pending CN111158729A (en) 2019-12-30 2019-12-30 System upgrading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111158729A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651186A (en) * 2020-05-29 2020-09-11 歌尔科技有限公司 Earphone, program upgrading method thereof, control device and readable storage medium
CN112181467A (en) * 2020-10-10 2021-01-05 北京字节跳动网络技术有限公司 Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN113656051A (en) * 2021-04-27 2021-11-16 苏州佳世达电通有限公司 Automatic upgrading method for android system equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488491A (en) * 2012-06-11 2014-01-01 腾讯科技(深圳)有限公司 Method for carrying out system upgrade on terminal and terminal
CN105760200A (en) * 2016-02-26 2016-07-13 晨星半导体股份有限公司 Terminal device and system updating method thereof
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
CN109947449A (en) * 2019-03-18 2019-06-28 Oppo广东移动通信有限公司 Method for upgrading system, device, storage medium and electronic equipment
CN110502264A (en) * 2019-08-23 2019-11-26 深圳融安网络科技有限公司 Method for upgrading system, terminal and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488491A (en) * 2012-06-11 2014-01-01 腾讯科技(深圳)有限公司 Method for carrying out system upgrade on terminal and terminal
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
CN105760200A (en) * 2016-02-26 2016-07-13 晨星半导体股份有限公司 Terminal device and system updating method thereof
CN109947449A (en) * 2019-03-18 2019-06-28 Oppo广东移动通信有限公司 Method for upgrading system, device, storage medium and electronic equipment
CN110502264A (en) * 2019-08-23 2019-11-26 深圳融安网络科技有限公司 Method for upgrading system, terminal and readable storage medium storing program for executing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651186A (en) * 2020-05-29 2020-09-11 歌尔科技有限公司 Earphone, program upgrading method thereof, control device and readable storage medium
CN111651186B (en) * 2020-05-29 2023-10-03 歌尔科技有限公司 Earphone, program upgrading method thereof, control device and readable storage medium
CN112181467A (en) * 2020-10-10 2021-01-05 北京字节跳动网络技术有限公司 Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN112181467B (en) * 2020-10-10 2023-11-14 北京字节跳动网络技术有限公司 Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN113656051A (en) * 2021-04-27 2021-11-16 苏州佳世达电通有限公司 Automatic upgrading method for android system equipment

Similar Documents

Publication Publication Date Title
CN106843957B (en) System firmware upgrading method and device
US10127057B2 (en) Method and apparatus for dynamically implementing application function
CN103377094B (en) Method for monitoring abnormality and device
CN111158729A (en) System upgrading method, device, equipment and storage medium
CN106325929B (en) Firmware upgrading method, firmware upgrading device, refrigerator and server
CN105138347A (en) Difference upgrade patch generating method, software upgrading method and corresponding apparatus
CN109062598A (en) A kind of safe OTA upgrade method and system
CN111258850B (en) Method and device for updating software information based on Linux system
CN110597545B (en) Hot patch Ding Zhineng upgrading method and system based on OTA component
CN106210877A (en) The method for upgrading system of intelligent television and device
CN113608763A (en) Vehicle-mounted OTA upgrading method, device, equipment and operation machine
CN111399862A (en) Batch installation method and device of Windows missing driver and computer equipment
CN117056115B (en) Application program repairing method and device, storage medium and electronic equipment
CN112905230A (en) Application program management method and device, terminal equipment and storage medium
CN111198703A (en) Version upgrading method, system, equipment and medium
WO2019137280A1 (en) Terminal anomaly repair method, apparatus, mobile terminal, and storage medium
CN107766068B (en) Application system patch installation method and device, computer equipment and storage medium
KR101434094B1 (en) Blocking harmful application by intent monitoring in android platform
CN112579330B (en) Processing method, device and equipment for abnormal data of operating system
CN114647424A (en) ECU application program updating method, device, system, storage medium and electronic equipment
CN112312213A (en) Upgrading method of digital television system and related device
CN111338674A (en) Instruction processing method, device and equipment
CN110825406A (en) Software upgrading method and related equipment
CN116707819B (en) Construction method of vehicle OTA upgrading security mechanism
CN110515642B (en) Application program upgrading method and system

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