CN112416411B - Upgrading method and device, equipment end, server and computer readable medium - Google Patents

Upgrading method and device, equipment end, server and computer readable medium Download PDF

Info

Publication number
CN112416411B
CN112416411B CN201910786357.XA CN201910786357A CN112416411B CN 112416411 B CN112416411 B CN 112416411B CN 201910786357 A CN201910786357 A CN 201910786357A CN 112416411 B CN112416411 B CN 112416411B
Authority
CN
China
Prior art keywords
upgraded
storage partition
file
starting
system image
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
CN201910786357.XA
Other languages
Chinese (zh)
Other versions
CN112416411A (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.)
Baidu Online Network Technology Beijing Co Ltd
Shanghai Xiaodu Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Shanghai Xiaodu 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 Beijing Baidu Netcom Science and Technology Co Ltd, Shanghai Xiaodu Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910786357.XA priority Critical patent/CN112416411B/en
Publication of CN112416411A publication Critical patent/CN112416411A/en
Application granted granted Critical
Publication of CN112416411B publication Critical patent/CN112416411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides an upgrade method for a system of an upgrade device side, where the device side includes a first storage partition, a second storage partition, and a third storage partition, the second storage partition is used for storing a file to be upgraded when a current boot loader and a current system image file are stored in the third storage partition, and the third storage partition is used for storing a file to be upgraded when a current boot loader and a current system image file are stored in the second storage partition, the upgrade method includes: when the equipment terminal works based on the current system image file, receiving a file to be upgraded; writing the file to be upgraded into a storage partition for storing the file to be upgraded; when the equipment end is powered off and restarted, the starting guide file in the first storage partition jumps to a to-be-upgraded starting loader, and jumps to the to-be-upgraded system image file, so that the system upgrading of the equipment end is completed. The present disclosure also provides an upgrade apparatus, a device side, a server, and a computer readable medium.

Description

Upgrading method and device, equipment end, server and computer readable medium
Technical Field
The embodiment of the disclosure relates to the field of system upgrading, in particular to a method and a device for upgrading a system of an equipment side, the equipment side, a server and a computer readable medium.
Background
At present, when an embedded device is upgraded, the embedded device generally needs to enter an over-the-air (OTA) mode, and in the OTA mode, the embedded device cannot normally work and can only work normally after the system upgrade is completed, so that user experience is seriously affected.
Disclosure of Invention
The embodiment of the disclosure provides an upgrading method and device for a system of an equipment end, the equipment end, a server and a computer readable medium.
In a first aspect, an embodiment of the present disclosure provides an upgrade method for a system of an upgrade device, where the device includes a memory, where the memory includes a first storage partition, a second storage partition and a third storage partition that are set in advance, where the first storage partition is used to store a boot file, the second storage partition is used to store a file to be upgraded when a current boot loader and a current system image file are stored in the third storage partition, and the third storage partition is used to store a file to be upgraded when a current boot loader and a current system image file are stored in the second storage partition; the upgrading method comprises the following steps:
when the equipment end works based on the current system image file, receiving a file to be upgraded, wherein the file to be upgraded comprises a loading program to be upgraded and a system image file to be upgraded;
Writing the to-be-upgraded starting loader and the to-be-upgraded system image file into storage partitions used for storing the to-be-upgraded file in the second storage partition and the third storage partition;
when the equipment end is powered off and restarted, after the starting guide file is operated, the starting loading program to be upgraded is jumped to operate;
and after the loading program to be upgraded is started, the system image file to be upgraded is jumped to run, and the system upgrading of the equipment end is completed.
In some embodiments, the second storage partition currently stores the current boot loader and the current system image file; the third storage partition is used for storing files to be upgraded, and the third storage partition is currently a blank partition or is currently stored with a historical starting loader and a historical system image file;
after the start-up guide file is run, before the start-up loader to be upgraded is jumped to run, the method further comprises the steps of: copying the to-be-upgraded starting loader to the second storage partition, and enabling the to-be-upgraded starting loader to cover the current starting loader currently stored in the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
After the start-up guide file is operated, the to-be-upgraded start-up loader is operated in a jumping mode, and the method comprises the following steps: and after the starting guide file is operated, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
In some embodiments, after writing the boot loader to be upgraded and the system image file to be upgraded to the storage partitions used for storing the file to be upgraded in the second storage partition and the third storage partition, the method further includes:
and modifying a state flag bit corresponding to the first storage partition into a first state, wherein the first state is used for indicating that the step of copying the boot loader to be upgraded to the second storage partition is executed when the equipment end is powered off and restarted.
In some embodiments, before copying the boot loader to be upgraded to the second storage partition and causing the boot loader to be upgraded to overwrite the current boot loader currently stored in the second storage partition, the method further includes:
detecting whether a state flag bit corresponding to the first storage partition is the first state or a preset second state, wherein the second state is used for indicating that when the equipment end is powered off and restarted, the equipment end jumps to the starting address of the second storage partition after the starting guide file is operated;
And if the state flag bit corresponding to the first storage partition is detected to be in the first state, executing the step of copying the to-be-upgraded starting loader to the second storage partition.
In some embodiments, the third storage partition currently stores the current boot loader and the current system image file; the second storage partition is used for storing the file to be upgraded;
the writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition and the storage partition used for storing the file to be upgraded in the third storage partition includes: writing the to-be-upgraded starting loader and the to-be-upgraded system image file into the second storage partition to cover the current starting loader and the historical system image file which are currently stored in the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
when the equipment end is powered off and restarted, after the starting guide file is operated, the to-be-upgraded starting loading program is jumped to be operated, and the method comprises the following steps: and when the equipment end is powered off and restarted, after the starting guide file is operated, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
In some embodiments, the memory further comprises a particular memory partition; after receiving the file to be upgraded, the method further comprises the following steps: writing the boot loader to be upgraded into the specific storage partition;
if the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, and the equipment end is powered off and restarted, the upgrading method further comprises the following steps:
copying the current start loading program to the second storage partition, wherein the start jump address of the current start loading program is the starting address of the second storage partition, so that the equipment end can work based on the current system image file after restarting;
when the equipment end works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, enabling a starting jump address of the to-be-upgraded starting loader to be a starting address of the second storage partition, and continuing to write the to-be-upgraded system image file into the second storage partition.
In some embodiments, after writing the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, further comprising:
And modifying the state flag bit corresponding to the first storage partition into a second state, wherein the second state is used for indicating that the starting address of the second storage partition is jumped to after the starting guide file is operated when the equipment end is powered off and restarted.
In some embodiments, after the running the boot file, before jumping to the start address of the second storage partition to run the boot loader to be upgraded, the method further includes:
detecting whether a state flag bit corresponding to the first storage partition is in the second state or the first state, wherein the first state is used for indicating that the step of copying the current starting loader to the second storage partition is executed when the equipment end is powered off and restarted;
if the state flag bit corresponding to the first storage partition is detected to be in the second state, executing the step of jumping to the starting address of the second storage partition to run the to-be-upgraded starting loader after running the starting guide file;
and if the state flag bit corresponding to the first storage partition is detected to be in the first state, executing the step of copying the current start loader to the second storage partition, wherein the start jump address of the current start loader is the start address of the second storage partition, so that the equipment end can work based on the current system image file after restarting.
In a second aspect, an embodiment of the present disclosure provides an upgrade apparatus for a system of an apparatus side, where the apparatus side includes a memory, where the memory includes a first storage partition, a second storage partition and a third storage partition that are set in advance, where the first storage partition is used to store a boot file, the second storage partition is used to store a file to be upgraded when a current boot loader and a current system image file are stored in the third storage partition, and the third storage partition is used to store a file to be upgraded when a current boot loader and a current system image file are stored in the second storage partition; the upgrading device comprises:
the receiving module is used for receiving a file to be upgraded when the equipment end works based on the current system image file, wherein the file to be upgraded comprises a loading program to be upgraded and a system image file to be upgraded;
the writing module is used for writing the boot loader to be upgraded and the system image file to be upgraded into the storage partitions used for storing the file to be upgraded in the second storage partition and the third storage partition;
the operation module is used for jumping to operate the to-be-upgraded starting loading program after the starting guide file is operated when the equipment end is powered off and restarted; and after the loading program to be upgraded is started, the system image file to be upgraded is jumped to run, and the system upgrading of the equipment end is completed.
In some embodiments, the second storage partition currently stores the current boot loader and the current system image file; the third storage partition is used for storing files to be upgraded, and the third storage partition is currently a blank partition or is currently stored with a historical starting loader and a historical system image file;
the upgrading device further comprises a copying module, wherein the copying module is used for copying the to-be-upgraded starting loading program to the second storage partition before jumping to run the to-be-upgraded starting loading program after the running module runs the starting guide file when the equipment end is powered off and restarted, and enabling the to-be-upgraded starting loading program to cover the current starting loading program currently stored in the second storage partition, and a starting jumping address of the to-be-upgraded starting loading program is a starting address of the second storage partition;
the operation module is specifically configured to jump to the start address of the second storage partition after the start boot file is operated, so as to operate the boot loader to be upgraded.
In some embodiments, the system further includes a state modifying module, where the state modifying module is configured to modify, after the writing module writes the boot loader to be upgraded and the system image file to be upgraded to a storage partition of the second storage partition and the third storage partition that is used to store the file to be upgraded, a state flag bit corresponding to the first storage partition into a first state, where the first state is used to instruct, when the device end is powered off and restarted, to trigger the copy module to execute a step of copying the boot loader to be upgraded to the second storage partition.
In some embodiments, the system further includes a detection module, where the detection module is configured to copy, when the device side is powered off and restarted, the boot loader to be upgraded to the second storage partition, and before the boot loader to be upgraded covers the current boot loader currently stored in the second storage partition, detect whether a status flag bit corresponding to the first storage partition is the first status or a preset second status, where the second status is used to indicate that when the device side is powered off and restarted, trigger the operation module to jump to a start address of the second storage partition after the boot file is executed; and triggering the copying module to execute the step of copying the to-be-upgraded starting loader to the second storage partition when the state flag bit corresponding to the first storage partition is detected to be in the first state.
In some embodiments, the third storage partition currently stores the current boot loader and the current system image file; the second storage partition is used for storing the file to be upgraded;
The writing module is specifically configured to write the boot loader to be upgraded and the system image file to be upgraded into the second storage partition, so as to cover the current boot loader and the historical system image file currently stored in the second storage partition, where a boot jump address of the boot loader to be upgraded is a start address of the second storage partition;
the operation module is specifically configured to, when the device end is powered off and restarted, jump to the start address of the second storage partition after the boot file is operated to operate the boot loader to be upgraded.
In some embodiments, the memory further comprises a particular memory partition; the upgrading device also comprises a copying module;
the writing module is further configured to write the boot loader to be upgraded to the specific storage partition after the receiving module receives the file to be upgraded;
the copying module is configured to copy the current boot loader to the second storage partition if the writing module does not completely write the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, and the boot jump address of the current boot loader is the start address of the second storage partition when the device is restarted after power failure, so that the device can work based on the current system image file after restarting; when the equipment end works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
The writing module is further configured to continue writing the system image file to be upgraded to the second storage partition after the copying module copies the boot loader to be upgraded in the specific storage partition to the second storage partition.
In some embodiments, the system further includes a state modification module, where the state modification module is configured to modify, after the write module writes the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, a state flag bit corresponding to the first storage partition to a second state, where the second state is used to indicate that when the device side is powered off and restarted, trigger the operation module to jump to a start address of the second storage partition after the boot file is operated.
In some embodiments, the system further includes a detection module, where the detection module is configured to detect, when the device side is powered off and restarted, whether a status flag bit corresponding to the first storage partition is the second status or the first status, where the first status is used to indicate that the copy module is triggered to execute a step of copying the current boot loader to the second storage partition when the device side is powered off and restarted, before the operation module jumps to a start address of the second storage partition to operate the boot loader to be upgraded;
When the detection module detects that the state flag bit corresponding to the first storage partition is in the second state, triggering the operation module to execute the step of jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader after operating the starting guide file;
and if the detection module detects that the state flag bit corresponding to the first storage partition is in the first state, triggering the copying module to execute the step of copying the current starting loader to the second storage partition, wherein the starting jump address of the current starting loader is the starting address of the second storage partition, so that the equipment end can work based on the current system image file after restarting.
In a third aspect, an embodiment of the present disclosure provides an apparatus side, including an upgrading device provided in any one of the foregoing embodiments.
In a fourth aspect, embodiments of the present disclosure provide a server, including:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the upgrade method provided by any of the embodiments described above.
In a fifth aspect, embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed, implements the upgrade method provided in any of the above embodiments.
According to the upgrading method and device for the system of the equipment end, the server and the computer readable medium, when the equipment end works based on the current system image file, the file to be upgraded is received, the starting loading program to be upgraded and the system image file to be upgraded are written into the storage partition for storing the file to be upgraded, when the equipment end is powered off and restarted, the starting loading program to be upgraded is jumped from the starting guide file, and then the starting loading program to be upgraded is jumped to the system image file to be upgraded, so that the system upgrading of the equipment end, namely OTA upgrading, is completed under the condition that a user does not feel, the whole upgrading process does not influence the normal use of the equipment end by the user, and therefore the user experience is improved.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the disclosure, and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, without limitation to the disclosure. The above and other features and advantages will become more readily apparent to those skilled in the art by describing in detail exemplary embodiments with reference to the attached drawings, in which:
Fig. 1 is a flowchart of an upgrade method for upgrading a system at a device side according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of another method for upgrading a system at a device end according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a memory according to an embodiment of the disclosure;
FIG. 4 is a schematic diagram of a structure of a memory after writing a boot loader to be upgraded and a system image file to be upgraded to a third memory partition;
FIG. 5 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of another memory according to an embodiment of the disclosure;
FIG. 8 is a schematic diagram of a memory after writing a boot loader to be upgraded and a system image file to be upgraded to a second memory partition;
FIG. 9 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure;
FIG. 10 is a flowchart of a method for upgrading a system at a device side according to another embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an upgrade apparatus for upgrading a system at a device side according to an embodiment of the present disclosure;
Fig. 12 is a schematic structural diagram of another upgrade apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to better understand the technical solutions of the present disclosure for those skilled in the art, the following describes in detail an upgrade method and apparatus for upgrading a system at a device side, a server, and a computer readable medium provided in the present disclosure with reference to the accompanying drawings.
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Embodiments described herein may be described with reference to plan and/or cross-sectional views with the aid of idealized schematic diagrams of the present disclosure. Accordingly, the example illustrations may be modified in accordance with manufacturing techniques and/or tolerances. Thus, the embodiments are not limited to the embodiments shown in the drawings, but include modifications of the configuration formed based on the manufacturing process. Thus, the regions illustrated in the figures have schematic properties and the shapes of the regions illustrated in the figures illustrate the particular shapes of the regions of the elements, but are not intended to be limiting.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Fig. 1 is a flowchart of an upgrade method for upgrading a system at a device side according to an embodiment of the present disclosure, where the upgrade method may be performed by an upgrade apparatus, and the apparatus may be implemented by software and/or hardware, and the apparatus may be integrated in the device side or a server. As shown in fig. 1, the upgrade method includes:
And 11, when the equipment terminal works based on the current system image file, receiving a file to be upgraded, wherein the file to be upgraded comprises a start loader to be upgraded and the system image file to be upgraded.
In the embodiment of the disclosure, the device side includes a memory, where the memory includes a first memory partition, a second memory partition, and a third memory partition that are preset. The first storage partition is used for storing a starting guide file, and a starting jump address of the starting guide file is a starting address of the first storage partition; the second storage partition is used for storing the files to be upgraded when the current boot loader and the current system image file are stored in the third storage partition, and the third storage partition is used for storing the files to be upgraded when the current boot loader and the current system image file are stored in the second storage partition; the third storage partition is a temporary file (Temp) partition of the memory. The memory may be a physical memory such as a hard disk, flash memory (Flash), etc.
The device side is used for starting and guiding, supporting OTA upgrading, receiving an OTA upgrading packet and writing the OTA upgrading packet into a system mirror image of a memory (such as Flash); the current system image file is a system image file which is used for normal work (such as voice processing, interaction with a terminal and a client) at the equipment end at present; the file to be upgraded is the OTA upgrade package and comprises a boot loader to be upgraded and a system image file to be upgraded, wherein in the OTA upgrade package, the former part of data is the boot loader to be upgraded and the latter part of data is the system image file to be upgraded; the file to be upgraded (OTA upgrade package) is stored in a server corresponding to the equipment end, wherein the system image file to be upgraded is a system image file for upgrading a system of the equipment end.
In the embodiment of the present disclosure, the start address of the first storage partition, the start address of the second storage partition, and the start address of the third storage partition are all preset, specifically may be set according to actual needs, and the embodiment of the present disclosure does not specifically limit this.
In this embodiment of the present disclosure, the boot file is actually a boot loader (Bootloader), where the boot file is cured when shipped from the factory, and the start address of the second storage partition is set in the boot file, so that the boot file can automatically jump to the start address of the second storage partition after operation when the device restarts to operate the boot file each time.
The upgrading method provided by the embodiment of the disclosure can be executed by the equipment end. In step 11, when the device side works based on the current system image file and the device side needs to perform system upgrade, the device side receives a file to be upgraded including a boot loader to be upgraded and the system image file to be upgraded.
In the embodiment of the disclosure, the current boot loader is provided with the boot jump address of the current system image file, so that the device side can automatically jump to the boot jump address of the current system image file to run the current system image file after running the current boot loader, thereby enabling the device side to work normally based on the current system image file.
In the embodiment of the present disclosure, when the current boot loader and the current system image file are stored in the third storage partition, the current boot loader is stored in the second storage partition, and in the second storage partition, the boot jump address of the current boot loader is the start address of the second storage partition. Therefore, before the equipment end is upgraded, when the equipment end is restarted, the equipment end can jump to the starting address of the second storage partition after the boot file is started to run the current starting loader, so that the current system image file is jumped and transferred, and the equipment end can work based on the current system image file.
And step 12, writing the boot loader to be upgraded and the system image file to be upgraded into the storage partitions used for storing the file to be upgraded in the second storage partition and the third storage partition.
In the embodiment of the present disclosure, if the current boot loader and the current system image file are stored in the second storage partition, the third storage partition is a storage partition for storing the file to be upgraded, and at this time, in step 12, the boot loader to be upgraded and the system image file to be upgraded are written into the third storage partition. Specifically, the start loader to be upgraded is written from the start address of the third storage partition, and then the system image file to be upgraded is written.
If the current boot loader and the current system image file are stored in the third storage partition, the second storage partition is a storage partition for storing the file to be upgraded, and at this time, in step 12, the boot loader to be upgraded and the system image file to be upgraded are written into the second storage partition. Specifically, the start loader to be upgraded is written from the start address of the second storage partition, and then the system image file to be upgraded is written.
And step 13, when the equipment end is powered off and restarted, after the boot file is operated, jumping to the operation line to upgrade and start the loading program.
In the embodiment of the present disclosure, if the current boot loader and the current system image file are stored in the second storage partition, in step 12, after writing the file to be upgraded to the third storage partition, the boot loader to be upgraded needs to be copied to the start address of the second storage partition. Thus, in step 13, after running the boot file from the start address of the first storage partition, it is possible to jump to the start address of the second storage partition to run the boot loader to be upgraded.
In the embodiment of the present disclosure, if the current boot loader and the current system image file are stored in the third storage partition, after writing the file to be upgraded to the second storage partition in step 12, in step 13, after running the boot file from the start address of the first storage partition, the boot loader directly jumps to the start address of the second storage partition to run the boot loader to be upgraded.
And 14, after the loading program to be upgraded is started, the system image file to be upgraded is transferred in a skip mode, and system upgrading of the equipment end is completed.
In step 14, since the start jump address of the system image file to be upgraded (the start address of the system image file to be upgraded stored in the storage partition for storing the file to be upgraded) is set in the start loader to be upgraded, the device side automatically jumps to the start jump address of the system image file to be upgraded to run the system image file to be upgraded after running the start loader to be upgraded, thereby completing the system upgrade of the device side.
After the system upgrading of the equipment end is completed, the to-be-upgraded starting loading program is used as a current starting loading program, and the to-be-upgraded system image file is used as a current system image file to wait for next system updating.
In the embodiment of the present disclosure, the device side may be an embedded device side, and the embedded device side may be an embedded device side that completes a voice processing function and an interaction function with a terminal and a client in an environment with a low chip main frequency, a memory and a Flash (Flash), for example, the embedded device side is an intelligent voice vehicle-mounted bracket, and the implementation manner of the device side is not particularly limited in the embodiment of the present disclosure.
When the traditional intelligent voice vehicle-mounted support needs to be subjected to system upgrading, the intelligent voice vehicle-mounted support firstly needs to enter a special OTA mode, in the OTA mode, the intelligent voice vehicle-mounted support cannot carry out voice processing and uplink and downlink of audio data, only OTA upgrading packets can be received, and in the time of about 10 minutes, a user cannot normally use the voice function of the intelligent voice vehicle-mounted support, so that user experience is seriously affected. By the upgrade method provided by the embodiment of the disclosure, the intelligent voice vehicle-mounted support can still work normally when the system is upgraded, namely, the intelligent voice vehicle-mounted support can still receive an OTA upgrade packet in the system upgrade process, and can normally perform voice processing and uplink and downlink of audio data, so that the experience of an intelligent voice vehicle-mounted support user is improved.
According to the upgrading method for the system of the equipment end, when the equipment end works based on the current system image file, the file to be upgraded is received, the to-be-upgraded starting loading program and the to-be-upgraded system image file are written into the storage partition for storing the to-be-upgraded file, when the equipment end is powered off and restarted, the starting loading program is jumped from the starting guiding file to the to-be-upgraded starting loading program, and then the to-be-upgraded starting loading program is jumped to the to-be-upgraded system image file, so that under the condition that a user does not feel, the system upgrading, namely OTA upgrading, of the equipment end is completed, and the whole upgrading process does not influence the normal use of the equipment end by the user, so that the user experience is improved.
Fig. 2 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure, where the upgrading method may be performed by an upgrading apparatus, and the apparatus may be implemented by software and/or hardware, and the apparatus may be integrated in the device side or a server. As shown in fig. 2, the upgrade method includes:
and step 21, when the equipment terminal works based on the current system image file, receiving a file to be upgraded, wherein the file to be upgraded comprises a start loading program to be upgraded and the system image file to be upgraded.
In the embodiment of the present disclosure, the device side includes a memory, and fig. 3 is a schematic structural diagram of a memory in the embodiment of the present disclosure, and as shown in fig. 3, the memory includes a first memory partition 1, a second memory partition 2, and a third memory partition 3 that are preset. The first storage partition 1 is used for storing a starting guide file, and in the first storage partition 1, a starting jump address of the starting guide file is a starting address of the first storage partition 1; the second storage partition 2 currently stores a current boot loader (Bootloader) and a current system image file, and in the second storage partition 2, a boot jump address of the current boot loader is a start address of the second storage partition 2; the third storage partition 3 is a blank partition or the third storage partition 3 currently stores a historical boot loader (Bootloader) and a historical system image file.
In the embodiment of the present disclosure, as shown in fig. 3, the memory further includes a memory partition for storing Factory Data (Factory Data) and a memory partition for storing User Data (User Data).
In addition, for other descriptions of step 21 in the embodiments of the present disclosure, reference may be made to the description of step 11 in the foregoing embodiments, which is not repeated here.
It may be appreciated that, in the upgrade method according to the embodiment of the present disclosure, the second storage partition currently stores the current boot loader and the current system image file, the third storage partition is a blank partition or the third storage partition currently stores the historical boot loader and the historical system image file, and the third storage partition is executed on the premise that the third storage partition is used for storing the file to be upgraded.
And step 22, writing the boot loader to be upgraded and the system image file to be upgraded into the third storage partition.
In the embodiment of the present disclosure, since the second storage partition currently stores the current boot loader and the current system image file, the third storage partition serves as a storage partition for storing the file to be upgraded.
In the embodiment of the present disclosure, if the third storage partition is a blank partition, in step 22, the boot loader to be upgraded and the system image file to be upgraded are directly written into the third storage partition; if the third storage partition currently stores the historical boot loader and the historical system image file, in step 12, the boot loader to be upgraded and the system image file to be upgraded are written into the third storage partition, and the historical boot loader and the historical system image file in the third storage partition are covered.
Fig. 4 is a schematic diagram of a structure of the memory after writing the boot loader to be upgraded and the system image file to be upgraded into the third memory partition, as shown in fig. 4, after step 22, the boot loader to be upgraded and the system image file to be upgraded are stored in the third memory partition 3. The starting jump address of the to-be-upgraded starting loader is the starting address of the third memory partition 3. That is, in step 22, the boot loader to be upgraded is written from the start address of the third memory partition 3, and then the system image file to be upgraded is written.
In the embodiment of the present disclosure, a start jump address of a system image file to be upgraded is set in a start loader to be upgraded, so that after the start loader to be upgraded is operated, the start jump address of the system image file to be upgraded is automatically jumped to operate the system image file to be upgraded, so that an equipment end can normally operate based on the system image file to be upgraded.
In the embodiment of the present disclosure, after receiving the file to be upgraded, the device side further needs to verify the system image file to be upgraded before writing the boot loader to be upgraded and the system image file to be upgraded into the third storage partition, so as to verify whether the system image file to be upgraded is complete and true and reliable, and after the verification is passed, execute the step of writing the boot loader to be upgraded and the system image file to be upgraded into the third storage partition, that is, step 22. In the embodiment of the disclosure, the SHA256 algorithm may be used to verify the system image file to be upgraded.
In the embodiment of the present disclosure, in step 22, after the boot loader to be upgraded and the system image file to be upgraded are all written into the third storage partition, the device side further needs to verify the data stored in the third storage partition, that is, the boot loader to be upgraded and the system image file to be upgraded, specifically, may use the SHA256 algorithm to perform verification, and after the verification passes, the next operation is performed.
In some embodiments, after the data stored in the third storage partition, that is, the boot loader to be upgraded (Bootloader) and the image file of the system to be upgraded pass verification, the device side also needs to record the length of the boot loader to be upgraded and the corresponding verification value.
In the embodiment of the present disclosure, the lengths of the current boot loader and the boot loader to be upgraded are both fixed lengths set in advance. The length of the current boot loader may also be understood as the memory size occupied by the current boot loader in the second storage partition, and the length of the boot loader to be upgraded may also be understood as the memory size occupied by the current boot loader in the third storage partition.
It should be noted that, in the embodiment of the present disclosure, when the device side receives the file to be upgraded and writes the boot loader to be upgraded and the system image file to be upgraded into the third storage partition, the device side may still work currently based on the current system image file, and may not affect the user when using the device side.
And step 23, copying the boot loader to be upgraded to the second storage partition when the equipment end is powered off and restarted, and enabling the boot loader to be upgraded to cover the current boot loader.
In the embodiment of the present disclosure, as shown in fig. 4, in step 23, the device copies the boot loader to be upgraded to the second storage partition 2, and causes the boot loader to be upgraded to cover the current boot loader currently stored in the second storage partition 2, where the boot jump address of the boot loader to be upgraded is the start address of the second storage partition 2, and then the current boot loader to be upgraded and the current system image file are stored in the second storage partition 2.
In some embodiments, when the device side is powered off and restarted, the device side copies the boot loader to be upgraded to the second storage partition according to the pre-recorded length of the boot loader to be upgraded and the corresponding check value, where the length of the boot loader to be upgraded is used to determine the memory size of the second storage partition that needs to be occupied by the boot loader to be upgraded. And the check value corresponding to the to-be-upgraded starting loading program is used for checking the to-be-upgraded starting loading program.
And step 24, after the boot file is operated from the starting address of the first storage partition, jumping to the starting address of the second storage partition to operate the to-be-upgraded boot loader.
In the embodiment of the present disclosure, when the device side restarts, the device side first starts to run the boot file from the start address of the first storage partition after writing the boot loader to be upgraded into the second storage partition and covering the current boot loader. Because the starting address of the second storage partition is set in the starting guide file, the starting address of the second storage partition is automatically jumped to after the starting guide file is restarted and operated at the equipment end each time. Since the boot loader to be upgraded is already stored in the second storage partition over the current boot loader at this time, the boot loader to be upgraded will be run from the start address of the second storage partition at this time.
And step 25, after the to-be-upgraded starting loading program is operated, jumping to a starting jump address of the to-be-upgraded system image file to operate the to-be-upgraded system image file, and completing the system upgrading of the equipment end.
In step 25, since the start jump address of the system image file to be upgraded (the start address of the system image file to be upgraded stored in the third storage partition) is set in the start loader to be upgraded, the device side automatically jumps to the start jump address of the system image file to be upgraded to run the system image file to be upgraded after running the start loader to be upgraded, thereby completing the system upgrade of the device side.
The system upgrade from the current system image file to the system image file to be upgraded is completed, after that, as shown in fig. 4, at each restart of the device, the device jumps to the boot loader to be upgraded in the second storage partition 2 through the boot file in the first storage partition 1, and jumps to the system image file to be upgraded in the third storage partition 3 through the boot loader to be upgraded in the second storage partition 2, so that the device works based on the system image file to be upgraded after restarting.
In the embodiment of the disclosure, after the system upgrade of the device end is completed through the steps, the to-be-upgraded start loading program is used as the current start loading program, the to-be-upgraded system image file is used as the current system image file, and the next system upgrade is waited. In addition, other descriptions of the upgrade method provided by the embodiments of the present disclosure may refer to the descriptions of the foregoing embodiments, and are not repeated herein.
Fig. 5 is a flowchart of yet another method for upgrading a system at a device side according to an embodiment of the present disclosure, as shown in fig. 5, where the embodiment of the present disclosure only differs from the foregoing embodiment in that step 22 is followed by step 221.
Step 221, modifying a status flag bit corresponding to the first storage partition to a first status, where the first status is used to indicate that the step of copying the boot loader to be upgraded to the second storage partition is performed when the device is powered off and restarted.
In some embodiments, after writing the boot loader to be upgraded and the system image file to be upgraded into the third storage partition, and verifying the boot loader to be upgraded and the system image file to be upgraded in the third storage partition, the device side modifies a status flag bit corresponding to the first storage partition into the first status.
In the embodiment of the present disclosure, initially, a status flag bit corresponding to a first storage partition is in a second state, where the second state is used to indicate a start address of a second storage partition to jump to after a boot file is started when a device is powered off and restarted.
In the embodiment of the present disclosure, when the device side is powered off and restarted, the following step 222 is executed first, and then the step of copying the boot loader to be upgraded to the second storage partition and enabling the boot loader to be upgraded to cover the current boot loader is executed.
Step 222, detecting whether a status flag bit corresponding to the first storage partition is in a first status or a preset second status, where the second status is used to instruct the operation module to jump to the start address of the second storage partition after the operation of the boot file is started when the equipment end is powered off and restarted, if the status is detected as the first status, executing the step of copying the boot loader to be upgraded to the second storage partition, and enabling the boot loader to be upgraded to cover the current boot loader, and if the status is detected as the second status, jumping to the start address of the second storage partition after the operation of the boot file is started.
In the embodiment of the present disclosure, when the device side is powered off and restarted, the device side first detects a state value of a state flag bit corresponding to the first storage partition, and if the state value of the state flag bit corresponding to the first storage partition is the first state, it indicates that the boot loader to be upgraded and the system image file to be upgraded have been successfully written into the third storage partition, so that the step of copying the boot loader to be upgraded to the second storage partition and enabling the boot loader to be upgraded to cover the current boot loader is performed.
If the state value of the state flag bit corresponding to the first storage partition is the second state, the state flag bit corresponding to the first storage partition is not modified to the first state, so that after the boot file is started, the boot loader is jumped to the starting address of the second storage partition. At this time, the current boot loader is still stored in the second storage partition, and the boot jump address of the current boot loader is still the start address of the second storage partition, so that after the boot file is executed, the current boot loader is executed from the start address of the second storage partition, and then the current boot loader jumps to the boot jump address of the current system image file to execute the current system image file, so as to ensure that when the device terminal is powered off and restarted, if the state flag bit corresponding to the first storage partition is still detected to be in the second state, that is, when the device terminal fails to successfully upgrade to the system image file to be upgraded, the device terminal can still execute work based on the current system image file.
In addition, other descriptions of the upgrade method provided by the embodiments of the present disclosure may refer to the descriptions in the foregoing embodiments, and are not repeated here.
Fig. 6 is a flowchart of yet another method for upgrading a system at a device side according to an embodiment of the present disclosure, where the upgrading method may be performed by an upgrading apparatus, and the apparatus may be implemented by software and/or hardware, and the apparatus may be integrated in the device side or a server. As shown in fig. 6, the upgrade method includes:
and step 31, when the equipment terminal works based on the current system image file, receiving a file to be upgraded, wherein the file to be upgraded comprises a start loading program to be upgraded and the system image file to be upgraded.
In the embodiment of the present disclosure, the device side includes a memory, and fig. 7 is a schematic structural diagram of a memory in the embodiment of the present disclosure, and as shown in fig. 7, the memory includes a first memory partition 1, a second memory partition 2, and a third memory partition 3 that are set in advance. The first storage partition 1 is used for storing a starting guide file, and in the first storage partition 1, a starting jump address of the starting guide file is a starting address of the first storage partition 1; the second storage partition 2 currently stores a current boot loader (Bootloader) and a historical system image file, in the second storage partition 2, a boot jump address of the current boot loader is a starting address of the second storage partition 2, and the second storage partition 2 is used for storing a file to be upgraded; the third storage partition 3 currently stores the current boot loader and the current system image file.
In the disclosed embodiment, as shown in fig. 7, the device side memory further includes a specific memory partition 4.
In addition, for other descriptions of step 31 in the embodiments of the present disclosure, reference may be made to the descriptions of step 11 and step 21 in the foregoing embodiments, and the descriptions are not repeated here.
It may be appreciated that, in the upgrade method according to the embodiment of the present disclosure, the third storage partition currently stores the current boot loader and the current system image file, the second storage partition currently stores the current boot loader and the historical system image file, and the second storage partition is executed on the premise that the second storage partition stores the file to be upgraded.
Step 32, writing the boot loader to be upgraded into a specific memory partition.
And step 33, writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition.
In the embodiment of the present disclosure, since the third storage partition currently stores the current boot loader and the current system image file, the second storage partition serves as a storage partition for storing the file to be upgraded.
In step 33, the boot loader to be upgraded and the system image file to be upgraded are written to the second storage partition to overwrite the current boot loader and the historical system image file currently stored in the second storage partition.
In the embodiment of the disclosure, as shown in fig. 7, when the device side works based on the current system image file, the current boot loader and the historical system image file are currently stored in the second storage partition 2 of the memory. Fig. 8 is a schematic diagram of a structure of the memory after writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition, in step 33, as shown in fig. 8, after the device side writes the boot loader to be upgraded and the system image file to be upgraded into the second storage partition 2, the second storage partition 2 stores the boot loader to be upgraded and the system image file to be upgraded at this time. The starting jump address of the to-be-upgraded starting loader is the starting address of the second memory partition 2. That is, in step 33, the boot loader to be upgraded is written from the start address of the second memory partition 2, and then the system image file to be upgraded is written.
In the embodiment of the disclosure, the start jump address of the system image file to be upgraded is set in the start loading program to be upgraded, so that the start jump address of the system image file to be upgraded can be automatically jumped to run the system image file to be upgraded after the start loading program to be upgraded is run, and the equipment end can work normally based on the system image file to be upgraded.
In the embodiment of the present disclosure, after receiving the file to be upgraded, the device side further needs to verify the system image file to be upgraded before writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition, so as to verify whether the system image file to be upgraded is complete and true and reliable, and after the verification is passed, the step of writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition is performed, that is, step 33. In the embodiment of the disclosure, the SHA256 algorithm may be used to verify the system image file to be upgraded.
In the embodiment of the present disclosure, in step 33, after the boot loader to be upgraded and the system image file to be upgraded are all written into the second storage partition, the device side further needs to verify the data stored in the second storage partition, that is, the boot loader to be upgraded and the system image file to be upgraded, specifically, may use the SHA256 algorithm to perform verification, and after the verification is passed, the next operation is performed.
And step 34, when the equipment end is powered off and restarted, after the starting boot file is operated from the starting address of the first storage partition, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
In the embodiment of the disclosure, when the device side is powered off and restarted, the boot file is started to run from the starting address of the first storage partition. Because the starting address of the second storage partition is set in the starting guide file, after the starting guide file is restarted and operated at the equipment end, the starting guide file is automatically jumped to the starting address of the second storage partition so as to operate the starting loader to be upgraded.
And step 35, after the to-be-upgraded start loading program is operated, jumping to a start jump address of the to-be-upgraded system image file to operate the to-be-upgraded system image file, and completing the system upgrading of the equipment end.
In step 35, since the start jump address of the system image file to be upgraded (the start address of the system image file to be upgraded stored in the second storage partition) is set in the start loader to be upgraded, the device side automatically jumps to the start jump address of the system image file to be upgraded to run the system image file to be upgraded after running the start loader to be upgraded, thereby completing the system upgrade of the device side.
The device end is started up to the system image file to be upgraded through the boot file, and then the device end is started up to the system image file to be upgraded through the boot loader to be upgraded.
In the embodiment of the disclosure, after the system upgrade of the device end is completed through the steps, the to-be-upgraded start loading program is used as the current start loading program, the to-be-upgraded system image file is used as the current system image file, and the next system upgrade is waited.
In some embodiments, referring to fig. 7 and fig. 8, if the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition 2, when the device side is powered off and restarted, the device side cannot be started normally, i.e. the device side will have a brick change condition, because the boot loader to be upgraded and the system image file to be upgraded are not completely written into the boot loader to be upgraded, and the incompletely written boot loader to be upgraded already covers the current boot loader stored before the second storage partition 2.
In order to effectively avoid the problem that the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, the device side is powered off and restarted to cause the device side to have a brick changing condition, in some embodiments, if the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, the device side is powered off and restarted, the upgrading method further includes:
And 341, copying the current boot loader to the second storage partition, wherein the boot jump address of the current boot loader is the start address of the second storage partition, so that the device end can work based on the current system image file after restarting.
In step 341, referring to fig. 8, if the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition 2, when the device side is powered off and restarted, the current boot loader is copied from the third storage partition 3 to the second storage partition 2 to cover the boot loader to be upgraded which is not completely written into the second storage partition 2, where after the copying is completed, the boot jump address of the current boot loader is the start address of the second storage partition 2, so that the device side can work based on the current system image file in the third storage partition 3 after restarting.
In some embodiments, since the length and the check value of the current boot loader are recorded in advance, in step 341, the current boot loader may be copied to the second storage partition according to the length of the current boot loader and the corresponding check value, where the length of the current boot loader is used to determine the memory size of the second storage partition that needs to be occupied by the current boot loader, and the corresponding check value of the current boot loader is used to check the current boot loader.
And 342, when the equipment terminal works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, taking the starting jump address of the to-be-upgraded starting loader as the starting address of the second storage partition, and continuously writing the to-be-upgraded system image file into the second storage partition.
In step 342, when the device side works based on the current system image file, the device side copies the boot loader to be upgraded in the specific storage partition to the second storage partition to cover the current boot loader currently stored in the second storage partition, and continues to write the system image file to be upgraded to the second storage partition. The starting jump address of the to-be-upgraded starting loader is the starting address of the second storage partition.
After step 341 and step 342, when the device is powered off and restarted, the above step 34 is continuously performed to complete the system upgrade of the device.
In addition, other descriptions of the upgrade method provided by the embodiments of the present disclosure may refer to the descriptions of the foregoing embodiments, and are not repeated herein.
Fig. 9 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure, and as shown in fig. 9, unlike the upgrading method according to the foregoing embodiment, in the embodiment of the present disclosure, after the boot loader to be upgraded and the system image file to be upgraded are completely written to the second storage partition, that is, after step 33, step 331 is further included.
And 331, modifying a state flag bit corresponding to the first storage partition into a second state, wherein the second state is used for indicating that the device side is in power-off restarting and then jumps to the starting address of the second storage partition after the boot file is started.
In some embodiments, after writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition, and verifying the boot loader to be upgraded and the system image file to be upgraded in the second storage partition, the device side modifies the status flag bit corresponding to the first storage partition into the second status.
In order to effectively avoid the problem that the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, the device side is powered off and restarted to cause the device side to have a brick changing condition. Specifically, when the device side is powered off and restarted, before the boot file is started from the starting address of the first storage partition, the upgrading method further includes:
Step 332, detecting whether the status flag bit corresponding to the first storage partition is in the second status or the first status, if so, executing the step of jumping to the start address of the second storage partition to run the boot loader to be upgraded after running the boot file from the start address of the first storage partition, and if so, executing step 333.
In the embodiment of the present disclosure, when the device side is powered off and restarted, the device side first detects a state value of a state flag bit corresponding to the first storage partition, and if the state value of the state flag bit corresponding to the first storage partition is detected to be in the second state, the to-be-upgraded boot loader and the to-be-upgraded system image file are indicated to be successfully written into the second storage partition, so that after the boot file is run from a start address of the first storage partition, the device side jumps to a start address of the second storage partition to run the to-be-upgraded boot loader.
Because the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, the status flag bit corresponding to the first storage partition is not modified, i.e. the status flag bit corresponding to the first storage partition is still maintained in the first state at this time. If in step 332, it is detected that the status value of the status flag bit corresponding to the first storage partition is the first status, it indicates that the boot loader to be upgraded and the system image file to be upgraded are not written into or not completely written into the second storage partition, i.e. the device side fails to upgrade from the second system image file to the third system image file, so in order to ensure that the device side can still work normally, step 333 is executed to enable the device side to work based on the current system image file.
Step 333, copying the current boot loader to the second storage partition, where the boot jump address of the current boot loader is the start address of the second storage partition.
Because the status flag bit corresponding to the first storage partition is in the first status, which indicates that the boot loader to be upgraded and the system image file to be upgraded are not written into or not completely written into the second storage partition, the boot loader currently stored in the second storage partition is not completely written into the boot loader to be upgraded or other boot loaders, which may cause that the equipment end cannot be restarted and changes into a brick. In order to effectively prevent this, when it is detected that the status flag bit corresponding to the first storage partition is in the first status, in step 333, the current boot loader is first copied to the second storage partition to cover the incompletely written boot loader to be upgraded or other boot loader currently stored in the second storage partition, and the boot jump address of the current boot loader is made to be the start address of the second storage partition.
In some embodiments, since the length and the check value of the current boot loader are pre-recorded, in step 333, the current boot loader may be copied to the second storage partition according to the pre-recorded length of the current boot loader and the corresponding check value, where the length of the current boot loader is used to determine the memory size of the second storage partition that needs to be occupied by the current boot loader, and the corresponding check value of the current boot loader is used to check the current boot loader.
Step 334, after running the boot file from the start address of the first storage partition, jump to the start address of the second storage partition to run the current boot loader.
Step 335, after running the current boot loader, jumping to the boot jump address of the current system image file to run the current system image file, so that the device terminal works based on the current system image file.
In the embodiment of the present disclosure, if it is detected in step 332 that the status flag bit corresponding to the first storage partition is in the first status, the device side may be enabled to work based on the current system image file through steps 333 to 335. It should be noted that, step 341 in the foregoing embodiment includes steps 333 to 335 in the embodiment of the present disclosure.
In order to enable the device side to re-upgrade to the system image file to be upgraded after working based on the current system image file, i.e. after step 335, the method further includes:
and 336, when the equipment terminal works based on the current system image file, copying the boot loader to be upgraded in the specific storage partition to the second storage partition, continuously writing the system image file to be upgraded into the second storage partition, and jumping to step 331.
In step 336, when the device side works based on the current system image file, the device side copies the boot loader to be upgraded in the specific storage partition to the second storage partition to cover the current boot loader currently stored in the second storage partition, and continues to write the system image file to be upgraded to the second storage partition. The starting jump address of the to-be-upgraded starting loader is the starting address of the second storage partition. In step 336, after the boot loader to be upgraded and the system image file to be upgraded are completely written into the second storage partition, the process jumps to execute step 331.
In addition, the specific description of the upgrade method provided by the embodiments of the present disclosure may refer to the description of the foregoing embodiments, and will not be repeated here.
Fig. 10 is a flowchart of another method for upgrading a system at a device side according to an embodiment of the present disclosure, where, as shown in fig. 10, the upgrading method includes:
and step 41, when the terminal establishes Bluetooth connection with the equipment end, the client end of the terminal acquires the current system mirror image version information of the equipment end from the equipment end.
In the embodiment of the disclosure, the terminal and the device end may perform bluetooth connection based on a mobile accessory (DuerOS Mobile Accessory, abbreviated as DMA) bluetooth protocol of a secret system, or may perform bluetooth connection based on other bluetooth protocols, which is not limited in the embodiment of the disclosure.
In the embodiment of the disclosure, the terminal may be an intelligent terminal such as a mobile phone or a tablet computer, the client may be an application program (APP) capable of interacting with the device, and the current system image version information of the device acquired by the client from the device may include a current system image version number.
Step 42, the client obtains the latest system image version information of the device from the server corresponding to the device.
In the embodiment of the disclosure, the terminal and the server corresponding to the device end may be connected through a network, and the client may obtain, through the network, the latest system image version information of the device end stored at the server. The latest system image version information may include the latest system image version number of the device side.
Step 43, the client determines whether the device needs to perform system upgrade according to the current system image version information of the device and the latest system image version information of the device, if so, step 44 is executed, otherwise, the process is ended.
In the embodiment of the disclosure, the client judges whether the device side needs to perform system upgrade by judging whether the latest system image version number of the device side is consistent with the current system image version number of the device side. If the client judges that the latest system image version number of the equipment end is consistent with the current system image version number of the equipment end, the client judges that the equipment end does not need to be subjected to system upgrade, and if the client judges that the latest system image version number of the equipment end is inconsistent with the current system image version number of the equipment end, the client judges that the equipment end needs to be subjected to system upgrade.
Step 44, the client obtains the OTA upgrade package corresponding to the latest system image version information from the server.
In the embodiment of the disclosure, if the client determines that the device needs to perform system upgrade and checks that an OTA upgrade package corresponding to the latest system image version information exists at the server, the client downloads the OTA upgrade package from the server.
Step 45, the client transmits the OTA upgrade package to the device, where the OTA upgrade package includes a to-be-upgraded boot loader and a to-be-upgraded system image file.
In the embodiment of the disclosure, when the client transmits the above-mentioned OTA upgrade packet, a block transmission mode is adopted, that is, the client firstly divides the OTA upgrade packet into a plurality of pieces of OTA upgrade data, and then sequentially transmits the plurality of pieces of OTA upgrade data to the device.
In the embodiment of the disclosure, when abnormal conditions such as insufficient Bluetooth bandwidth, bluetooth disconnection, terminal outage, equipment end outage and the like are met, after Bluetooth bandwidth is abundant and Bluetooth connection is reestablished between the terminal and the equipment end, the client end carries out breakpoint continuous transmission on a plurality of pieces of OTA upgrade data until a complete OTA upgrade packet is transmitted to the equipment end.
When the bluetooth connection is re-established between the terminal and the device, if the client of the terminal detects that the OTA upgrade packet corresponding to the updated system image version number exists at the server again through the steps 41 to 44, the updated OTA upgrade packet is downloaded, and the updated OTA upgrade packet is transmitted to the device.
Step 46, when the device side works based on the current system image file, the device side receives a file to be upgraded, where the file to be upgraded is the OTA upgrade packet, and the file to be upgraded includes the boot loader to be upgraded and the system image file to be upgraded.
In step 46, when the device side works based on the current system image file, the device side receives the OTA upgrade packet transmitted by the client side, that is, the file to be upgraded, which includes the boot loader to be upgraded and the system image file to be upgraded.
In some embodiments, if the client transmits the OTA upgrade packet to the device in blocks, the device performs verification on each piece of OTA upgrade data first, specifically, may use SHA256 algorithm to perform verification, and after the verification is passed, performs the next operation.
For a specific description of step 46, reference is made to the description of step 21 in the foregoing embodiment, and no further description is given here.
And step 47, the equipment end writes the boot loader to be upgraded and the system image file to be upgraded into the third storage partition.
It should be noted that, in the upgrade method according to the embodiment of the present disclosure, based on the second storage partition currently storing the current boot loader and the current system image file, the third storage partition is currently a blank partition or the third storage partition currently storing the historical boot loader and the historical system image file, and the third storage partition is performed on the premise that the third storage partition is used for storing the file to be upgraded.
For a specific description of step 47, reference is made to the description of step 22 in the previous embodiment, and the description is omitted here.
And 48, the device side modifies the status flag bit corresponding to the first storage partition into a first status, where the first status is used to indicate that the step of copying the second boot loader to the second storage partition is performed when the device side is powered off and restarted.
For a specific description of step 48, reference is made to the description of step 221 in the foregoing embodiment, and no further description is given here.
Step 49, when the device side is powered off and restarted, the device side detects that the status flag bit corresponding to the first storage partition is in a first status or a second status, where the second status is used to indicate that the device side jumps to the start address of the second storage partition after running the boot file when the device side is powered off and restarted, if the status is detected as the first status, step 50 is executed, and if the status is detected as the second status, the device side jumps to the start address of the second storage partition after running the boot file when the device side is powered off and restarted.
For a specific description of step 49, reference is made to the description of step 222 in the previous embodiment, and the description is omitted here.
And 50, copying the to-be-upgraded starting loader to the second storage partition by the equipment end, and enabling the to-be-upgraded starting loader to cover the current starting loader.
For a specific description of step 50, reference is made to the description of step 23 in the foregoing embodiment, and no further description is given here.
And step 51, after the equipment end operates the starting guide file from the starting address of the first storage partition, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
For a specific description of step 51, reference is made to the description of step 24 in the foregoing embodiment, and no further description is given here.
Step 52, after the device side operates the boot loader to be upgraded, jumping to the boot jump address of the system image file to be upgraded to operate the system image file to be upgraded, and completing the system upgrade of the device side.
For a specific description of step 52, reference is made to the description of step 25 in the foregoing embodiment, and the details are not repeated here.
In addition, other descriptions of the upgrade method provided by the embodiments of the present disclosure may refer to the descriptions of the foregoing embodiments, and are not repeated herein.
Fig. 11 is a schematic structural diagram of an upgrade apparatus for a system of an upgrade device side according to an embodiment of the present disclosure, where the device side includes a memory, and the memory includes a first storage partition, a second storage partition and a third storage partition, where the first storage partition is configured to store a boot file, the second storage partition is configured to store a file to be upgraded when a current boot loader and a current system image file are stored in the third storage partition, and the third storage partition is configured to store the file to be upgraded when the current boot loader and the current system image file are stored in the second storage partition; as shown in fig. 11, the upgrade apparatus includes a receiving module 401, a writing module 402, and an operating module 403.
The receiving module 401 is configured to receive a file to be upgraded when the device side works based on a current system image file, where the file to be upgraded includes a boot loader to be upgraded and the system image file to be upgraded.
The writing module 402 is configured to write the boot loader to be upgraded and the system image file to be upgraded into the second storage partition and the third storage partition, where the storage partition is used to store the file to be upgraded.
The operation module 403 is configured to skip a row to be upgraded to start a loader after the start boot file is operated when the device is powered off and restarted; and after the loading program to be upgraded is started, the system image file to be upgraded is jumped and transferred, and the system upgrading of the equipment end is completed.
In addition, the upgrade apparatus provided in the embodiments of the present disclosure is used to implement the upgrade method shown in fig. 1 in the foregoing embodiments, and the specific description may refer to the description of the upgrade method shown in fig. 1 in the foregoing embodiments, which is not repeated herein.
FIG. 12 is a schematic diagram of another upgrade apparatus provided in an embodiment of the present disclosure, as shown in FIG. 12, in which a current boot loader and a current system image file are currently stored in a second memory partition; the third storage partition is used for storing files to be upgraded, and the third storage partition is currently a blank partition or is currently stored with a historical starting loader and a historical system image file.
As shown in fig. 12, in the embodiment of the present disclosure, after the receiving module 401 receives the file to be upgraded, the writing module 402 is configured to write the boot loader to be upgraded and the system image file to be upgraded into the third storage partition, and the upgrading device further includes the copying module 404.
The copying module 404 is configured to copy the boot loader to be upgraded to the second storage partition after the running module 403 runs the boot file and before jumping to the boot loader to be upgraded when the device side is powered off and restarted, and enable the boot loader to be upgraded to cover the current boot loader currently stored in the second storage partition, where a boot jumping address of the boot loader to be upgraded is a start address of the second storage partition. The operation module 403 is specifically configured to jump to the start address of the second storage partition to operate the boot loader to be upgraded after operating the boot file.
In this embodiment of the present disclosure, as shown in fig. 12, the upgrade apparatus further includes a state modifying module 405 and a detecting module 406, where the state modifying module 405 is configured to modify, after the writing module 402 writes the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, and after the third storage partition, that is, the third storage partition, used to store the file to be upgraded in the third storage partition, a state flag bit corresponding to the first storage partition to a first state, where the first state is used to instruct, when the device side is powered off and restarted, to trigger the copying module 404 to execute a step of copying the boot loader to be upgraded to the second storage partition.
The detection module 406 is configured to, when the device side is powered off and restarted, copy the boot loader to be upgraded to the second storage partition by the copy module 404, and detect whether a status flag bit corresponding to the first storage partition is a first status or a preset second status before the boot loader to be upgraded covers the current boot loader currently stored in the second storage partition, where the second status is used to indicate that when the device side is powered off and restarted, trigger the operation module 403 to jump to a start address of the second storage partition after the boot file is executed; if the status flag bit corresponding to the first storage partition is detected to be in the first status, the copy module 404 is triggered to execute the step of copying the boot loader to be upgraded to the second storage partition.
Other descriptions of the upgrade apparatus according to the embodiments of the present disclosure may refer to the descriptions of the upgrade apparatus according to the foregoing embodiments, and are not repeated herein. In addition, the upgrade apparatus provided in the embodiments of the present disclosure is used to implement the upgrade method shown in fig. 2 in the foregoing embodiments, and the specific description may refer to the description of the upgrade method shown in fig. 2 in the foregoing embodiments, which is not repeated herein.
In the embodiment of the present disclosure, the third storage partition currently stores a current boot loader and a current system image file; the second storage partition is used for storing the file to be upgraded.
As shown in fig. 12, in the embodiment of the present disclosure, after the receiving module 401 receives the file to be upgraded, the writing module 402 is specifically configured to write the boot loader to be upgraded and the system image file to be upgraded into the second storage partition to cover the current boot loader and the historical system image file currently stored in the second storage partition, where a boot jump address of the boot loader to be upgraded is a start address of the second storage partition; the operation module 403 is specifically configured to jump to the start address of the second storage partition to operate the boot loader to be upgraded after the boot file is operated when the device is powered off and restarted.
In the embodiment of the present disclosure, the memory further includes a specific storage partition, and the writing module 402 is further configured to write the boot loader to be upgraded to the specific storage partition after the receiving module receives the file to be upgraded.
In the embodiment of the present disclosure, the copy module 404 is configured to copy, if the write module 402 does not completely write the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, the current boot loader to the second storage partition when the device is restarted after power is off, where a boot jump address of the current boot loader is a start address of the second storage partition, so that the device can work based on the current system image file after restarting; when the equipment terminal works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, wherein the starting jump address of the to-be-upgraded starting loader is the starting address of the second storage partition.
In the embodiment of the present disclosure, the writing module 402 is further configured to continue writing the system image file to be upgraded to the second storage partition after the copying module 404 copies the boot loader to be upgraded in the specific storage partition to the second storage partition.
In this embodiment of the present disclosure, the state modifying module 405 is configured to modify, after the writing module 402 writes the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, a state flag bit corresponding to the first storage partition to a second state, where the second state is used to indicate that when the device side is powered off and restarted, the running module 403 is triggered to jump to a start address of the second storage partition after running the boot file.
In the embodiment of the present disclosure, the detection module 406 is configured to detect, when the device side is powered off and restarted, whether the status flag bit corresponding to the first storage partition is in a second state or a first state, where the first state is used to instruct, when the device side is powered off and restarted, to trigger the copy module 404 to execute a step of copying the current boot loader to the second storage partition, before the operation module 403 jumps to the start address of the second storage partition to operate the boot loader to be upgraded after operating the boot loader. If the state flag bit corresponding to the first storage partition is detected to be in the second state, triggering the operation module 403 to execute the step of jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader after operating the starting guide file; if the state flag bit corresponding to the first storage partition is detected to be in the first state, the copy module 404 is triggered to execute the step of copying the current boot loader to the second storage partition, wherein the boot jump address of the current boot loader is the start address of the second storage partition, so that the device end can work based on the current system image file after restarting.
Other descriptions of the upgrade apparatus according to the embodiments of the present disclosure may refer to the descriptions of the upgrade apparatus according to the foregoing embodiments, and are not repeated herein. In addition, the upgrade apparatus provided in the embodiments of the present disclosure is used to implement the upgrade method shown in fig. 6 in the foregoing embodiments, and the specific description may refer to the description of the upgrade method shown in fig. 6 in the foregoing embodiments, which is not repeated herein.
In addition, the embodiment of the disclosure further provides an equipment end, which may include the upgrading device provided in the above embodiment.
For a specific description of the upgrade apparatus, reference may be made to the description of the upgrade apparatus in the above embodiment, which is not repeated here.
The embodiment of the disclosure also provides a server, which comprises: one or more processors and a storage device; the storage device stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the upgrade method.
The disclosed embodiments also provide a computer readable storage medium having a computer program stored thereon, wherein the computer program when executed implements the aforementioned upgrade method.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements any one of the above-mentioned upgrade methods.
It should be noted that, herein, the "start address" and the "start jump address" are physical addresses.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purpose of limitation. In some instances, it will be apparent to one skilled in the art that features, characteristics, and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments unless explicitly stated otherwise. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (17)

1. An upgrading method for upgrading a system of a device side, wherein the device side comprises a memory, the memory comprises a first storage partition, a second storage partition and a third storage partition, the first storage partition is used for storing a startup boot file, the second storage partition is used for storing a file to be upgraded when a current startup loader and a current system image file are stored in the third storage partition, and the third storage partition is used for storing the file to be upgraded when the current startup loader and the current system image file are stored in the second storage partition; the upgrading method comprises the following steps:
When the equipment end works based on the current system image file, receiving a file to be upgraded, wherein the file to be upgraded comprises a loading program to be upgraded and a system image file to be upgraded;
writing the to-be-upgraded starting loader and the to-be-upgraded system image file into storage partitions used for storing the to-be-upgraded file in the second storage partition and the third storage partition;
when the equipment end is powered off and restarted, after the starting guide file is operated, the starting loading program to be upgraded is jumped to operate;
after the loading program to be upgraded is started, the system image file to be upgraded is jumped to run, and the system upgrading of the equipment end is completed;
the current boot loader and the current system image file are currently stored in the third storage partition, the current boot loader and the historical system image file are currently stored in the second storage partition, and in the case that the second storage partition is used for storing the file to be upgraded,
the writing the boot loader to be upgraded and the system image file to be upgraded into the second storage partition and the storage partition used for storing the file to be upgraded in the third storage partition includes: writing the to-be-upgraded starting loader and the to-be-upgraded system image file into the second storage partition to cover the current starting loader and the historical system image file which are currently stored in the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
When the equipment end is powered off and restarted, after the starting guide file is operated, the to-be-upgraded starting loading program is jumped to be operated, and the method comprises the following steps: and when the equipment end is powered off and restarted, after the starting guide file is operated, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
2. The upgrade method of claim 1, wherein, in the case where the second storage partition currently stores the current boot loader and the current system image file, the third storage partition is used to store a file to be upgraded, the third storage partition is currently a blank partition or the third storage partition currently stores a historical boot loader and a historical system image file,
after the start-up guide file is run, before the start-up loader to be upgraded is jumped to run, the method further comprises the steps of: copying the to-be-upgraded starting loader to the second storage partition, and enabling the to-be-upgraded starting loader to cover the current starting loader currently stored in the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
After the start-up guide file is operated, the to-be-upgraded start-up loader is operated in a jumping mode, and the method comprises the following steps: and after the starting guide file is operated, jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader.
3. The upgrade method according to claim 2, wherein after writing the boot loader to be upgraded and the system image file to be upgraded to the storage partition for storing the file to be upgraded in the second storage partition and the third storage partition, further comprising:
and modifying a state flag bit corresponding to the first storage partition into a first state, wherein the first state is used for indicating that the step of copying the boot loader to be upgraded to the second storage partition is executed when the equipment end is powered off and restarted.
4. The upgrade method according to claim 3, wherein before said copying said boot loader to be upgraded to said second storage partition and causing said boot loader to be upgraded to overwrite said current boot loader currently stored in said second storage partition, further comprising:
detecting whether a state flag bit corresponding to the first storage partition is the first state or a preset second state, wherein the second state is used for indicating that when the equipment end is powered off and restarted, the equipment end jumps to the starting address of the second storage partition after the starting guide file is operated;
And if the state flag bit corresponding to the first storage partition is detected to be in the first state, executing the step of copying the to-be-upgraded starting loader to the second storage partition.
5. The upgrade method of claim 1 wherein said memory further comprises a specific memory partition; after receiving the file to be upgraded, the method further comprises the following steps: writing the boot loader to be upgraded into the specific storage partition;
if the boot loader to be upgraded and the system image file to be upgraded are not completely written into the second storage partition, and the equipment end is powered off and restarted, the upgrading method further comprises the following steps:
copying the current start loading program to the second storage partition, wherein the start jump address of the current start loading program is the starting address of the second storage partition, so that the equipment end can work based on the current system image file after restarting;
when the equipment end works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, enabling a starting jump address of the to-be-upgraded starting loader to be a starting address of the second storage partition, and continuing to write the to-be-upgraded system image file into the second storage partition.
6. The upgrade method according to claim 5, wherein after writing the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, further comprising:
and modifying the state flag bit corresponding to the first storage partition into a second state, wherein the second state is used for indicating that the starting address of the second storage partition is jumped to after the starting guide file is operated when the equipment end is powered off and restarted.
7. The upgrade method according to claim 6, wherein said jumping to the start address of said second memory partition after running said boot file to run said boot loader to be upgraded further comprises:
detecting whether a state flag bit corresponding to the first storage partition is in the second state or the first state, wherein the first state is used for indicating that the step of copying the current starting loader to the second storage partition is executed when the equipment end is powered off and restarted;
if the state flag bit corresponding to the first storage partition is detected to be in the second state, executing the step of jumping to the starting address of the second storage partition to run the to-be-upgraded starting loader after running the starting guide file;
And if the state flag bit corresponding to the first storage partition is detected to be in the first state, executing the step of copying the current start loader to the second storage partition, wherein the start jump address of the current start loader is the start address of the second storage partition, so that the equipment end can work based on the current system image file after restarting.
8. An upgrading device for upgrading a system of a device side, wherein the device side comprises a memory, the memory comprises a first storage partition, a second storage partition and a third storage partition, the first storage partition is used for storing a startup boot file, the second storage partition is used for storing a file to be upgraded when a current startup loader and a current system image file are stored in the third storage partition, and the third storage partition is used for storing the file to be upgraded when the current startup loader and the current system image file are stored in the second storage partition; the upgrading device comprises:
the receiving module is used for receiving a file to be upgraded when the equipment end works based on the current system image file, wherein the file to be upgraded comprises a loading program to be upgraded and a system image file to be upgraded;
The writing module is used for writing the boot loader to be upgraded and the system image file to be upgraded into the storage partitions used for storing the file to be upgraded in the second storage partition and the third storage partition;
the operation module is used for jumping to operate the to-be-upgraded starting loading program after the starting guide file is operated when the equipment end is powered off and restarted; after the loading program to be upgraded is started, the system image file to be upgraded is jumped to run, and the system upgrading of the equipment end is completed;
the current boot loader and the current system image file are currently stored in the third storage partition, the current boot loader and the historical system image file are currently stored in the second storage partition, and in the case that the second storage partition is used for storing the file to be upgraded,
the writing module is specifically configured to write the boot loader to be upgraded and the system image file to be upgraded into the second storage partition, so as to cover the current boot loader and the historical system image file currently stored in the second storage partition, where a boot jump address of the boot loader to be upgraded is a start address of the second storage partition;
The operation module is specifically configured to, when the device end is powered off and restarted, jump to the start address of the second storage partition after the boot file is operated to operate the boot loader to be upgraded.
9. The upgrade apparatus of claim 8, wherein, in a case where the second storage partition currently stores the current boot loader and the current system image file, the third storage partition is used to store a file to be upgraded, the third storage partition is currently a blank partition or the third storage partition currently stores a historical boot loader and a historical system image file,
the upgrading device further comprises a copying module, wherein the copying module is used for copying the to-be-upgraded starting loading program to the second storage partition before jumping to run the to-be-upgraded starting loading program after the running module runs the starting guide file when the equipment end is powered off and restarted, and enabling the to-be-upgraded starting loading program to cover the current starting loading program currently stored in the second storage partition, and a starting jumping address of the to-be-upgraded starting loading program is a starting address of the second storage partition;
The operation module is specifically configured to jump to the start address of the second storage partition after the start boot file is operated, so as to operate the boot loader to be upgraded.
10. The upgrade apparatus of claim 9, further comprising a state modification module, wherein the state modification module is configured to modify a state flag bit corresponding to the first storage partition into a first state after the writing module writes the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, and after the writing module writes the storage partition to store the file to be upgraded in the third storage partition, where the first state is configured to instruct the copy module to execute the step of copying the boot loader to be upgraded to the second storage partition when the device side is powered off and restarted.
11. The upgrade apparatus according to claim 10, further comprising a detection module, wherein the detection module is configured to copy the boot loader to be upgraded to the second storage partition when the device side is powered off and restarted, and detect whether a status flag bit corresponding to the first storage partition is the first status or a preset second status before the boot loader to be upgraded covers the current boot loader currently stored in the second storage partition, where the second status is used to indicate that the execution module is triggered to jump to a start address of the second storage partition after the boot file is executed when the device side is powered off and restarted; and triggering the copying module to execute the step of copying the to-be-upgraded starting loader to the second storage partition when the state flag bit corresponding to the first storage partition is detected to be in the first state.
12. The upgrade apparatus of claim 8 wherein the memory further comprises a specific memory partition; the upgrading device also comprises a copying module;
the writing module is further configured to write the boot loader to be upgraded to the specific storage partition after the receiving module receives the file to be upgraded;
the copying module is configured to copy the current boot loader to the second storage partition if the writing module does not completely write the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, and the boot jump address of the current boot loader is the start address of the second storage partition when the device is restarted after power failure, so that the device can work based on the current system image file after restarting; when the equipment end works based on the current system image file, copying the to-be-upgraded starting loader in the specific storage partition to the second storage partition, wherein a starting jump address of the to-be-upgraded starting loader is a starting address of the second storage partition;
the writing module is further configured to continue writing the system image file to be upgraded to the second storage partition after the copying module copies the boot loader to be upgraded in the specific storage partition to the second storage partition.
13. The upgrade apparatus of claim 12, further comprising a state modification module, wherein the state modification module is configured to modify, after the writing module writes the boot loader to be upgraded and the system image file to be upgraded to the second storage partition, a state flag bit corresponding to the first storage partition to a second state, where the second state is used to indicate that the operation module is triggered to jump to a start address of the second storage partition after the boot file is executed when the device side is powered off and restarted.
14. The upgrade apparatus of claim 13, further comprising a detection module, wherein the detection module is configured to detect, when the device side is powered off and restarted, whether a status flag bit corresponding to the first storage partition is the second status or the first status, and the first status is configured to instruct, when the device side is powered off and restarted, to trigger the copy module to perform the step of copying the current boot loader to the second storage partition, before jumping to the start address of the second storage partition to run the boot loader to be upgraded after the boot loader is run;
When the detection module detects that the state flag bit corresponding to the first storage partition is in the second state, triggering the operation module to execute the step of jumping to the starting address of the second storage partition to operate the to-be-upgraded starting loader after operating the starting guide file;
and if the detection module detects that the state flag bit corresponding to the first storage partition is in the first state, triggering the copying module to execute the step of copying the current starting loader to the second storage partition, wherein the starting jump address of the current starting loader is the starting address of the second storage partition, so that the equipment end can work based on the current system image file after restarting.
15. A device side comprising the upgrade apparatus of any one of claims 8 to 14.
16. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the upgrade method of any of claims 1-7.
17. A computer readable medium having stored thereon a computer program, wherein the program when executed implements the upgrade method according to any one of claims 1-7.
CN201910786357.XA 2019-08-23 2019-08-23 Upgrading method and device, equipment end, server and computer readable medium Active CN112416411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910786357.XA CN112416411B (en) 2019-08-23 2019-08-23 Upgrading method and device, equipment end, server and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910786357.XA CN112416411B (en) 2019-08-23 2019-08-23 Upgrading method and device, equipment end, server and computer readable medium

Publications (2)

Publication Number Publication Date
CN112416411A CN112416411A (en) 2021-02-26
CN112416411B true CN112416411B (en) 2023-08-18

Family

ID=74779852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910786357.XA Active CN112416411B (en) 2019-08-23 2019-08-23 Upgrading method and device, equipment end, server and computer readable medium

Country Status (1)

Country Link
CN (1) CN112416411B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116594639A (en) * 2021-06-15 2023-08-15 荣耀终端有限公司 Method, apparatus, storage medium, and program product for managing system installation package
CN113946360B (en) * 2021-12-21 2022-04-19 万帮数字能源股份有限公司 Method and device for upgrading boot program of power conversion controller
CN117389578A (en) * 2022-07-05 2024-01-12 中兴通讯股份有限公司 Cloud terminal system upgrading method and device, cloud terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572229A (en) * 2015-02-12 2015-04-29 西安诺瓦电子科技有限公司 Firmware upgrade method and firmware upgrade device for embedded system
CN107577563A (en) * 2017-09-26 2018-01-12 晶晨半导体(上海)股份有限公司 A kind of guard method of system upgrade abnormal power-down and terminal device
CN109960523A (en) * 2017-12-22 2019-07-02 浙江宇视科技有限公司 A kind of firmware upgrade method and device of embedded device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9430223B2 (en) * 2014-09-25 2016-08-30 International Business Machines Corporation Live operating system update mechanisms

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572229A (en) * 2015-02-12 2015-04-29 西安诺瓦电子科技有限公司 Firmware upgrade method and firmware upgrade device for embedded system
CN107577563A (en) * 2017-09-26 2018-01-12 晶晨半导体(上海)股份有限公司 A kind of guard method of system upgrade abnormal power-down and terminal device
CN109960523A (en) * 2017-12-22 2019-07-02 浙江宇视科技有限公司 A kind of firmware upgrade method and device of embedded device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种IPTV机顶盒的软件在线升级方案设计与实现;杨崇江;孙世新;;成都信息工程学院学报(06);全文 *

Also Published As

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

Similar Documents

Publication Publication Date Title
US8539471B2 (en) Updating firmware of an electronic device
US10162625B2 (en) Vehicle control storage methods and systems
CN110659046B (en) Firmware upgrading method, terminal, charging box, earphone and storage medium
CN112416411B (en) Upgrading method and device, equipment end, server and computer readable medium
CN110825563B (en) System recovery method and device and electronic equipment
JP2003029997A (en) Software upgrading method in network environment and network device by the same
CN102830984A (en) Method for updating firmware, chip and communication terminal
KR20040008007A (en) Method of upgrading firmware for wireless terminal
JPWO2009078285A1 (en) Wireless terminal, non-volatile memory of wireless terminal, and fail-safe storage method of diagnostic information
CN112612524A (en) Method, device and equipment for starting Linux system and storage medium
CN110580167A (en) system upgrading method, intelligent device and server
CN113626059B (en) System upgrade method, camera and computer readable storage medium
CN108121560A (en) Difference bag upgrade method, device, terminal and computer readable storage medium
CN113032183A (en) System management method, device, computer equipment and storage medium
CN106933604B (en) System upgrading method and device
CN115357295B (en) System rollback method, device and storage medium
CN115328563B (en) System starting method and electronic equipment
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN114546455A (en) MCU software upgrading method and device for double partitions
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN112433739B (en) Firmware upgrading method
CN112181467B (en) Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN114780122A (en) Embedded equipment firmware updating method and embedded equipment
KR100588199B1 (en) Method for recovering download mode in program download fail state of portable terminal, and portable terminal employing it
WO2024078218A1 (en) System booting method and electronic device

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
TA01 Transfer of patent application right

Effective date of registration: 20210513

Address after: 100085 Baidu Building, 10 Shangdi Tenth Street, Haidian District, Beijing

Applicant after: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) Co.,Ltd.

Applicant after: Shanghai Xiaodu Technology Co.,Ltd.

Address before: 100085 Baidu Building, 10 Shangdi Tenth Street, Haidian District, Beijing

Applicant before: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant