CN112783535A - Firmware upgrading method, embedded device and storage medium - Google Patents

Firmware upgrading method, embedded device and storage medium Download PDF

Info

Publication number
CN112783535A
CN112783535A CN202110261425.8A CN202110261425A CN112783535A CN 112783535 A CN112783535 A CN 112783535A CN 202110261425 A CN202110261425 A CN 202110261425A CN 112783535 A CN112783535 A CN 112783535A
Authority
CN
China
Prior art keywords
upgrade
upgrading
area
file
instruction
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
CN202110261425.8A
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.)
Guangzhou Yousheng Automobile Technology Co ltd
Original Assignee
Guangzhou Yousheng Automobile 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 Guangzhou Yousheng Automobile Technology Co ltd filed Critical Guangzhou Yousheng Automobile Technology Co ltd
Priority to CN202110261425.8A priority Critical patent/CN112783535A/en
Publication of CN112783535A publication Critical patent/CN112783535A/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Landscapes

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

Abstract

The invention discloses a firmware upgrading method, an embedded device and a storage medium, comprising the following steps: dividing a storage space into a plurality of partitions, wherein the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system; after receiving an upgrading instruction, judging whether the first system meets the upgrading condition; if the first system meets the upgrading condition, storing the upgrading file into a storage area according to the upgrading instruction; and calling the upgrading file of the storage area to upgrade the first system of the first system area. In the firmware upgrading method provided by the embodiment of the invention, if the problems of unstable network connection and the like occur, the transmission process of the upgrading file is stopped, but the normal operation of the original firmware is not influenced. After the network connection is recovered to normal, the upgrade file will continue to be transmitted until the transmission is completed, and at this time, the upgrade file in the storage area will be called to upgrade the first system. The problem that upgrading is easy to fail is avoided.

Description

Firmware upgrading method, embedded device and storage medium
Technical Field
The present invention relates to the field of firmware upgrading technologies, and in particular, to a firmware upgrading method, an embedded device, and a storage medium.
Background
At present, OBD (On Board Diagnostics) technology in the automobile market is becoming popular, and all automobile manufacturers comply with the OBD-related standards. In this form, various on-board OBD terminals are introduced, which are directly mounted on the on-board OBD diagnostic interface and read vehicle condition information by using a vehicle diagnostic technique, such as: whether a fault exists, the current rotating speed of the engine, the water temperature and the like.
However, when various kinds of existing embedded devices, such as an on-board OBD terminal, are remotely upgraded, the problem of upgrading failure due to various factors, such as unstable network connection, occurs, and therefore improvements are needed.
Disclosure of Invention
The invention mainly aims to provide a firmware upgrading method, an embedded device and a storage medium, and aims to solve the problem that remote upgrading of an embedded terminal in the prior art is prone to failure.
In order to achieve the above object, the present invention provides a firmware upgrading method, which includes the following steps:
dividing a storage space into a plurality of partitions, wherein the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system;
after receiving an upgrading instruction, judging whether the first system meets the upgrading condition;
if the first system meets the upgrading condition, storing the upgrading file into a storage area according to the upgrading instruction;
and calling the upgrading file of the storage area to upgrade the first system of the first system area.
In the embodiment of the invention, when the firmware needs to be upgraded, the upgrade file can be stored in the storage area and the upgrade file in the storage area is called to upgrade the first system under the condition that the first system meets the upgrade condition, so that the upgrade of the firmware is completed. In the firmware upgrading process in the prior art, when the network connection is unstable, not only the transmission process of the upgrade file is interrupted, but also the firmware cannot normally run sometimes. In the firmware upgrading method of the embodiment of the invention, if various problems such as unstable network connection occur, the transmission process of the upgrade file is stopped, but the normal operation of the original firmware is not influenced. After the network connection is recovered to normal, the upgrade file will continue to be transmitted until all transmission is completed, and at this time, the upgrade file in the storage area will be called to upgrade the first system in the first system area. Therefore, the firmware upgrading method provided by the embodiment of the invention avoids the problems that the upgrading is easy to fail and the firmware cannot normally run due to unstable network connection in the prior art.
In an embodiment of the present invention, the step of determining whether the first system meets the upgrade condition specifically includes: and judging whether the first system meets the upgrading condition or not according to the mark information of the first system.
In an embodiment of the present invention, if the first system meets the upgrade condition, the step of the first system storing the upgrade file into the storage area according to the upgrade instruction specifically includes: and if the mark information of the first system is the mark information for starting the system, storing the upgrade file into a storage area according to the upgrade instruction.
In one embodiment of the present invention, the plurality of partitions further includes a second system area, the second system area being provided with a second system; after the step of judging whether the first system meets the upgrading condition according to the mark information of the first system after receiving the upgrading instruction further comprises the following steps: and if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the second system to the second system, and stopping running the first system.
In one embodiment of the present invention, after the first system is stopped, the method further comprises the following steps:
after receiving an instruction sent by a first system for starting a second system, starting the second system;
storing the upgrade file into a storage area according to the instruction for starting the second system;
and calling the upgrading file of the storage area to upgrade the first system of the first system area.
In one embodiment of the present invention, the plurality of partitions further includes a third system area, the third system area being provided with a third system; after the step of judging whether the first system meets the upgrading condition according to the mark information of the first system after receiving the upgrading instruction further comprises the following steps:
if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the third system to the third system, and stopping running the first system;
after receiving an instruction sent by the first system for starting the third system, starting the third system;
and judging whether the third system meets the upgrading condition or not according to the mark information of the third system.
In an embodiment of the present invention, after the determining whether the third system meets the upgrade condition according to the flag information of the third system, the method further includes the following steps:
if the mark information of the third system is the mark information for starting the system, storing the upgrade file into a storage area according to the instruction for starting the third system;
and calling the upgrading file of the storage area to upgrade the third system of the third system area.
In one embodiment of the present invention, the plurality of partitions further includes a fourth system area, and the fourth system area is provided with a fourth system; after judging whether the third system meets the upgrading condition according to the mark information of the third system, the method further comprises the following steps: and if the mark information of the third system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the fourth system to the fourth system, and stopping running the third system.
In one embodiment of the present invention, after the third system is stopped, the method further comprises the following steps:
after receiving an instruction sent by the third system for starting the fourth system, starting the fourth system;
storing the upgrade file into a storage area according to the instruction for starting the fourth system;
and calling the upgrading file of the storage area to upgrade the first system of the first system area, or calling the upgrading file of the storage area to upgrade the third system of the third system area.
In an embodiment of the present invention, after the upgrading file of the calling storage area upgrades the first system of the first system area, the method further includes the following steps:
judging whether the first system is upgraded or not;
and if the first system is upgraded, the mark information of the first system is changed into the mark information of successful upgrade.
Another object of the present invention is to provide an embedded device, which includes:
the device comprises a partition unit, a storage unit and a control unit, wherein the partition unit divides a storage space into a plurality of partitions, the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system;
the first judging unit is used for judging whether the first system meets the upgrading condition;
the first acquisition unit stores the upgrade file into a storage area according to the upgrade instruction if the first system meets the upgrade condition; and
the first upgrading unit is used for receiving an upgrading instruction; the first upgrading unit calls the upgrading file of the storage area to upgrade the first system of the first system area.
It is a further object of the present invention to propose a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the firmware upgrade method as described above.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a firmware upgrading method according to a first embodiment of the present invention;
FIG. 2 is another flowchart illustrating a firmware upgrading method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a firmware upgrading method according to a first embodiment of the present invention;
FIG. 4 is a schematic flowchart of a firmware upgrading method according to a first embodiment of the present invention;
FIG. 5 is another flowchart illustrating a firmware upgrading method according to the first embodiment of the present invention;
FIG. 6 is a flowchart illustrating a firmware upgrading method according to the first embodiment of the present invention;
FIG. 7 is a flowchart illustrating a firmware upgrading method according to a first embodiment of the present invention;
FIG. 8 is a schematic diagram of a memory space composition of a firmware upgrading method according to a first embodiment of the present invention;
FIG. 9 is a schematic diagram of another memory space composition of the firmware upgrading method according to the first embodiment of the present invention;
FIG. 10 is a schematic diagram of another memory space composition of the firmware upgrading method according to the first embodiment of the present invention;
FIG. 11 is a diagram illustrating an embedded device according to a second embodiment of the present invention;
FIG. 12 is a schematic view of another embedded device according to a second embodiment of the present invention;
FIG. 13 is a schematic diagram of another embedded device according to a second embodiment of the present invention;
FIG. 14 is a schematic diagram of a second embodiment of an embedded device according to the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
As shown in fig. 1 and 7, a first embodiment of the present invention discloses a firmware upgrading method, which includes the following steps:
s100: dividing a storage space into a plurality of partitions, wherein the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system;
s101: after receiving an upgrading instruction, judging whether the first system meets the upgrading condition;
s102: if the first system meets the upgrading condition, storing the upgrading file into a storage area according to the upgrading instruction;
s103: and calling the upgrading file of the storage area to upgrade the first system of the first system area.
In embodiments of the invention, the firmware may run on a microprocessor or may also run on an OBD terminal or other embedded device. The boot area stores a system boot program and system parameters. After the system is powered on, a system bootstrap program initializes hardware equipment and establishes a mapping chart of a memory space, so that the software and hardware environment of the system is brought into a proper environment. The first system area may be a main system area, a first system file is stored in the first system area, and the first system may implement functions such as control and operation. The storage area is mainly used for storing the upgrade files, and the upgrade files can be called by the first system and the like.
In the embodiment of the invention, the storage space is divided into a plurality of partitions, and the functions of the partitions are kept relatively independent to a certain extent. For example, the first system area may implement main functions such as control and operation, and the storage area is mainly used for storing the upgrade file to be called by the first system and the like. It is understood that the number of partitions is not limited, as long as the number of partitions is at least two, and is within the scope of the claimed embodiments.
According to the firmware upgrading method provided by the embodiment of the invention, when the firmware needs to be upgraded, under the condition that the first system meets the upgrading condition, the upgrading file can be stored in the storage area, and the upgrading file in the storage area is called to upgrade the first system, so that the upgrading of the firmware is completed. In the firmware upgrading process in the prior art, when the network connection is unstable, not only the transmission process of the upgrade file is interrupted, but also the firmware cannot normally run sometimes. In the firmware upgrading method of the embodiment of the invention, if various problems such as unstable network connection occur, the transmission process of the upgrade file is stopped, but the normal operation of the original firmware is not influenced. After the network connection is recovered to normal, the upgrade file will continue to be transmitted until all transmission is completed, and at this time, the upgrade file in the storage area will be called to upgrade the first system in the first system area. Therefore, the firmware upgrading method provided by the embodiment of the invention avoids the problems that the upgrading is easy to fail and the firmware cannot normally run due to unstable network connection in the prior art.
In an embodiment of the present invention, after step S100, the following steps may be further included:
s115: starting a first system;
s116: detecting whether a first system enters an upgrading mode;
s117: if the first system enters an upgrading mode, judging whether an upgrading instruction is received or not;
s118: if the upgrade instruction is received, step S101 is executed.
As shown in fig. 2, in an embodiment of the present invention, after step S103, the following steps are further included:
s110: judging whether the first system is upgraded or not;
s111: and if the first system is upgraded, the mark information of the first system is changed into the mark information of successful upgrade.
Therefore, after the first system is upgraded, the mark information of the first system is changed into the mark information which is upgraded successfully, so that whether the first system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the first system when the first system is upgraded again.
As shown in fig. 3, in an embodiment of the present invention, the step of determining whether the first system satisfies the upgrade condition in S101 specifically includes: and judging whether the first system meets the upgrading condition or not according to the mark information of the first system. Correspondingly, the step S101 is specifically:
s104: and after receiving the upgrading instruction, judging whether the first system meets the upgrading condition according to the mark information of the first system.
In the embodiment of the present invention, the flag information of the system may be used to indicate the upgrade status, start and/or operation status, etc. for example, "1" may represent that the system may be started, "2" represents that the system upgrade is successful, and "3" represents that the system upgrade fails. Of course, other binary or hexadecimal characters may be used to indicate upgrade status, start-up and/or operational status, etc. of the system.
When a system upgrade instruction is received, the upgrade status of the first system may be one of the conditions for whether the first system is upgradable. For example, if the flag information of the first system is read or detected as information that the system upgrade is successful, it indicates that the first system has completed the upgrade, and it may not be necessary to upgrade the first system again. If the flag information of the first system is read or detected to be the information of the system upgrade failure, it indicates that the first system has a problem of upgrade failure in the last upgrade process.
After receiving the system upgrade instruction, the operating state of the first system may also be used as one of the conditions for whether the first system can be upgraded. For example, if the flag information of the first system is read or detected as the information of the idle state, it indicates that the first system can be upgraded. And if the flag information of the first system is read or detected to be the information in the non-idle state, the first system is not suitable for upgrading.
After receiving the system upgrade instruction, the start state of the first system may be used as one of the conditions for whether the first system can be upgraded. For example, if the flag information of the first system is read or detected as information that the system is successfully started, it indicates that the first system can be upgraded. If the mark information of the first system is read or detected to be the information in system starting or system starting failure, the first system is not suitable for upgrading.
Therefore, whether the first system is in an environment or condition capable of stably upgrading the system or the firmware can be judged through the mark information of the first system, and further upgrading or non-upgrading operation can be carried out according to different states, environments or conditions of the first system.
As shown in fig. 4, in an embodiment of the present invention, in step S101, the following steps may be specifically performed:
s112: and after receiving an upgrading instruction sent by the network server, judging whether the first system meets the upgrading condition.
That is, an external server may send upgrade instructions to the firmware to enable remote upgrade of the firmware. Of course, the firmware itself can also send the upgrade instruction to realize automatic upgrade.
As shown in fig. 5, in an embodiment of the present invention, step S102 specifically includes:
s105: and if the mark information of the first system is the mark information for starting the system, storing the upgrade file into a storage area according to the upgrade instruction.
In the embodiment of the present invention, if the flag information of the first system is the flag information of the system to be started, which indicates that the first system can start the system upgrade process, the system upgrade file may be stored in the storage area according to the upgrade instruction, so as to be called when the first system is upgraded.
As shown in fig. 6 and 8, in one embodiment of the present invention, the plurality of partitions further includes a second system area provided with a second system. The following steps are also included after step S101:
s106: and if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the second system to the second system, and stopping running the first system.
In the embodiment of the present invention, the second system is mainly a simplified system necessary for enabling the system to operate normally, and may be regarded as a simplest system, a backup system, or a redundant system, or may be used when the system is upgraded remotely. When the first system encounters the problems of unstable network connection, sudden power failure, wiring power failure and the like, the upgrading of the first system may fail, the starting of the first system may fail due to the damage of the first system file, and the like. If the first system can still normally operate, the first system can be upgraded again. Or, preferably, the second system may also be used to complete the upgrade operation of the firmware or the system, which can avoid the possibility that the first system will fail to upgrade when upgrading again, and the second system may be used as a redundant system to complete the upgrade procedure of the system or the firmware, thereby increasing the reliability of the upgrade process and reducing the failure rate of the upgrade process. Meanwhile, the first system stops running, so that the problem of mutual interference caused by the simultaneous running of the first system and the second system can be avoided, and the stability and the reliability of the running of the system are further improved.
As shown in fig. 6, in an embodiment of the present invention, after the step of S106, the following steps are further included:
s107: after receiving an instruction sent by a first system for starting a second system, starting the second system;
s108: storing the upgrade file into a storage area according to the instruction for starting the second system;
s109: and calling the upgrading file of the storage area to upgrade the first system of the first system area.
In the embodiment of the present invention, when the first system cannot be started or upgraded, the second system may be started, and the second system may be capable of maintaining basic functions essential for the system to operate, such as the upgrade function related in the embodiment of the present invention. And after the second system receives an instruction sent by the first system for starting the second system, the second system starts to start and operate.
Optionally, before receiving the instruction sent by the first system to start the second system, the second system is not running, that is, the second system is in an inactive or dormant state. Or, optionally, the second system and the first system operate simultaneously, and only the programs or instructions and implemented functions of the second system and the first system which operate at the same time do not overlap with each other; or the second system and the first system run asynchronously; or the second system and the first system form a framework consisting of a main system and a backup system, and the programs and the realized functions of the second system and the first system are different.
After the second system is operated, the upgrade file is stored in the storage area. After the upgrade file is stored, the second system replaces the first system file in the first system area with the upgrade file, and remote upgrade or recovery operation of the first system is completed. Therefore, even if the first system fails to be upgraded or started, the second system can replace the first system file of the first system area with the upgrade file to complete the remote upgrade or recovery operation of the first system area, so that the first system can complete the upgrade or can recover the normal operation, the reliability of the firmware upgrade process is enhanced, and the safe upgrade of the firmware is realized.
As shown in fig. 6, further, after step S109, the following steps are included:
s113: judging whether the first system is upgraded or not;
s114: and if the first system is upgraded, the mark information of the first system is changed into the mark information of successful upgrade.
Therefore, after the first system is upgraded, the mark information of the first system is changed into the mark information which is upgraded successfully, so that whether the first system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the first system when the first system is upgraded again.
As shown in fig. 7 and 10, in one embodiment of the present invention, the plurality of partitions further includes a third system area provided with a third system. The following steps are also included after step S101:
s200: if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the third system to the third system, and stopping running the first system;
s201: after receiving an instruction sent by the first system for starting the third system, starting the third system;
s202: and judging whether the third system meets the upgrading condition or not according to the mark information of the third system.
In the embodiment of the present invention, the third system may be a sub-system area, and the third system area stores therein a third system file, and the third system may also implement functions such as control and operation. And under the condition that the first system fails to be upgraded, after an instruction for starting the third system is sent to the third system, starting and running the third system.
Optionally, before receiving no instruction sent by the first system to start the third system, the third system is not running, that is, the third system is in an inactive or dormant state. Or, optionally, before the third system receives no instruction sent by the first system to start the third system, the third system and the first system operate simultaneously, and only programs or instructions and implemented functions of the third system and the first system which operate at the same time are not overlapped with each other; or the third system and the first system run asynchronously; or the third system and the first system form a framework consisting of the main system and the auxiliary system, and the third system and the first system are different in running programs and realizing functions.
After the third system is started or operated, whether the third system has the upgrading condition or not needs to be judged, if the third system has the upgrading condition, the third system can be upgraded, and if the third system does not have the upgrading condition, the third system is not upgraded. In the embodiment of the present invention, the flag information of the system may be used to indicate the upgrade status, start and/or operation status, etc. for example, "1" may represent that the system may be started, "2" represents that the system upgrade is successful, and "3" represents that the system upgrade fails. Of course, other binary or hexadecimal characters may be used to indicate upgrade status, start-up and/or operational status, etc. of the system.
When a system upgrade instruction is received, the upgrade status of the third system may be one of the conditions whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as information that the system upgrade is successful, it indicates that the third system has completed the upgrade, and it may not be necessary to upgrade the third system again. If the flag information of the third system is read or detected to be the information of the system upgrade failure, it indicates that the third system has a problem of upgrade failure in the last upgrade process.
After receiving the system upgrade instruction, the operating state of the third system may also be used as one of the conditions for whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as the information of the idle state, it indicates that the third system can be upgraded. And if the flag information of the third system is read or detected to be the information in the non-idle state, the third system is not suitable for upgrading.
After receiving the system upgrade instruction, the start state of the third system may be used as one of the conditions for whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as information that the system is successfully started, it indicates that the third system can be upgraded. If the mark information of the third system is read or detected to be the information in system starting or system starting failure, the third system is not suitable for upgrading.
Therefore, whether the third system is in an environment or condition capable of stably upgrading the system or the firmware can be judged through the mark information of the third system, and further, the operation of upgrading or not can be carried out according to different states, environments or conditions of the third system.
As shown in fig. 7, in an embodiment of the present invention, after step S202, the following steps are further included:
s203: if the mark information of the third system is the mark information for starting the system, storing the upgrade file into a storage area according to the instruction for starting the third system;
s204: and calling the upgrading file of the storage area to upgrade the third system of the third system area.
In the embodiment of the present invention, if the flag information of the third system is the flag information of the system to be started, it indicates that the third system can start the system upgrade process, and the third system stores the system upgrade file into the storage area according to the upgrade instruction, so as to be called when the third system is upgraded.
After the third system is operated, the upgrade file is stored in the storage area. And after the upgrade file is stored, the third system file of the third system area is replaced by the upgrade file, and the remote upgrade or recovery operation of the third system is completed. Therefore, even if the first system fails to be upgraded or started, the third system can be replaced by the upgrade file to finish the remote upgrade or recovery operation of the third system area, so that the third system can finish the upgrade or can recover the normal operation, the reliability of the firmware upgrade process is enhanced, and the safe upgrade of the firmware is realized.
As shown in fig. 7, further, after step S204, the following steps are included:
s209: judging whether the third system is upgraded or not;
s210: and if the third system is upgraded, the mark information of the third system is changed into the mark information which is upgraded successfully.
Therefore, after the third system is upgraded, the mark information of the third system is changed into the mark information which is upgraded successfully, so that whether the third system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the third system when the third system is upgraded next time.
As shown in fig. 7, in one embodiment of the present invention, the plurality of partitions further includes a fourth system area, and the fourth system area is provided with a fourth system. The following steps are also included after step S202:
s205: and if the mark information of the third system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the fourth system to the fourth system, and stopping running the third system.
In the embodiment of the present invention, the fourth system is mainly a simplified system necessary for enabling the system to operate normally, and may be regarded as a simplest system, a backup system, or a redundant system, or may be used when the system is upgraded remotely. When the first system or the third system encounters the problems of unstable network connection, sudden power failure, wiring power failure and the like, the first system or the third system may fail to be upgraded, the first system file or the third system file may be damaged, and the start-up may fail. If the first system or the third system can still operate normally, the first system or the third system can be upgraded again. Or, preferably, the fourth system may also be used to complete the upgrade operation of the firmware or the system, which can avoid the possibility of failure in upgrading the first system or the third system again, and the fourth system may be used as a redundant system to complete the upgrade procedure of the system or the firmware, thereby increasing the reliability of the upgrade process and reducing the failure rate of the upgrade process. Meanwhile, the third system stops running, so that the problem of mutual interference caused by the simultaneous running of the first system, the third system and the fourth system can be avoided, and the running stability and reliability of the system are further improved.
As shown in fig. 7, in an embodiment of the present invention, after step S205, the following steps are further included:
s206: after receiving an instruction sent by the third system for starting the fourth system, starting the fourth system;
s207: storing the upgrade file into a storage area according to the instruction for starting the fourth system;
s208: and calling the upgrading file of the storage area to upgrade the first system of the first system area, or calling the upgrading file of the storage area to upgrade the third system of the third system area.
In the embodiment of the present invention, when the third system cannot be started or upgraded, the fourth system may be started, and the fourth system may be capable of maintaining basic functions essential for the system to operate, such as the upgrade function related in the embodiment of the present invention. And after receiving an instruction sent by the third system for starting the fourth system, starting and running the fourth system.
Optionally, before receiving the instruction sent by the third system to start the fourth system, the fourth system is not running, that is, the fourth system is in an inactive or dormant state. Or, optionally, the fourth system and the third system operate simultaneously, and only the programs or instructions and implemented functions of the fourth system and the third system that operate at the same time do not overlap with each other; optionally, the third system and the fourth system operate asynchronously; or the fourth system and the third system form a framework consisting of the main system and the backup system, and the running programs and the realized functions of the fourth system and the third system are different.
After the fourth system is operated, the upgrade file is stored in the storage area. After the upgrade file is stored, the fourth system replaces the first system file in the first system area with the upgrade file, and remote upgrade or recovery operation of the first system is completed. Or, the fourth system may replace the third system file of the third system area with the upgrade file, and complete the remote upgrade or recovery operation of the third system.
Therefore, even if the first system and the third system are failed to upgrade or failed to start, the upgrade file is used for replacing the first system file of the first system area or the third system file of the third system area after the fourth system, and the remote upgrade or recovery operation of the first system area or the third system area is completed, so that the first system or the third system can complete upgrade or can recover normal operation, the reliability of a firmware upgrade process is enhanced, and the safe upgrade of firmware is realized.
As shown in fig. 7, further, after step S208, the following steps may be further included:
s211: judging whether the first system is upgraded or not;
s212: if the first system is upgraded, the mark information of the first system is changed into mark information which is upgraded successfully;
as shown in fig. 7, further, after step S212, the following steps may be further included:
s213: judging whether the third system is upgraded or not;
s214: and if the third system is upgraded, the mark information of the third system is changed into the mark information which is upgraded successfully.
Therefore, after the first system or the third system is upgraded, the mark information of the first system or the third system is changed into the mark information which is upgraded successfully, so that whether subsequent upgrading operation needs to be carried out on the first system or the third system can be accurately judged according to the last upgrading state of the first system or the third system when the first system or the third system is upgraded again.
As shown in fig. 11 and 8, a second embodiment of the present invention discloses an embedded device including: the device comprises a partition unit, a first judgment unit, a first acquisition unit and a first upgrading unit. The partition unit divides the storage space into a plurality of partitions, the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system. The first judging unit is used for judging whether the first system meets the upgrading condition. If the first system meets the upgrading condition, the first obtaining unit stores the upgrading file into the storage area according to the upgrading instruction; the first upgrading unit is used for obtaining an upgrading instruction, and the first upgrading unit is used for calling an upgrading file of the storage area to upgrade a first system of the first system area. It is understood that an embedded device may be a device having an embedded system, which is a computer system with specific functionality and real-time computing capabilities, embedded mainly inside a mechanical or electrical system. For example, an on-board OBD terminal is also one of the embedded devices.
Because the firmware upgrading method of the embodiment of the present invention has the above-mentioned beneficial effects, and the embedded device of the embodiment of the present invention has the same technical concept as the firmware upgrading method of the embodiment of the present invention, the embedded device of the embodiment of the present invention also has corresponding beneficial effects, that is: when the firmware needs to be upgraded, the first system can store the upgrade file into the storage area and call the upgrade file in the storage area to upgrade the first system under the condition that the first system meets the upgrade condition, so that the upgrade of the firmware is completed. In the firmware upgrading process in the prior art, when the network connection is unstable, not only the transmission process of the upgrade file is interrupted, but also the firmware cannot normally run sometimes. In the firmware upgrading method of the embodiment of the invention, if various problems such as unstable network connection occur, the transmission process of the upgrade file is stopped, but the normal operation of the original firmware is not influenced. After the network connection is recovered to normal, the upgrade file will continue to be transmitted until all transmission is completed, and at this time, the first system will call the upgrade file in the storage area to upgrade the first system in the first system area. Therefore, the firmware upgrading method provided by the embodiment of the invention avoids the problems that the upgrading is easy to fail and the firmware cannot normally run due to unstable network connection in the prior art.
As shown in fig. 12, in an embodiment of the present invention, the embedded device further includes a first sub-determination unit and a first setting unit. The first sub-judgment unit is used for judging whether the first system is upgraded. If the first system is upgraded, the first setting unit may change the flag information of the first system to the flag information of the successful upgrade. Therefore, after the first system is upgraded, the mark information of the first system is changed into the mark information which is upgraded successfully, so that whether the first system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the first system when the first system is upgraded again.
In one embodiment of the present invention, the first judgment unit judges whether the first system satisfies the upgrade condition based on the flag information of the first system. In the embodiment of the present invention, the flag information of the system may be used to indicate the upgrade status, start and/or operation status, etc. for example, "1" may represent that the system may be started, "2" represents that the system upgrade is successful, and "3" represents that the system upgrade fails. Of course, other binary or hexadecimal characters may be used to indicate upgrade status, start-up and/or operational status, etc. of the system.
When a system upgrade instruction is received, the upgrade status of the first system may be one of the conditions for whether the first system is upgradable. For example, if the flag information of the first system is read or detected as information that the system upgrade is successful, it indicates that the first system has completed the upgrade, and it may not be necessary to upgrade the first system again. If the flag information of the first system is read or detected to be the information of the system upgrade failure, it indicates that the first system has a problem of upgrade failure in the last upgrade process.
After receiving the system upgrade instruction, the operating state of the first system may also be used as one of the conditions for whether the first system can be upgraded. For example, if the flag information of the first system is read or detected as the information of the idle state, it indicates that the first system can be upgraded. And if the flag information of the first system is read or detected to be the information in the non-idle state, the first system is not suitable for upgrading.
After receiving the system upgrade instruction, the start state of the first system may be used as one of the conditions for whether the first system can be upgraded. For example, if the flag information of the first system is read or detected as information that the system is successfully started, it indicates that the first system can be upgraded. If the mark information of the first system is read or detected to be the information in system starting or system starting failure, the first system is not suitable for upgrading.
Therefore, whether the first system is in an environment or condition capable of stably upgrading the system or the firmware can be judged through the mark information of the first system, and further upgrading or non-upgrading operation can be carried out according to different states, environments or conditions of the first system.
In an embodiment of the present invention, if the flag information of the first system is flag information for starting a system, the first obtaining unit stores the upgrade file in the storage area according to the upgrade instruction. In the embodiment of the present invention, if the flag information of the first system is the flag information of the system to be started, which indicates that the first system can start the system upgrade process, the system upgrade file may be stored in the storage area according to the upgrade instruction, so as to be called when the first system is upgraded.
As shown in fig. 13, in one embodiment of the present invention, the plurality of partitions further includes a second system area provided with a second system. The embedded device also includes a first switching unit. And if the mark information of the first system is the mark information of successful upgrade or failed upgrade, the first switching unit sends an instruction for starting the second system to the second system and stops operating the first system. In the embodiment of the present invention, the second system is mainly a simplified system necessary for enabling the system to operate normally, and may be regarded as a simplest system, a backup system, or a redundant system, or may be used when the system is upgraded remotely. When the first system encounters the problems of unstable network connection, sudden power failure, wiring power failure and the like, the upgrading of the first system may fail, the starting of the first system may fail due to the damage of the first system file, and the like. If the first system can still normally operate, the first system can be upgraded again. Or, preferably, the second system may also be used to complete the upgrade operation of the firmware or the system, which can avoid the possibility that the first system will fail to upgrade when upgrading again, and the second system may be used as a redundant system to complete the upgrade procedure of the system or the firmware, thereby increasing the reliability of the upgrade process and reducing the failure rate of the upgrade process. Meanwhile, the first system stops running, so that the problem of mutual interference caused by the simultaneous running of the first system and the second system can be avoided, and the stability and the reliability of the running of the system are further improved.
As shown in fig. 13, in an embodiment of the present invention, the embedded device further includes a first starting unit, a second obtaining unit, and a second upgrading unit. And after receiving an instruction sent by the first system for starting the second system, the first starting unit starts the second system. The second obtaining unit stores the upgrading file into the storage area according to the instruction for starting the second system, and the second upgrading unit calls the upgrading file in the storage area to upgrade the first system of the first system area. In the embodiment of the present invention, when the first system cannot be started or upgraded, the second system may be started, and the second system may be capable of maintaining basic functions essential for the system to operate, such as the upgrade function related in the embodiment of the present invention. And after the second system receives an instruction sent by the first system for starting the second system, the second system starts to start and operate.
Optionally, before receiving the instruction sent by the first system to start the second system, the second system is not running, that is, the second system is in an inactive or dormant state. Or, optionally, the second system and the first system operate simultaneously, and only the programs or instructions and implemented functions of the second system and the first system which operate at the same time do not overlap with each other; or the second system and the first system run asynchronously; or the second system and the first system form a framework consisting of a main system and a backup system, and the programs and the realized functions of the second system and the first system are different.
After the second system is operated, the upgrade file is stored in the storage area. After the upgrade file is stored, the second system replaces the first system file in the first system area with the upgrade file, and remote upgrade or recovery operation of the first system is completed. Therefore, even if the first system fails to be upgraded or started, the second system can replace the first system file of the first system area with the upgrade file to complete the remote upgrade or recovery operation of the first system area, so that the first system can complete the upgrade or can recover the normal operation, the reliability of the firmware upgrade process is enhanced, and the safe upgrade of the firmware is realized.
As shown in fig. 13, further, the embedded device further includes a second sub-determination unit and a second setting unit. The second sub-judgment unit is used for judging whether the first system is upgraded. If the first system is upgraded, the second setting unit changes the flag information of the first system into the flag information of successful upgrade. Therefore, after the first system is upgraded, the mark information of the first system is changed into the mark information which is upgraded successfully, so that whether the first system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the first system when the first system is upgraded again.
As shown in fig. 14, in one embodiment of the present invention, the plurality of partitions further includes a third system area provided with a third system. The embedded device also comprises a second switching unit, a second starting unit and a second judging unit. And if the mark information of the first system is the mark information of successful upgrade or failed upgrade, the second switching unit sends an instruction for starting the third system to the third system and stops operating the first system. And after receiving an instruction sent by the first system for starting the third system, the second starting unit starts the third system. The second judging unit judges whether the third system meets the upgrading condition according to the mark information of the third system. In the embodiment of the present invention, the third system may be a sub-system area, and the third system area stores therein a third system file, and the third system may also implement functions such as control and operation. And under the condition that the first system fails to be upgraded, after an instruction for starting the third system is sent to the third system, starting and running the third system.
Optionally, before receiving no instruction sent by the first system to start the third system, the third system is not running, that is, the third system is in an inactive or dormant state. Or, optionally, before the third system receives no instruction sent by the first system to start the third system, the third system and the first system operate simultaneously, and only programs or instructions and implemented functions of the third system and the first system which operate at the same time are not overlapped with each other; or the third system and the first system run asynchronously; or the third system and the first system form a framework consisting of the main system and the auxiliary system, and the third system and the first system are different in running programs and realizing functions.
After the third system is started or operated, whether the third system has the upgrading condition or not needs to be judged, if the third system has the upgrading condition, the third system can be upgraded, and if the third system does not have the upgrading condition, the third system is not upgraded. In the embodiment of the present invention, the flag information of the system may be used to indicate the upgrade status, start and/or operation status, etc. for example, "1" may represent that the system may be started, "2" represents that the system upgrade is successful, and "3" represents that the system upgrade fails. Of course, other binary or hexadecimal characters may be used to indicate upgrade status, start-up and/or operational status, etc. of the system.
When a system upgrade instruction is received, the upgrade status of the third system may be one of the conditions whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as information that the system upgrade is successful, it indicates that the third system has completed the upgrade, and it may not be necessary to upgrade the third system again. If the flag information of the third system is read or detected to be the information of the system upgrade failure, it indicates that the third system has a problem of upgrade failure in the last upgrade process.
After receiving the system upgrade instruction, the operating state of the third system may also be used as one of the conditions for whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as the information of the idle state, it indicates that the third system can be upgraded. And if the flag information of the third system is read or detected to be the information in the non-idle state, the third system is not suitable for upgrading.
After receiving the system upgrade instruction, the start state of the third system may be used as one of the conditions for whether the third system can be upgraded. For example, if the flag information of the third system is read or detected as information that the system is successfully started, it indicates that the third system can be upgraded. If the mark information of the third system is read or detected to be the information in system starting or system starting failure, the third system is not suitable for upgrading.
Therefore, whether the third system is in an environment or condition capable of stably upgrading the system or the firmware can be judged through the mark information of the third system, and further, the operation of upgrading or not can be carried out according to different states, environments or conditions of the third system.
As shown in fig. 14, in an embodiment of the present invention, the embedded device further includes a third obtaining unit and a third upgrading unit. And if the mark information of the third system is the mark information for starting the system, the third acquisition unit stores the upgrade file into the storage area according to the instruction for starting the third system. And the third upgrading unit calls the upgrading file of the storage area to upgrade the third system of the third system area. In the embodiment of the present invention, if the flag information of the third system is the flag information of the system to be started, it indicates that the third system can start the system upgrade process, and the third system stores the system upgrade file into the storage area according to the upgrade instruction, so as to be called when the third system is upgraded.
As shown in fig. 14, in an embodiment of the present invention, the embedded device further includes a third sub-determination unit and a third setting unit. The third sub-judgment unit is used for judging whether the third system is upgraded. If the third system is upgraded, the third setting unit changes the flag information of the third system into the flag information of successful upgrade. Therefore, after the third system is upgraded, the mark information of the third system is changed into the mark information which is upgraded successfully, so that whether the third system can perform subsequent upgrading operation or not can be accurately judged according to the last upgrading state of the third system when the third system is upgraded next time.
As shown in fig. 14, in one embodiment of the present invention, the plurality of partitions further includes a fourth system area, and the fourth system area is provided with a fourth system. The embedded device further comprises a third switching unit. And if the mark information of the third system is the mark information of successful upgrade or failed upgrade, the third switching unit sends an instruction for starting the fourth system to the fourth system and stops running the third system. In the embodiment of the present invention, the fourth system is mainly a simplified system necessary for enabling the system to operate normally, and may be regarded as a simplest system, a backup system, or a redundant system, or may be used when the system is upgraded remotely. When the first system or the third system encounters the problems of unstable network connection, sudden power failure, wiring power failure and the like, the first system or the third system may fail to be upgraded, the first system file or the third system file may be damaged, and the start-up may fail. If the first system or the third system can still operate normally, the first system or the third system can be upgraded again. Or, preferably, the fourth system may also be used to complete the upgrade operation of the firmware or the system, which can avoid the possibility of failure in upgrading the first system or the third system again, and the fourth system may be used as a redundant system to complete the upgrade procedure of the system or the firmware, thereby increasing the reliability of the upgrade process and reducing the failure rate of the upgrade process. Meanwhile, the third system stops running, so that the problem of mutual interference caused by the simultaneous running of the first system, the third system and the fourth system can be avoided, and the running stability and reliability of the system are further improved.
As shown in fig. 14, in an embodiment of the present invention, the embedded device further includes a third starting unit, a fourth obtaining unit, and a fourth upgrading unit. And after receiving an instruction sent by the third system for starting the fourth system, the third starting unit starts the fourth system. And the fourth acquisition unit stores the upgrade file into the storage area according to the instruction for starting the fourth system. The fourth upgrading unit calls the upgrading file of the storage area to upgrade the first system of the first system area, or the fourth upgrading unit calls the upgrading file of the storage area to upgrade the third system of the third system area. In the embodiment of the present invention, when the third system cannot be started or upgraded, the fourth system may be started, and the fourth system may be capable of maintaining basic functions essential for the system to operate, such as the upgrade function related in the embodiment of the present invention. And after receiving an instruction sent by the third system for starting the fourth system, starting and running the fourth system.
Optionally, before receiving the instruction sent by the third system to start the fourth system, the fourth system is not running, that is, the fourth system is in an inactive or dormant state. Or, optionally, the fourth system and the third system operate simultaneously, and only the programs or instructions and implemented functions of the fourth system and the third system that operate at the same time do not overlap with each other; optionally, the third system and the fourth system operate asynchronously; or the fourth system and the third system form a framework consisting of the main system and the backup system, and the running programs and the realized functions of the fourth system and the third system are different.
After the fourth system is operated, the upgrade file is stored in the storage area. After the upgrade file is stored, the fourth system replaces the first system file in the first system area with the upgrade file, and remote upgrade or recovery operation of the first system is completed. Or, the fourth system may replace the third system file of the third system area with the upgrade file, and complete the remote upgrade or recovery operation of the third system.
Therefore, even if the first system and the third system are failed to upgrade or failed to start, the upgrade file is used for replacing the first system file of the first system area or the third system file of the third system area after the fourth system, and the remote upgrade or recovery operation of the first system area or the third system area is completed, so that the first system or the third system can complete upgrade or can recover normal operation, the reliability of a firmware upgrade process is enhanced, and the safe upgrade of firmware is realized.
As shown in fig. 14, further, the embedded device further includes a fourth sub-determination unit and a fourth setting unit. The fourth sub-judgment unit is used for judging whether the first system or the second system is upgraded. If the first system is upgraded, the fourth setting unit changes the mark information of the first system into the mark information of successful upgrade; if the third system is upgraded, the fourth setting unit changes the flag information of the third system into the flag information of successful upgrade. Therefore, after the first system or the third system is upgraded, the mark information of the first system or the third system is changed into the mark information which is upgraded successfully, so that whether subsequent upgrading operation needs to be carried out on the first system or the third system can be accurately judged according to the last upgrading state of the first system or the third system when the first system or the third system is upgraded again.
A third embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the firmware upgrade method as described above. Because the firmware upgrading method according to the embodiment of the present invention has the above-mentioned advantages, and the computer-readable storage medium according to the embodiment of the present invention has the same technical idea as the firmware upgrading method according to the embodiment of the present invention, the computer-readable storage medium according to the embodiment of the present invention also has corresponding advantages, that is: when the firmware needs to be upgraded, the upgrade file can be stored in the storage area under the condition that the first system meets the upgrade condition, and the upgrade file in the storage area is called to upgrade the first system, so that the upgrade of the firmware is completed. In the firmware upgrading process in the prior art, when the network connection is unstable, not only the transmission process of the upgrade file is interrupted, but also the firmware cannot normally run sometimes. In the firmware upgrading method of the embodiment of the invention, if various problems such as unstable network connection occur, the transmission process of the upgrade file is stopped, but the normal operation of the original firmware is not influenced. After the network connection is recovered to normal, the upgrade file will continue to be transmitted until all transmission is completed, and at this time, the upgrade file in the storage area will be called to upgrade the first system in the first system area. Therefore, the firmware upgrading method provided by the embodiment of the invention avoids the problems that the upgrading is easy to fail and the firmware cannot normally run due to unstable network connection in the prior art.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (12)

1. A method for upgrading firmware, comprising the steps of:
dividing a storage space into a plurality of partitions, wherein the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system;
after receiving an upgrading instruction, judging whether the first system meets the upgrading condition;
if the first system meets the upgrading condition, storing the upgrading file into a storage area according to the upgrading instruction;
and calling the upgrading file of the storage area to upgrade the first system of the first system area.
2. The firmware upgrading method according to claim 1, wherein the step of determining whether the first system meets the upgrading condition is specifically:
and judging whether the first system meets the upgrading condition or not according to the mark information of the first system.
3. The firmware upgrading method according to claim 2, wherein if the first system meets the upgrading condition, the step of storing the upgrade file into the storage area by the first system according to the upgrading instruction is specifically:
and if the mark information of the first system is the mark information for starting the system, storing the upgrade file into a storage area according to the upgrade instruction.
4. The firmware upgrade method according to claim 2, wherein the plurality of partitions further include a second system area provided with a second system;
after the step of judging whether the first system meets the upgrading condition according to the mark information of the first system after receiving the upgrading instruction further comprises the following steps:
and if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the second system to the second system, and stopping running the first system.
5. The firmware upgrading method according to claim 4, further comprising the following steps after the first system stops running:
after receiving an instruction sent by a first system for starting a second system, starting the second system;
storing the upgrade file into a storage area according to the instruction for starting the second system;
and calling the upgrading file of the storage area to upgrade the first system of the first system area.
6. The firmware upgrade method according to claim 2, wherein the plurality of partitions further include a third system area provided with a third system;
after the step of judging whether the first system meets the upgrading condition according to the mark information of the first system after receiving the upgrading instruction further comprises the following steps:
if the mark information of the first system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the third system to the third system, and stopping running the first system;
after receiving an instruction sent by the first system for starting the third system, starting the third system;
and judging whether the third system meets the upgrading condition or not according to the mark information of the third system.
7. The firmware upgrading method according to claim 6, further comprising the following steps after judging whether the third system meets the upgrading condition according to the flag information of the third system:
if the mark information of the third system is the mark information for starting the system, storing the upgrade file into a storage area according to the instruction for starting the third system;
and calling the upgrading file of the storage area to upgrade the third system of the third system area.
8. The firmware upgrade method according to claim 6, wherein the plurality of partitions further include a fourth system area provided with a fourth system;
after judging whether the third system meets the upgrading condition according to the mark information of the third system, the method further comprises the following steps:
and if the mark information of the third system is the mark information of successful upgrade or failed upgrade, sending an instruction for starting the fourth system to the fourth system, and stopping running the third system.
9. The firmware upgrading method according to claim 8, further comprising the following steps after the third system stops running:
after receiving an instruction sent by the third system for starting the fourth system, starting the fourth system;
storing the upgrade file into a storage area according to the instruction for starting the fourth system;
and calling the upgrading file of the storage area to upgrade the first system of the first system area, or calling the upgrading file of the storage area to upgrade the third system of the third system area.
10. The firmware upgrading method according to any one of claims 1 to 9, further comprising the following steps after the upgrading of the first system area is performed by the upgrade file of the calling storage area:
judging whether the first system is upgraded or not;
and if the first system is upgraded, the mark information of the first system is changed into the mark information of successful upgrade.
11. An embedded device, comprising:
the device comprises a partition unit, a storage unit and a control unit, wherein the partition unit divides a storage space into a plurality of partitions, the plurality of partitions comprise a boot area, a first system area and a storage area, and the first system area is provided with a first system;
the first judging unit is used for judging whether the first system meets the upgrading condition;
the first acquisition unit stores the upgrade file into a storage area according to the upgrade instruction if the first system meets the upgrade condition; and
the first upgrading unit is used for receiving an upgrading instruction; the first upgrading unit calls the upgrading file of the storage area to upgrade the first system of the first system area.
12. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements a firmware upgrade method as claimed in any one of claims 1 to 10.
CN202110261425.8A 2021-03-10 2021-03-10 Firmware upgrading method, embedded device and storage medium Pending CN112783535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110261425.8A CN112783535A (en) 2021-03-10 2021-03-10 Firmware upgrading method, embedded device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110261425.8A CN112783535A (en) 2021-03-10 2021-03-10 Firmware upgrading method, embedded device and storage medium

Publications (1)

Publication Number Publication Date
CN112783535A true CN112783535A (en) 2021-05-11

Family

ID=75762540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110261425.8A Pending CN112783535A (en) 2021-03-10 2021-03-10 Firmware upgrading method, embedded device and storage medium

Country Status (1)

Country Link
CN (1) CN112783535A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905039A (en) * 2021-09-30 2022-01-07 苏州挚途科技有限公司 System upgrade file transmission method, device and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719413A (en) * 2004-07-07 2006-01-11 华为技术有限公司 Upgrading method of communication equipment
CN106020865A (en) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 System upgrading method and device
CN106569847A (en) * 2016-10-14 2017-04-19 数源科技股份有限公司 Method for realizing IAP remote upgrade through vehicle-mounted system based on mobile network
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
CN109032846A (en) * 2018-08-08 2018-12-18 京信通信系统(中国)有限公司 Equipment remote backup upgrade method, device, computer storage medium and equipment
CN109416629A (en) * 2017-11-01 2019-03-01 深圳市大疆创新科技有限公司 Firmware upgrade method, electronic equipment, camera system and unmanned vehicle
CN109582332A (en) * 2018-11-08 2019-04-05 深圳市景阳科技股份有限公司 The method for upgrading system and device of internet video camera
CN110309018A (en) * 2019-07-02 2019-10-08 深圳市小兔充充科技有限公司 Charging equipment system switching method, charging equipment and readable storage medium storing program for executing
CN110737449A (en) * 2019-08-23 2020-01-31 上海商米科技集团股份有限公司 Method, apparatus, and machine-readable storage medium for processing device firmware
CN111752577A (en) * 2019-03-28 2020-10-09 深圳市优必选科技有限公司 System version upgrading method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719413A (en) * 2004-07-07 2006-01-11 华为技术有限公司 Upgrading method of communication equipment
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
CN106020865A (en) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 System upgrading method and device
CN106569847A (en) * 2016-10-14 2017-04-19 数源科技股份有限公司 Method for realizing IAP remote upgrade through vehicle-mounted system based on mobile network
CN109416629A (en) * 2017-11-01 2019-03-01 深圳市大疆创新科技有限公司 Firmware upgrade method, electronic equipment, camera system and unmanned vehicle
CN109032846A (en) * 2018-08-08 2018-12-18 京信通信系统(中国)有限公司 Equipment remote backup upgrade method, device, computer storage medium and equipment
CN109582332A (en) * 2018-11-08 2019-04-05 深圳市景阳科技股份有限公司 The method for upgrading system and device of internet video camera
CN111752577A (en) * 2019-03-28 2020-10-09 深圳市优必选科技有限公司 System version upgrading method and device
CN110309018A (en) * 2019-07-02 2019-10-08 深圳市小兔充充科技有限公司 Charging equipment system switching method, charging equipment and readable storage medium storing program for executing
CN110737449A (en) * 2019-08-23 2020-01-31 上海商米科技集团股份有限公司 Method, apparatus, and machine-readable storage medium for processing device firmware

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邵云蛟著: "计算机信息与网络安全技术", 河海大学出版社, pages: 1 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905039A (en) * 2021-09-30 2022-01-07 苏州挚途科技有限公司 System upgrade file transmission method, device and system

Similar Documents

Publication Publication Date Title
CN110083374B (en) Upgrade rollback method, system and terminal equipment
CN108334331B (en) Safe electric vehicle battery management system software upgrading method
CN108845824A (en) Using update method and device and computer readable storage medium
CN111399879A (en) Firmware upgrading system and method of CP L D
CN113064745A (en) Method, device and medium for reporting error information
CN106095474A (en) For the method and apparatus updating the software in means of transport
CN102339264A (en) Plug and play control method and system for satellite-borne electronic system equipment
CN112783535A (en) Firmware upgrading method, embedded device and storage medium
CN105045671A (en) Method and device for upgrading systems of intelligent terminals
CN109582324B (en) IC burning method and board card
CN114035818A (en) Firmware upgrading method and device, computer equipment and storage medium
CN111427259B (en) Main and standby switching method of machine frame slot type, intelligent equipment and storage medium
CN111984287A (en) Equipment upgrading method and system
CN112286559A (en) Upgrading method and device for vehicle-mounted intelligent terminal
CN111338660A (en) Method, system, equipment and storage medium for checking batch installation results of operating systems
CN111221683A (en) Double-flash hot backup method, system, terminal and storage medium for data center switch
CN111209143B (en) Recovery method and device of embedded system, embedded device and storage medium
CN114995854A (en) Application program online upgrading method and device, terminal and operation machine
CN115098342A (en) System log collection method, system, terminal and storage medium
CN112596764B (en) Internet of things monitoring method and device based on NB-IoT remote upgrade
CN114780114A (en) Firmware upgrading method, system, vehicle and storage medium
CN113824620A (en) Partition switching method, device, vehicle and storage medium
CN114860292A (en) Terminal equipment firmware upgrading control method and device, computer equipment and medium
CN114124698A (en) Upgrading method, device and system of power distribution automation terminal operation system based on cloud master station
CN116257263A (en) Motorcycle and software upgrading method

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