CN111240720A - Boot program upgrading method and device and storage medium - Google Patents

Boot program upgrading method and device and storage medium Download PDF

Info

Publication number
CN111240720A
CN111240720A CN202010230094.7A CN202010230094A CN111240720A CN 111240720 A CN111240720 A CN 111240720A CN 202010230094 A CN202010230094 A CN 202010230094A CN 111240720 A CN111240720 A CN 111240720A
Authority
CN
China
Prior art keywords
partition
program
file
upgrade
bootstrap
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010230094.7A
Other languages
Chinese (zh)
Inventor
蔡潇
陈志�
程丽晶
胡鹏
余春平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accelink Technologies Co Ltd
Wuhan Optical Valley Information Optoelectronic Innovation Center Co Ltd
Original Assignee
Accelink Technologies Co Ltd
Wuhan Optical Valley Information Optoelectronic Innovation Center 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 Accelink Technologies Co Ltd, Wuhan Optical Valley Information Optoelectronic Innovation Center Co Ltd filed Critical Accelink Technologies Co Ltd
Priority to CN202010230094.7A priority Critical patent/CN111240720A/en
Publication of CN111240720A publication Critical patent/CN111240720A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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

Landscapes

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

Abstract

The embodiment of the invention discloses a method, a device and a storage medium for upgrading a bootstrap program; the method comprises the following steps: acquiring a first upgrade package, wherein the first upgrade package comprises an upgrade file of an application program and an upgrade file of a bootstrap program; respectively storing the upgrade files of the application program and the boot program to a second partition and a third partition of a memory on a chip; the memory comprises a first partition, a second partition and a third partition; the first partition is used for storing the running file of the bootstrap program; the second partition is used for storing the upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program; upgrading the application program based on the upgrade file of the application program by using the original file of the bootstrap program stored in the first partition; running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.

Description

Boot program upgrading method and device and storage medium
Technical Field
The present invention relates to the field of embedded technologies, and in particular, to a method and an apparatus for upgrading a boot loader, and a storage medium.
Background
Programs in an embedded chip, such as an embedded Microcontroller (MCU), generally include an application program and a boot program (expressed in english as Bootloader); the application program is used for completing corresponding functional tasks; the bootstrap program is used for guiding and loading the application program to realize the online upgrade of the application program.
The function of the bootstrap program is single, and the situation of independently upgrading the bootstrap program is less, however, when a new function needs to be added or new hardware needs to be adapted, the requirement of upgrading the bootstrap program still exists. However, in the related art, when upgrading the boot program, the upgrade manner of the boot program is limited, which causes inconvenience for a user and increases the chip maintenance cost.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a method for upgrading a boot loader, a related device, and a storage medium, which can directly implement upgrading of the boot loader through online upgrade, thereby improving convenience for users to use and reducing maintenance cost of a chip.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a bootstrap program upgrading method, which comprises the following steps:
acquiring a first upgrade package, wherein the first upgrade package comprises an upgrade file of an application program and an upgrade file of a bootstrap program;
respectively storing the upgrade files of the application program and the boot program to a second partition and a third partition of a memory on a chip; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
upgrading the application program based on the upgrading file of the application program by using the original file of the bootstrap program stored in the first partition;
running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
In the above scheme, the method further comprises:
acquiring first configuration information; the first configuration information is used to modify a partition of the on-chip memory;
and performing partition operation on the memory according to the first configuration information.
In the foregoing solution, the upgrading an application program based on an upgrade file of the application program by using an original boot program file stored in the first partition includes:
and operating the original bootstrap program, and booting and loading the upgrade file of the application program by the original bootstrap program.
In the foregoing solution, before upgrading an application program based on an upgrade file of the application program by using an original file of a boot program stored in the first partition, the method further includes:
and carrying out a first restart operation on the chip by an original bootstrap program.
In the above solution, after the upgraded application program is run, the method further includes:
performing a second reboot operation on the chip by the original boot program; and after the second restart operation is finished, the chip runs the upgraded bootstrap program.
In the above scheme, the method further comprises:
verifying the acquired first upgrade package;
and when the verification is determined to pass, respectively storing the upgrade file of the application program and the upgrade file of the bootstrap program into a second partition and a third partition of a chip memory.
In the above scheme, the chip is an embedded chip.
An embodiment of the present invention further provides a device for upgrading a bootstrap, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first upgrade package which comprises an upgrade file of an application program and an upgrade file of a bootstrap program;
the storage unit is used for respectively storing the upgrading file of the application program and the upgrading file of the bootstrap program into a second partition and a third partition of a memory on a chip; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
the first upgrading unit is used for upgrading the application program based on the upgrading file of the application program based on utilizing the original bootstrap program file stored in the first partition;
the second upgrading unit is used for running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
An embodiment of the present invention further provides a device for upgrading a bootstrap, including: a processor and a memory for storing executable instructions capable of being executed on the processor, wherein the processor is configured to perform any of the steps of the above method when the executable instructions are executed.
Embodiments of the present invention also provide a computer-readable storage medium, on which executable instructions are stored, and when executed by a processor, the executable instructions implement any one of the steps of the above method.
The embodiment of the invention discloses a method, a device and a storage medium for upgrading a bootstrap program; the method comprises the following steps: acquiring a first upgrade package, wherein the first upgrade package comprises an upgrade file of an application program and an upgrade file of a bootstrap program; respectively storing the upgrade files of the application programs and the upgrade files of the bootstrap programs into a second partition and a third partition of a chip memory; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program; upgrading the application program based on the upgrading file of the application program by using the original file of the bootstrap program stored in the first partition; running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program. In the embodiment of the invention, the upgrading file of the bootstrap program and the upgrading file of the application program are imported into different partitions of a chip memory, and the function of reading and writing the chip memory is added in the application program; in the embodiment of the invention, after the original bootstrap program is used for upgrading the application program, the application program after running the upgrade can execute the corresponding bootstrap program upgrade command, namely the upgrade file of the bootstrap program read from the third partition is written into the first partition for storing the bootstrap program operation file, and then the bootstrap program run by the chip is the upgrade file of the bootstrap program read from the first partition.
Drawings
Fig. 1 is a schematic flow chart illustrating an implementation of a boot program upgrading method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a partition of a chip memory according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an implementation process of a boot program upgrading method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating an implementation of a boot program upgrading method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a boot program upgrading apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware component structure of a boot program upgrading apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments.
In the field of optical communication, an embedded controller mainly uses an MCU. The MCU is still one of the most important controllers at present due to its low cost and high reliability. Programs in the MCU generally comprise application programs and bootstrap programs; the application program is used for realizing the corresponding functional task of the optical module, and the functions of the product in the field of optical communication are continuously perfected and enriched in the life cycle, so that the application program needs to be upgraded and updated for many times; the bootstrap program is used to boot and load the application program to realize online upgrade. In the related art, the MCU provides a set of boot-based programs to load the application programs, and update the upgrade package according to a specified protocol (e.g., 1K-xmodem, IIC, etc.), thereby completing the upgrade of the application programs. The upgrading process of the application program specifically comprises the following steps: when online upgrade operation occurs, the method jumps to a bootstrap program, the bootstrap program completes transmission, verification and storage of an upgrade package, and guides and loads a new application program. Meanwhile, in the whole process of upgrading the application program, the service function of the optical module is not affected.
The application program can realize online upgrade through the guiding and loading functions of the guiding program; the boot program generally runs in a code storage area of the embedded controller, when the boot program runs, the running code of the boot program cannot be erased, when the boot program is forcibly erased, the whole program in the MCU is abnormal and crashes, and when the whole program in the MCU is abnormal and crashes, the service function of the optical module is influenced, and service interruption occurs.
Therefore, in the related art, when upgrading the boot program, the boot program cannot be directly realized through online upgrade, and the embedded chip must be returned to the factory and realized by using a special tool. The limitation of the upgrading mode of the bootstrap program causes inconvenience for users and increases the maintenance cost of the chip.
The embodiment of the invention provides a method for upgrading a bootstrap program on line based on the background, and the method can be compatible with the original conventional bootstrap application program on-line upgrading system. The updating and upgrading of the bootstrap program are realized by adding partial functions to the application program. Meanwhile, the whole upgrading process is completely compatible with the original upgrading system, and the whole upgrading process can not cause interruption and exit of any optical service.
In each embodiment of the invention, the upgrading file of the bootstrap program and the upgrading file of the application program are imported into different partitions of the chip memory, and the function of reading and writing the chip memory is added in the application program. After the application program is upgraded by using the original bootstrap program, the upgraded application program can execute a corresponding bootstrap program upgrade command, namely, the upgrade file of the bootstrap program read from the third partition is written into the first partition for storing the bootstrap program operation file, and then, the bootstrap program operated by the chip is the upgrade file of the bootstrap program read from the first partition.
The embodiment of the invention provides a method for upgrading a bootstrap program, and fig. 1 is a schematic flow chart illustrating the implementation of the method for upgrading the bootstrap program according to the embodiment of the invention. As shown in fig. 1, the method comprises the steps of:
step 101: acquiring a first upgrade package, wherein the first upgrade package comprises an upgrade file of an application program and an upgrade file of a bootstrap program;
step 102: respectively storing the upgrade files of the application program and the boot program to a second partition and a third partition of a memory on a chip; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
step 103: upgrading the application program based on the upgrading file of the application program by using the original file of the bootstrap program stored in the first partition;
step 104: running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
The bootstrap program upgrading method provided by the embodiment of the invention can be applied to embedded chips, such as MCU (microprogrammed control Unit).
In step 101, here, the upgrade file of the application program may be a compiled binary (english may be expressed as BIN) file corresponding to the application program to be upgraded (or the upgraded application program); the upgrade file of the boot program may be a compiled binary file corresponding to the boot program to be upgraded (or the upgraded boot program).
In practical application, the manner of acquiring the first data packet may be to receive the first data packet sent by the electronic device that has established a connection relationship with the embedded chip. Here, the electronic device may be an upper computer, and the description will be given by taking the upper computer as an example.
In practical application, before step 101, the upper computer needs to combine the upgrade file of the application program and the upgrade file of the boot program according to a specific requirement to form a first upgrade package. A special requirement here may be that the structure of the upgrade file of the application matches the structure of the second partition in the subsequent chip memory, and the structure of the upgrade file of the boot program matches the structure of the third partition in the subsequent chip memory.
Before step 102, a partition operation needs to be performed on the memory on the chip, so that the upgrade file of the application program and the upgrade file of the boot program can be stored in different partitions in the memory of the chip.
Based on this, in an embodiment, the method further comprises:
acquiring first configuration information; the first configuration information is used to modify a partition of the on-chip memory;
and performing partition operation on the memory according to the first configuration information.
In practical application, the chip memory may be an erasable memory such as Flash on an embedded chip.
In practical application, the manner of acquiring the first configuration information may be to receive the first configuration information sent by the upper computer. In practice, the memory may be divided into a plurality of partitions, but the total capacity of the plurality of partitions cannot exceed the total capacity of the memory.
In one embodiment, as shown in fig. 2, the memory is divided into three partitions, i.e., a first partition, a second partition and a third partition, according to the first configuration information. And the first partition is used for storing the running file of the bootstrap program; the second partition is used for storing an upgrade file of an application program; the third partition is used to store an upgrade file of the boot program.
In actual application, after the partitioning operation is performed, the original file of the boot program is stored in the first partition for subsequent use, where the original file of the boot program may be a compiled binary file corresponding to the original application program.
In step 102, during actual application, the original boot program writes the upgrade file of the application program into the second partition, and writes the upgrade file of the boot program into the third partition. Here, the original boot program may be understood as a boot program before upgrading, and a compiled binary file corresponding to the original boot program, that is, an original file of the boot program, is stored in the first partition. This process can be illustrated with reference to the "1 program download" process in fig. 3.
Before step 103, a reboot operation needs to be performed on the chip, so that the chip is already the latest written data when reading the data of the second partition and the third partition.
Based on this, in an embodiment, before upgrading an application program based on an upgrade file of the application program by using an original file of a boot program stored in the first partition, the method further includes:
and carrying out a first restart operation on the chip by an original bootstrap program.
In step 103, the main objectives are: and upgrading the application program by using the original boot lead sequence. Here, the upgraded application program is mainly added with a boot program upgrade processing command compared with the application program before upgrading, and the command performs an operation of reading the upgrade file of the boot program from the third partition and writing the read upgrade file of the boot program into the first partition to replace the original file of the boot program in the first partition. In practical applications, the command is specifically realized by calling functions in the application program for reading and writing the on-chip memory.
In an embodiment, the upgrading the application program based on the upgrade file of the application program by using the original boot program file stored in the first partition includes:
and operating the original bootstrap program, and booting and loading the upgrade file of the application program by the original bootstrap program.
In practice, the process can refer to the process schematic of "2 boot, load" in fig. 3.
In step 104, in the actual application, after the application program is upgraded, the upgraded application program is run, and when the upgraded application program is run, the above-mentioned boot program upgrade processing command is executed, so as to replace the original file of the boot program in the first partition with the upgrade file of the boot program. At this point, the boot program has already implemented the upgrade. This process can be illustrated with reference to the process "replacement of 3 boot program" in fig. 3.
After step 104, the chip needs to be restarted again, so that the chip reads the upgrade file of the boot program currently stored in the first area, and runs the upgraded boot program.
Based on this, in an embodiment, after the upgraded application program is executed, the method further includes:
performing a second reboot operation on the chip by the original boot program; and after the second restart operation is finished, the chip runs the upgraded bootstrap program.
According to the bootstrap program upgrading method provided by the embodiment of the invention, a first upgrading package is obtained, wherein the first upgrading package comprises an upgrading file of an application program and an upgrading file of a bootstrap program; respectively storing the upgrade files of the application programs and the upgrade files of the bootstrap programs into a second partition and a third partition of a chip memory; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program; upgrading the application program based on the upgrading file of the application program by using the original file of the bootstrap program stored in the first partition; running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program. In the embodiment of the invention, the upgrading file of the bootstrap program and the upgrading file of the application program are imported into different partitions of a chip memory, and the function of reading and writing the chip memory is added in the application program; in the embodiment of the invention, after the original bootstrap program is used for upgrading the application program, the application program after running the upgrade can execute the corresponding bootstrap program upgrade command, namely the upgrade file of the bootstrap program read from the third partition is written into the first partition for storing the bootstrap program operation file, and then the bootstrap program run by the chip is the upgrade file of the bootstrap program read from the first partition.
The present invention will be described in further detail with reference to the following application examples.
In an application embodiment of the present invention, a chip is an MCU in an optical module, a memory is Flash, and fig. 4 is a schematic diagram illustrating an implementation flow of upgrading a boot program according to an application embodiment of the present invention. As shown in fig. 4, the method comprises the steps of:
step 401: acquiring a first upgrade package;
in practical application, the upper computer firstly packages the binary file of the application program to be upgraded and the binary file of the bootstrap program to be upgraded into a first upgrade package according to the positions of a second partition and a third partition in a Flash partition on the MCU chip. The MCU acquires a first upgrade package sent by the upper computer. After step 401 is completed, the process proceeds to step 402.
It should be noted that: before step 401, the upper computer needs to combine the binary file of the application program to be upgraded and the binary file of the bootstrap program to be upgraded into a first upgrade package according to special requirements. The special requirements here may be: (1) the capacity of the original bootstrap program, the application program to be upgraded and the bootstrap program to be upgraded must be smaller than the capacity of the Flash on the MCU chip; (2) when a binary file is formed, a file check code is added; and when an upgrade package is formed, adding an upgrade package check code.
Step 402: downloading the first upgrade package;
in practical application, the first upgrade package is downloaded to a specified position according to an upgrade process in the related technology. After step 402 is completed, the process proceeds to step 403.
Step 403: verifying the first upgrade package;
in practical applications, the verification here may be to verify the integrity of the first upgrade package, specifically: data loss is easy to generate in the transmission process of the upgrade package, so that the upgrade package cannot be normally used.
When the verification result is passed, the step 404 is carried out; when the verification result is not passed, the procedure proceeds to step 411.
Step 404: writing the first upgrade package into a memory of an MCU;
in practical application, the original bootstrap program can write the data in the first upgrade package into Flash on the MCU chip. At the moment, the second partition is replaced by the upgrade file of the application program in the first upgrade package; the third partition is replaced with an upgrade file of the boot program in the first upgrade package. At this point, it is the original file of the boot program that is stored in the first partition. After step 404 is completed, the process proceeds to step 405.
Step 405: restarting the MCU;
in practical applications, the original boot program can restart the chip. After step 405 is completed, the process proceeds to step 406.
Step 406: guiding and loading the upgrade file of the application program by using the original file of the guide program;
in practical application, the application program to be upgraded in the second partition can be booted and loaded by the original bootstrap program. After step 406 is completed, the process proceeds to step 407.
Step 407: verifying the binary file of the bootstrap program to be upgraded;
in practical applications, the verification here may be to verify the integrity of the binary file of the boot program to be upgraded, specifically: the integrity of the binary file of the bootstrap program to be upgraded can be detected in a mode of checking the check code so as to predict whether the binary file of the bootstrap program to be upgraded is available in advance.
When the verification result is passed, the step 408 is carried out; when the verification result is not passed, the procedure proceeds to step 411.
Step 408: executing the bootstrap program in the replacement partition I by the upgraded application program (namely the application program to be upgraded);
in actual application, the boot program to be upgraded in the third partition is written into the first partition through the Flash read-write interface on the MCU chip so as to replace the original boot program in the first partition.
Step 409: restarting the MCU;
in practical applications, the original boot program can restart the chip. After step 409 is completed, the process proceeds to step 410.
Step 410: the boot program is upgraded successfully;
in practical application, after the restart operation in step 409 is performed, the MCU reads the upgrade file of the currently stored boot program in the first area, that is, runs the upgraded boot program, and at this time, the boot program is upgraded successfully.
Step 411: the boot program upgrade fails.
The application embodiment of the invention adds a function method for upgrading the bootstrap program under the condition of being compatible with the original online upgrading process of the application program. Specifically, a binary file of a bootstrap program to be upgraded is packaged in an application program upgrade package, the application program to be upgraded and the bootstrap program to be upgraded are written into a second partition and a third partition corresponding to a Flash of an MCU through an original application program online upgrade flow, and after the application program to be upgraded is booted and loaded, a new bootstrap program to be upgraded is introduced into a first partition on the Flash of the MCU by using the application program to be upgraded (i.e. the upgraded application program), and the original bootstrap program is replaced. The whole upgrading process is completely compatible with the original upgrading system, and the whole upgrading process can not cause the interruption and exit of any optical service. Therefore, the boot program and the application program of the optical module can be upgraded and updated on line.
In order to implement the method according to the embodiment of the present invention, an apparatus 500 for upgrading a bootstrap program is further provided in the embodiment of the present invention, fig. 5 is a structural diagram of the apparatus according to the embodiment of the present invention, and as shown in fig. 5, the apparatus 500 includes:
an obtaining unit 501, configured to obtain a first upgrade package, where the first upgrade package includes an upgrade file of an application program and an upgrade file of a bootstrap program;
a storage unit 502, configured to store the upgrade file of the application program and the upgrade file of the boot program in a second partition and a third partition of an on-chip memory, respectively; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
a first upgrading unit 503, configured to upgrade, based on an upgrade file of the application program, the application program based on an original bootstrap file stored in the first partition;
a second upgrade unit 504, which is based on running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
In an embodiment, the apparatus further includes a partition unit, configured to:
acquiring first configuration information; the first configuration information is used to modify a partition of the on-chip memory;
and performing partition operation on the memory according to the first configuration information.
In an embodiment, the first upgrading unit 503 is specifically configured to:
and operating the original bootstrap program, and booting and loading the upgrade file of the application program by the original bootstrap program.
In an embodiment, the apparatus further comprises a first restart unit configured to:
and carrying out a first restart operation on the chip by an original bootstrap program.
In an embodiment, the apparatus further comprises a second restart unit for:
performing a second reboot operation on the chip by the original boot program; and after the second restart operation is finished, the chip runs the upgraded bootstrap program.
In an embodiment, the apparatus further comprises a verification unit for verifying whether the device is a mobile device
Verifying the acquired first upgrade package;
and when the verification is determined to pass, respectively storing the upgrade file of the application program and the upgrade file of the bootstrap program into a second partition and a third partition of a chip memory.
In practical applications, the partition unit, the obtaining unit 501, the verifying unit, the storage unit 502, the first restarting unit, the first upgrading unit 503, the second restarting unit, and the second upgrading unit 503 may be implemented by a processor in the boot program upgrading apparatus 500.
It should be noted that: in the boot program upgrading device provided in the above embodiment, only the division of the program modules is exemplified when the boot program is upgraded, and in practical applications, the above processing distribution may be completed by different program modules according to needs, that is, the internal structure of the device may be divided into different program modules to complete all or part of the above-described processing. In addition, the embodiments of the boot program upgrading device and the boot program upgrading method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
Based on the hardware implementation of the program module, and in order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides a device 600 for upgrading a bootstrap, where the device 600 includes:
a memory 601 for storing executable instructions;
the processor 602 is configured to implement the boot program upgrading method provided by the embodiment of the present invention when the processor executes the executable instructions stored in the memory.
In practice, as shown in FIG. 6, the various components of the apparatus 600 are coupled together by a bus system 603. It will be appreciated that the bus system 603 is used to enable communications for connections between these components. The bus system 603 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for the sake of clarity the various buses are labeled as bus system 603 in figure 6.
The embodiment of the invention also provides a storage medium, wherein the storage medium stores executable instructions, and when the executable instructions are executed by at least one processor, the boot program upgrading method provided by the embodiment of the invention is realized.
In some embodiments, the storage medium may be a Memory such as a magnetic random Access Memory (FRAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read Only Memory (CD-ROM); or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In addition, the technical solutions described in the embodiments of the present invention may be arbitrarily combined without conflict.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (10)

1. A method for boot program upgrade, the method comprising:
acquiring a first upgrade package, wherein the first upgrade package comprises an upgrade file of an application program and an upgrade file of a bootstrap program;
respectively storing the upgrade files of the application program and the boot program to a second partition and a third partition of a memory on a chip; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
upgrading the application program based on the upgrading file of the application program by using the original file of the bootstrap program stored in the first partition;
running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
2. The method of claim 1, further comprising:
acquiring first configuration information; the first configuration information is used to modify a partition of the on-chip memory;
and performing partition operation on the memory according to the first configuration information.
3. The method of claim 1, wherein upgrading the application based on the upgrade file of the application using the original boot files stored in the first partition comprises:
and operating the original bootstrap program, and booting and loading the upgrade file of the application program by the original bootstrap program.
4. The method of claim 1, wherein prior to upgrading an application based on an upgrade file of the application using an original file of a boot program stored in the first partition, the method further comprises:
and carrying out a first restart operation on the chip by an original bootstrap program.
5. The method of claim 1, wherein after running the upgraded application, the method further comprises:
performing a second reboot operation on the chip by the original boot program; and after the second restart operation is finished, the chip runs the upgraded bootstrap program.
6. The method of claim 1, further comprising:
verifying the acquired first upgrade package;
and when the verification is determined to pass, respectively storing the upgrade file of the application program and the upgrade file of the bootstrap program into a second partition and a third partition of a chip memory.
7. The method of claim 1, wherein the chip is an embedded chip.
8. A boot program upgrade apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first upgrade package which comprises an upgrade file of an application program and an upgrade file of a bootstrap program;
the storage unit is used for respectively storing the upgrading file of the application program and the upgrading file of the bootstrap program into a second partition and a third partition of a memory on a chip; the memory includes a first partition, a second partition, and a third partition; the first partition is used for storing an operation file of a bootstrap program; the second partition is used for storing an upgrade file of the application program; the third partition is used for storing an upgrade file of the bootstrap program;
the first upgrading unit is used for upgrading the application program based on the upgrading file of the application program based on utilizing the original bootstrap program file stored in the first partition;
the second upgrading unit is used for running the upgraded application program; and reading the upgrade file of the bootstrap program from the third partition by the upgraded application program, and replacing the original file of the bootstrap program in the first partition by using the read upgrade file of the bootstrap program.
9. A boot program upgrade apparatus, comprising: a processor and a memory for storing executable instructions operable on the processor, wherein the processor is operable when executing the executable instructions to perform the steps of the method of any of claims 1 to 7.
10. A storage medium having stored thereon executable instructions, which when executed by a processor, carry out the steps of the method of any one of claims 1 to 7.
CN202010230094.7A 2020-03-27 2020-03-27 Boot program upgrading method and device and storage medium Pending CN111240720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010230094.7A CN111240720A (en) 2020-03-27 2020-03-27 Boot program upgrading method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010230094.7A CN111240720A (en) 2020-03-27 2020-03-27 Boot program upgrading method and device and storage medium

Publications (1)

Publication Number Publication Date
CN111240720A true CN111240720A (en) 2020-06-05

Family

ID=70869426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010230094.7A Pending CN111240720A (en) 2020-03-27 2020-03-27 Boot program upgrading method and device and storage medium

Country Status (1)

Country Link
CN (1) CN111240720A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787378A (en) * 2020-06-28 2020-10-16 海信视像科技股份有限公司 Software upgrading method applied to remote control device and remote control device
CN112612498A (en) * 2020-12-30 2021-04-06 深圳市九洲电器有限公司 Embedded equipment upgrading method and embedded equipment
CN113076109A (en) * 2021-04-08 2021-07-06 成都安恒信息技术有限公司 Cross-platform script language deploying method
CN113254048A (en) * 2021-06-21 2021-08-13 深之蓝(天津)水下智能科技有限公司 Method, device and equipment for updating boot program and computer readable medium
CN113759884A (en) * 2021-11-08 2021-12-07 西安热工研究院有限公司 Method and system for generating input/output point product file of distributed control system
CN113805971A (en) * 2021-09-23 2021-12-17 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN113946360A (en) * 2021-12-21 2022-01-18 万帮数字能源股份有限公司 Method and device for upgrading boot program of power conversion controller
CN114003265A (en) * 2020-07-28 2022-02-01 超级智慧家(上海)物联网科技有限公司 Firmware upgrading method and device
CN117215619A (en) * 2023-11-09 2023-12-12 苏州萨沙迈半导体有限公司 Online upgrading method of application program, chip and intelligent device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002037203A2 (en) * 2000-10-31 2002-05-10 Siemens Aktiengesellschaft Method and arrangement for updating software on a mobile processor-controlled device
CN106406955A (en) * 2016-09-22 2017-02-15 深圳市金溢科技股份有限公司 A method and a device for upgrades of a bootloader program in an RSU apparatus
CN108572830A (en) * 2017-12-22 2018-09-25 深圳市鼎阳科技有限公司 Upgrade method, the system of a kind of embedded system and its bootstrap
CN109189461A (en) * 2018-11-27 2019-01-11 上海辛格林纳新时达电机有限公司 The programme upgrade method and elevator control system and lift facility of elevator control system
CN109460245A (en) * 2018-10-31 2019-03-12 北京众谊越泰科技有限公司 A kind of remote upgrade method of embedded system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002037203A2 (en) * 2000-10-31 2002-05-10 Siemens Aktiengesellschaft Method and arrangement for updating software on a mobile processor-controlled device
CN106406955A (en) * 2016-09-22 2017-02-15 深圳市金溢科技股份有限公司 A method and a device for upgrades of a bootloader program in an RSU apparatus
CN108572830A (en) * 2017-12-22 2018-09-25 深圳市鼎阳科技有限公司 Upgrade method, the system of a kind of embedded system and its bootstrap
CN109460245A (en) * 2018-10-31 2019-03-12 北京众谊越泰科技有限公司 A kind of remote upgrade method of embedded system
CN109189461A (en) * 2018-11-27 2019-01-11 上海辛格林纳新时达电机有限公司 The programme upgrade method and elevator control system and lift facility of elevator control system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787378A (en) * 2020-06-28 2020-10-16 海信视像科技股份有限公司 Software upgrading method applied to remote control device and remote control device
CN114003265A (en) * 2020-07-28 2022-02-01 超级智慧家(上海)物联网科技有限公司 Firmware upgrading method and device
CN112612498A (en) * 2020-12-30 2021-04-06 深圳市九洲电器有限公司 Embedded equipment upgrading method and embedded equipment
CN113076109A (en) * 2021-04-08 2021-07-06 成都安恒信息技术有限公司 Cross-platform script language deploying method
CN113076109B (en) * 2021-04-08 2023-07-04 成都安恒信息技术有限公司 Cross-platform script language deployment method
CN113254048A (en) * 2021-06-21 2021-08-13 深之蓝(天津)水下智能科技有限公司 Method, device and equipment for updating boot program and computer readable medium
CN113254048B (en) * 2021-06-21 2021-09-28 深之蓝(天津)水下智能科技有限公司 Method, device and equipment for updating boot program and computer readable medium
CN113805971A (en) * 2021-09-23 2021-12-17 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN113805971B (en) * 2021-09-23 2023-10-13 武汉深之度科技有限公司 Application program running method, computing device and storage medium
CN113759884B (en) * 2021-11-08 2022-02-01 西安热工研究院有限公司 Method and system for generating input/output point product file of distributed control system
CN113759884A (en) * 2021-11-08 2021-12-07 西安热工研究院有限公司 Method and system for generating input/output point product file of distributed control system
CN113946360A (en) * 2021-12-21 2022-01-18 万帮数字能源股份有限公司 Method and device for upgrading boot program of power conversion controller
CN117215619A (en) * 2023-11-09 2023-12-12 苏州萨沙迈半导体有限公司 Online upgrading method of application program, chip and intelligent device
CN117215619B (en) * 2023-11-09 2024-02-02 苏州萨沙迈半导体有限公司 Online upgrading method of application program, chip and intelligent device

Similar Documents

Publication Publication Date Title
CN111240720A (en) Boot program upgrading method and device and storage medium
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN112988183A (en) Program upgrading method and device, electronic equipment and storage medium
CN108182078B (en) Optimized missile-borne device non-dismantling software online upgrading method
CN104461402B (en) A kind of method for adjusting disk order under Linux system between multi-controller
CN111371610A (en) Network card firmware batch refreshing method, system, terminal and storage medium
CN107220085B (en) Method for automatically upgrading RAID card firmware
US9600397B2 (en) Dynamic debugging method of a software module and corresponding device
CN114860291A (en) Method for guiding and flexibly storing and upgrading application program
CN112860297A (en) Storage system based on automobile binocular camera and system updating method
CN116954752A (en) Differentiated system configuration and loading method and device and computer equipment
CN116954674A (en) eMMC firmware upgrading method, firmware upgrading equipment and storage device
CN100359485C (en) Testing device and method for flush-bonding system
CN114741091A (en) Firmware loading method and device, electronic equipment and computer readable storage medium
CN112596751B (en) Compiling method, terminal, server and storage medium of application program installation package
CN115373707A (en) Task online updating system and method under spacecraft real-time system memory limited condition
CN104636574A (en) Terminal device upgrade method and terminal device
CN113672238B (en) Operation method, device and equipment based on real-time operating system modularized management
CN114610415B (en) Program starting method, system, storage medium and electronic equipment
CN114443582B (en) File system mounting method, device, equipment and medium on operating system
CN117032811A (en) Program starting method of embedded equipment
KR100321999B1 (en) Method for program patch using script
CN118092989A (en) Firmware upgrading method, system, equipment and medium of memory

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