WO2020118639A1 - 无人飞行器及其固件升级方法 - Google Patents

无人飞行器及其固件升级方法 Download PDF

Info

Publication number
WO2020118639A1
WO2020118639A1 PCT/CN2018/120968 CN2018120968W WO2020118639A1 WO 2020118639 A1 WO2020118639 A1 WO 2020118639A1 CN 2018120968 W CN2018120968 W CN 2018120968W WO 2020118639 A1 WO2020118639 A1 WO 2020118639A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
rollback
version information
rollback version
updated
Prior art date
Application number
PCT/CN2018/120968
Other languages
English (en)
French (fr)
Inventor
江帆
Original Assignee
深圳市大疆软件科技有限公司
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 深圳市大疆软件科技有限公司 filed Critical 深圳市大疆软件科技有限公司
Priority to PCT/CN2018/120968 priority Critical patent/WO2020118639A1/zh
Priority to CN201880068400.2A priority patent/CN111417926A/zh
Publication of WO2020118639A1 publication Critical patent/WO2020118639A1/zh

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/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present disclosure relates to the technical field of unmanned aerial vehicles, in particular, to a method for upgrading firmware of an unmanned aerial vehicle and an unmanned aerial vehicle.
  • the upgrade of the firmware version cannot prevent rollback, even if the user upgrades the latest firmware version at a certain moment, in the subsequent use process, the user may choose to update the old firmware version that has been released, thereby making no one The firmware version of the aircraft is rolled back to the previous version, so the safety performance of the UAV cannot be improved and guaranteed by upgrading the new firmware.
  • the purpose of the present disclosure is to provide an unmanned aerial vehicle firmware upgrade method and unmanned aerial vehicle, and at least to a certain extent overcome the limitations and deficiencies due to related technologies, specifically can overcome the traditional technology because the unmanned aerial vehicle firmware cannot be prevented The risk of unmanned aerial vehicle safety performance degradation due to the rollback of the version during the upgrade process.
  • a firmware upgrade method for an unmanned aerial vehicle including:
  • firmware to be updated is upgradeable firmware
  • the firmware to be updated is installed.
  • an unmanned aerial vehicle including:
  • Memory used to store the current firmware
  • One or more processors are in communication connection with the memory; wherein,
  • the processor When upgrading the current firmware, the processor is used to perform the following operations:
  • firmware to be updated is upgradeable firmware
  • the firmware to be updated is installed.
  • This application discloses an unmanned aerial vehicle and its firmware upgrade method. On the one hand, it obtains the first anti-rollback version information of the current firmware and the second anti-rollback version information of the firmware to be updated; according to the first anti-rollback version Information and the second anti-rollback version information to determine whether the firmware to be updated is upgradeable firmware; if the firmware to be updated is upgradeable firmware, install the firmware to be updated, which solves the problem in the prior art
  • the installation of the firmware to be updated avoids the time-consuming problem caused by the need to reinstall the firmware to be upgraded due to the installation of the wrong version, and improves the efficiency of firmware upgrade.
  • FIG. 1 schematically shows a flowchart of a method for upgrading firmware of an unmanned aerial vehicle.
  • FIG. 2 schematically shows a flowchart of another UAV firmware upgrade method.
  • FIG. 3 schematically shows a flowchart of a method for determining whether the first anti-rollback version information needs to be updated according to the second anti-rollback flag.
  • FIG. 4 schematically shows a flowchart of another unmanned aerial vehicle firmware upgrade method.
  • FIG. 5 schematically shows an example of a device of an unmanned aerial vehicle.
  • Example embodiments will now be described more fully with reference to the drawings.
  • the example embodiments can be implemented in various forms, and should not be construed as being limited to the examples set forth herein; on the contrary, providing these embodiments makes the present disclosure more comprehensive and complete, and fully conveys the idea of the example embodiments For those skilled in the art.
  • the described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner.
  • many specific details are provided to give a sufficient understanding of the embodiments of the present disclosure.
  • those skilled in the art will realize that the technical solutions of the present disclosure may be practiced without omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted.
  • well-known technical solutions are not shown or described in detail in order to avoid overwhelming the subject and obscuring aspects of the present disclosure.
  • the anti-rollback firmware version version information of the current firmware
  • the anti-rollback firmware version information anti-rollback version number
  • the anti-rollback flag the relationship between the anti-rollback firmware version (version information of the current firmware) and the anti-rollback firmware version information (anti-rollback version number) and the anti-rollback flag.
  • the current firmware version information may be V1, V2, ..., Vn
  • the anti-rollback version information may be N1, N2, ..., Nn.
  • the historical firmware version information and anti-rollback version information are (V1, N1);
  • the current firmware version information and anti-rollback version information are (V2, N2);
  • the version information of the firmware to be updated is V3; if the anti-rollback flag bit of the firmware to be updated is 1, it means that the version of the firmware to be updated is a critical version.
  • the anti-rollback version information of the firmware to be updated may be N3; if it is to be updated
  • the anti-rollback flag of the firmware is 0, indicating that the version of the firmware to be updated is a non-critical version.
  • the information of the anti-rollback version of the firmware to be updated is not incremented on the original basis, and the original N2 is maintained.
  • the anti-rollback flag when V3 can rewind to V2, the anti-rollback flag can be 0; when V3 cannot rewind to V2, the anti-rollback flag can be 1.
  • the anti-rollback firmware version information may be configured in the firmware header of the firmware.
  • the firmware header may be as shown in Table 1 below, and may include firmware version information and an anti-rollback flag.
  • the anti-rollback version information may include a version number for which rollback is prohibited, a rollback information update sequence number, a CRC check value, and so on.
  • the firmware can determine whether anti-rollback is required by the anti-rollback flag bit (Anti-rollback flag) set in the firmware header, and the loader will update the stored firmware anti-rollback version information through this flag bit.
  • a firmware upgrade method for an unmanned aerial vehicle is first provided.
  • the firmware upgrade method of the UAV may include step S110, step S120, and step S130. among them:
  • step S110 the first anti-rollback version information of the current firmware and the second anti-rollback version information of the firmware to be updated are acquired.
  • the anti-rollback version information may include an anti-rollback version number, an anti-rollback flag bit, an anti-rollback version, and so on; where the anti-rollback version number may be, for example, N1, N2,... , Nn, etc.; the anti-rollback flag can be, for example, 0 or 1; and, when the anti-rollback flag is 1, it can be determined that the anti-rollback flag is a valid flag; when the anti-rollback flag is 0 At this time, it can be determined that the anti-rollback flag bit is an invalid flag bit; the version number of the anti-rollback prohibition may be, for example, the anti-rollback version number of the historical firmware corresponding to the current firmware that is prohibited from being rolled back by the current firmware (or the firmware to be updated).
  • first anti-rollback version information and the second anti-rollback version information may be the same or different; the first anti-rollback version information may be stored in the current firmware installation package; the second anti-rollback version information The rollback version information may be stored in the installation package of the firmware to be updated, for example. Therefore, the first anti-rollback version information of the current firmware and the second anti-rollback version information of the firmware to be updated can be obtained from the local memory of the UAV, or can be obtained from the server or the cloud, this example does not make special limit.
  • the current firmware may be, for example, an application software installed in the UAV, for example, an agricultural plant protection application software, etc.; the firmware to be updated may be, for example, a higher version of the application software.
  • step S120 according to the first anti-rollback version information and the second anti-rollback version information, it is determined whether the firmware to be updated is upgradeable firmware.
  • the firmware to be updated is determined It is upgradeable firmware; if the first anti-rollback version information is less than the second anti-rollback version information, it is determined that the firmware to be updated is non-upgradable firmware. It should be understood that the comparison of the anti-rollback version information is to be able to distinguish whether the firmware to be updated is upgradeable firmware, and the specific coding rule of the anti-rollback version information is not limited herein.
  • the first anti-rollback version information includes a first anti-rollback version number; the second anti-rollback version information includes a second anti-rollback version number; further, the first The anti-rollback version number and the second anti-rollback version number are determined according to whether the current firmware can be updated to the historical firmware corresponding to the current firmware; for example, when the current firmware can be updated to the previous one corresponding to the current firmware
  • the anti-rollback version number can remain unchanged; for example, when the current firmware does not have the risk of bombing, and the firmware to be updated is only a small improvement compared to the current firmware, Then, the first anti-rollback version number and the second anti-rollback version number may be the same, that is, both may be N1.
  • the current firmware at different release times can share the same first anti-rollback version number; the firmware to be updated at different release times can share the same second anti-rollback version number.
  • the firmware to be updated is upgradeable firmware according to the comparison relationship between the first anti-rollback version number and the second anti-rollback version number. Specifically, it may include: if the first anti-rollback version number is less than or equal to the second anti-rollback version number, the firmware to be updated is upgradeable firmware; if the first anti-rollback version number is greater than If the second anti-rollback version number is used, the firmware to be updated is non-upgradable firmware.
  • the firmware to be updated is The firmware can be upgraded; if the first anti-rollback version number is greater than the second anti-rollback version number, the firmware to be updated is non-upgradable firmware. It should be understood that the comparison of the anti-rollback version numbers is to be able to distinguish whether the firmware to be updated is upgradeable firmware, and the specific anti-rollback version number numbering rules are not limited here.
  • the firmware to be updated is upgradeable firmware (ie, the first anti-rollback version)
  • the version number is less than or equal to the second anti-rollback version number, and the firmware to be updated is upgradeable firmware.
  • the first anti-rollback version number is N1
  • the second anti-rollback version number is N0
  • the firmware to be updated is non-upgradable firmware (that is, the first anti-rollback version number is greater than the second anti-rollback version number Roll back the version number, the firmware to be updated is not upgradeable firmware).
  • step S130 if the firmware to be updated is upgradeable firmware, the firmware to be updated is installed.
  • a software program of the firmware to be updated may be run to install the firmware to be updated so that the firmware to be updated covers the current firmware.
  • FIG. 2 schematically shows another method for upgrading the firmware of an unmanned aerial vehicle.
  • the firmware upgrade method of the UAV may further include steps S210-S230.
  • step S210 it is determined whether the first anti-rollback version information needs to be updated.
  • whether the first anti-rollback version information needs to be updated may be determined according to whether the current firmware has a major vulnerability (for example, the UAV has a risk of bomber bombing, which may be a major vulnerability). That is, if there is a major bug in the current firmware, the first anti-rollback version information needs to be updated.
  • the current firmware has a major vulnerability (for example, the UAV has a risk of bomber bombing, which may be a major vulnerability). That is, if there is a major bug in the current firmware, the first anti-rollback version information needs to be updated.
  • step S220 when the first anti-rollback version information needs to be updated, the second anti-rollback version information is overwritten to the first storage area.
  • step S230 when the first anti-rollback version information does not need to be updated, the first anti-rollback version information is overwritten to the second storage area.
  • the local storage may be a storage hard disk of the UAV; specifically, the first anti-rollback version information and the second anti-rollback version information may be backed up in multiple sectors of the storage hard disk, respectively.
  • the first anti-rollback version information needs to be For storage. Specifically, it may include: synchronizing the first anti-rollback version information to multiple storage areas of the local memory; wherein the multiple storage areas are respectively located in multiple different sectors of the local memory. It should be added here that due to the limited space of the local storage, the space occupied by the backup anti-rollback version information cannot be too large, so the above multiple storage areas can be configured as the first storage area and the second storage area.
  • synchronizing the first anti-rollback version information to multiple storage areas of the local memory may include: synchronizing the first anti-rollback version information to the first storage area of the local memory; The first anti-rollback version information of the first storage area overwrites the historical anti-rollback version information of the second storage area.
  • the current firmware version information and the anti-rollback version information are (V2, N2); the version information of the firmware to be updated is V3; if the anti-rollback flag bit of the firmware to be updated is 1, The anti-rollback version information of the firmware to be updated may be N3; if the anti-rollback flag bit of the firmware to be updated is 0, the anti-rollback version information of the firmware to be updated may be N2. Further, when the anti-rollback version information of the firmware to be updated is N3, the first anti-rollback version information in the first storage area needs to be updated, and the second anti-rollback version information of the firmware to be updated can be sent directly Cover to the first storage area.
  • the anti-rollback version information of the firmware to be updated is N2
  • it is not necessary to update the first anti-rollback version information in the first storage area no need to erase the first anti-rollback version information in the first storage area (Rollback version information)
  • the second anti-rollback version information of the firmware to be updated can be directly overwritten to the second storage area.
  • the first anti-rollback version information includes a first anti-rollback flag bit;
  • the second anti-rollback version information includes a second anti-rollback flag bit; wherein, the first Both the anti-rollback flag and the second anti-rollback flag can include a valid flag and an invalid flag; and the valid flag is used to indicate that the current firmware cannot be updated to historical firmware corresponding to the current firmware
  • the invalid flag bit is used to indicate that the current firmware can be updated to the historical firmware corresponding to the current firmware.
  • the valid flag can be represented by 1, or other characters, such as Y, etc. In this example, there is no special restriction on this; the invalid flag can be represented by 0, or it can be represented by other characters, such as It can be N and so on, this example does not make special restrictions on this.
  • the firmware upgrade method of the UAV may further include: determining whether the first anti-rollback version information needs to be updated according to the second anti-rollback flag. Specifically, referring to FIG. 3, determining whether the first anti-rollback version information needs to be updated according to the second anti-rollback flag may include step S310 and step S320. among them:
  • step S310 it is determined whether the second anti-rollback flag is a valid flag.
  • step S320 if the second anti-rollback flag is a valid flag, the first anti-rollback version information is updated.
  • the second anti-rollback flag bit of the firmware to be updated is a valid flag bit, for example, the second anti-rollback flag bit is 1, the first anti-rollback version information needs to be updated. Specifically, it may include: updating the first anti-rollback version information by using the second anti-rollback version information. For example, the first anti-rollback version information in the first storage area may be updated using the second anti-rollback version information.
  • the second anti-rollback flag bit is an invalid flag bit, that is, the current firmware can be updated to the historical firmware corresponding to the current firmware, the firmware to be updated can be directly installed.
  • the firmware upgrade method of the unmanned aerial vehicle of the present disclosure will be further explained and explained with reference to FIG. 4.
  • the firmware upgrade method of the UAV may include the following steps:
  • Step S410 Update the first anti-rollback version information of the two storage areas, and return the latest first anti-rollback version information (version information that can be rolled back);
  • Step S420 Obtain the latest first anti-rollback version information (version information that can be rolled back);
  • Step S430 Receive the firmware to be updated, and verify whether the second anti-rollback version information included in the firmware header of the firmware to be updated is greater than the first anti-rollback version information
  • Step S440 if the anti-rollback version information included in the firmware header is greater than the above-mentioned latest anti-rollback version information, it is determined whether the anti-rollback flag bit in the firmware header is a valid flag bit;
  • Step S450 if the anti-rollback flag is a valid flag, update the first anti-rollback version information in the first storage area to the second anti-rollback version information; and use the first anti-rollback in the first storage area
  • the version information covers the first anti-rollback version information in the second storage area
  • Step S460 If the anti-rollback flag is an invalid flag, use the second anti-rollback version information to overwrite the first anti-rollback version information in the second storage area;
  • Step S470 install the firmware to be updated.
  • the UAV may include a memory 510 and one or more processors 520; further, the processor may be a flight controller. among them:
  • the memory 510 may be used to store the current firmware; one or more processors 520 are communicatively connected to the memory; wherein, when the current firmware is upgraded, the processor is used to perform the following operations: obtain the first defense of the current firmware Rollback version information and second anti-rollback version information of the firmware to be updated; according to the first anti-rollback version information and the second anti-rollback version information, determine whether the firmware to be updated is upgradeable firmware; If the firmware to be updated is upgradeable firmware, the firmware to be updated is installed.
  • the anti-rollback version information may include an anti-rollback version number, an anti-rollback flag bit, an anti-rollback version, and so on; where the anti-rollback version number may be, for example, N1, N2,... , Nn, etc.; the anti-rollback flag can be, for example, 0 or 1; and, when the anti-rollback flag is 1, it can be determined that the anti-rollback flag is a valid flag; when the anti-rollback flag is 0 At this time, it can be determined that the anti-rollback flag bit is an invalid flag bit; the version number of the anti-rollback prohibition may be, for example, the anti-rollback version number of the historical firmware corresponding to the current firmware that is prohibited from being rolled back by the current firmware (or the firmware to be updated).
  • first anti-rollback version information and the second anti-rollback version information may be the same or different; the first anti-rollback version information may be stored in the current firmware installation package; the second anti-rollback version information The rollback version information may be stored in the installation package of the firmware to be updated, for example. Therefore, the first anti-rollback version information of the current firmware and the second anti-rollback version information of the firmware to be updated can be obtained from the local memory of the UAV, or can be obtained from the server or the cloud, this example does not make special limit.
  • the current firmware may be, for example, an application software installed in the UAV, for example, an agricultural plant protection application software, etc.; the firmware to be updated may be, for example, a higher version of the application software.
  • the flight controller 520 may also be used to determine whether the firmware to be updated is upgradeable according to the comparison result of the first anti-rollback version information and the second anti-rollback version information firmware. Specifically, it may include: if the first anti-rollback version information is less than or equal to the second anti-rollback version information, determining that the firmware to be updated is upgradeable firmware; if the first anti-rollback version information is greater than The second anti-rollback version information determines that the firmware to be updated is non-upgradable firmware.
  • the first anti-rollback version information includes a first anti-rollback version number; the second anti-rollback version information includes a second anti-rollback version number; further, the first The anti-rollback version number and the second anti-rollback version number are determined according to whether the current firmware can be updated to the historical firmware corresponding to the current firmware; for example, when the current firmware can be updated to the previous one corresponding to the current firmware
  • the anti-rollback version number can remain unchanged; for example, when the current firmware does not have the risk of bombing, and the firmware to be updated is only a small improvement compared to the current firmware, Then, the first anti-rollback version number and the second anti-rollback version number may be the same, that is, both may be N1.
  • the current firmware at different release times can share the same first anti-rollback version number; the firmware to be updated at different release times can share the same second anti-rollback version number.
  • the flight controller 520 may also be used to determine whether the firmware to be updated is upgradeable according to the comparison relationship between the first anti-rollback version number and the second anti-rollback version number firmware. Specifically, it may include: if the first anti-rollback version number is less than or equal to the second anti-rollback version number, the firmware to be updated is upgradeable firmware; if the first anti-rollback version number is greater than If the second anti-rollback version number is used, the firmware to be updated is non-upgradable firmware. For example:
  • the firmware to be updated is upgradeable firmware (that is, the first anti-rollback version number is less than or equal to the second anti-rollback version No., the firmware to be updated is upgradeable firmware); when the first anti-rollback version number is N1 and the second anti-rollback version number is N0, it can be determined that the firmware to be updated is non-upgradable firmware (ie, the first anti-rollback version) The number is greater than the second anti-rollback version number, and the firmware to be updated is non-upgradable firmware).
  • the flight controller 520 may also be used to run the software program of the firmware to be updated if the firmware to be updated is upgradeable firmware, install the firmware to be updated, and overwrite the current firmware with the firmware to be updated.
  • the flight controller 520 may also be used to determine whether the first anti-rollback version information needs to be updated according to whether the current firmware has a major vulnerability (for example, the unmanned aerial vehicle has a bomber risk, which may be a major vulnerability). That is, if there is a major bug in the current firmware, the first anti-rollback version information needs to be updated.
  • a major vulnerability for example, the unmanned aerial vehicle has a bomber risk, which may be a major vulnerability.
  • the first anti-rollback version information and the second anti-rollback version information are simultaneously stored in multiple storage areas of the local memory.
  • the local storage may be a storage hard disk of the UAV; specifically, the first anti-rollback version information and the second anti-rollback version information may be backed up in multiple sectors of the storage hard disk, respectively.
  • the flight controller 520 may also be used to:
  • the rollback version information is synchronized to multiple storage areas of the local memory; wherein the multiple storage areas are respectively located in multiple different sectors of the local memory. It should be added here that due to the limited space of the local storage, the space occupied by the backup anti-rollback version information cannot be too large, so the above multiple storage areas can be configured as the first storage area and the second storage area.
  • the flight controller 520 may also be used to: synchronize the first anti-rollback version information to the first storage area of the local memory; use the first anti-rollback version information pair of the first storage area The historical anti-rollback version information of the second storage area is overwritten.
  • the current firmware version information and anti-rollback version information are (V2, N2); the version information of the firmware to be updated is V3; if the anti-rollback flag bit of the firmware to be updated is 1, the anti-rollback of the firmware to be updated The rollback version information may be N3; if the anti-rollback flag bit of the firmware to be updated is 0, the anti-rollback version information of the firmware to be updated may be N2. Further, when the anti-rollback version information of the firmware to be updated is N3, the first anti-rollback version information in the first storage area needs to be updated, and the second anti-rollback version information of the firmware to be updated can be sent directly Cover to the first storage area.
  • the flight controller 520 can also be used to update the first anti-rollback version information in the first storage area when the anti-rollback version information of the firmware to be updated is N2 (no need to erase the first The first anti-rollback version information in a storage area), so the second anti-rollback version information of the firmware to be updated can be directly overwritten to the second storage area.
  • the first anti-rollback version information includes a first anti-rollback flag bit;
  • the second anti-rollback version information includes a second anti-rollback flag bit; wherein, the first Both the anti-rollback flag and the second anti-rollback flag can include a valid flag and an invalid flag; and the valid flag is used to indicate that the current firmware cannot be updated to historical firmware corresponding to the current firmware
  • the invalid flag bit is used to indicate that the current firmware can be updated to the historical firmware corresponding to the current firmware.
  • the valid flag can be represented by 1, or other characters, such as Y, etc. In this example, there is no special restriction on this; the invalid flag can be represented by 0, or it can be represented by other characters, such as It can be N and so on, this example does not make special restrictions on this.
  • the flight controller 520 may also be used to determine whether the first anti-rollback version information needs to be updated according to the second anti-rollback flag. Specifically, if the second anti-rollback flag bit of the firmware to be updated is a valid flag bit, for example, the second anti-rollback flag bit is 1, the first anti-rollback version information needs to be updated. Specifically, it may include: updating the first anti-rollback version information by using the second anti-rollback version information. For example, the first anti-rollback version information in the first storage area may be updated using the second anti-rollback version information.
  • the flight controller 520 may also be used to directly install the to-be-updated if the second anti-rollback flag bit is an invalid flag bit, that is, the current firmware can be updated to the historical firmware corresponding to the current firmware firmware.

Landscapes

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

Abstract

一种无人飞行器及其固件升级方法,属于无人机技术领域,该固件升级方法包括:获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息(S110);根据所述第一防回滚版本信息以及所述第二防回滚版本信息,判断所述待更新固件是否为可升级固件(S120);若所述待更新固件为可升级固件,则安装所述待更新固件(S130)。该方法一方面解决了现有技术中由于未进行版本检测直接进行安装造成的升级错误的固件版本进而引起无人飞行器安全性能下降的问题,保证了无人飞行器的安全性能;另一方面避免了由于安装了错误版本需要对待升级固件进行再次安装引起的较为耗时的问题,提高了固件的升级效率。

Description

无人飞行器及其固件升级方法 技术领域
本公开涉及无人机技术领域,具体而言,涉及一种无人飞行器的固件升级方法以及无人飞行器。
背景技术
随着无人飞行器技术的不断演进,其应用领域和使用人群也越来越广泛,随之而来的是无人飞行器的飞行安全也越来越受到重视。通过对无人飞行器的固件版本升级,可以修复旧的固件版本中存在的重大缺陷和漏洞(bug),以此来提高无人飞行器的安全性能。但是传统的无人飞行器的固件升级方案,不会对固件版本进行防回滚处理。在该情况下,如果最新发布的固件版本能够修复此前固件版本中存在的重大安全漏洞,并能极大程度的降低无人飞行器的炸机风险。而由于固件版本的升级不能防回滚,因此即使用户在某一时刻升级了最新的固件版本,在后续的使用过程中,该用户也有可能选择已发布的旧固件版本进行升级,从而使得无人飞行器的固件版本回退到之前的旧版本中,由此无人飞行器的安全性能无法通过升级新的固件得到提升和保障。
鉴于此,需要提供一种新的固件升级方法及装置。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开的目的在于提供一种无人飞行器的固件升级方法及无人飞行器,进而至少在一定程度上克服由于相关技术的限制和缺陷,具体的可以克服传统技术中由于不能防止无人飞行器的固件版本在升级过程中回滚而导致的无人飞行器安全性能下降的风险。
根据本公开的一个方面,提供一种无人飞行器的固件升级方法,包括:
获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;
根据所述第一防回滚版本信息以及所述第二防回滚版本信息,判断所述待更新固件是否为可升级固件;
若所述待更新固件为可升级固件,则安装所述待更新固件。
根据本申请公开的另一个方面,提供一种无人飞行器,包括:
存储器,用于存储当前固件;
一个或多个处理器,与所述存储器通信连接;其中,
当升级所述当前固件时,所述处理器用于执行如下操作:
获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;
根据所述第一防回滚版本信息以及所述第二防回滚版本信息,判断所述待更新固件是否为可升级固件;
若所述待更新固件为可升级固件,则安装所述待更新固件。
本申请公开一种无人飞行器及其固件升级方法,一方面,获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;根据所述第一防回滚版本信息以及所述第二防回滚版本信息,判断所述待更新固件是否为可升级固件;若所述待更新固件为可升级固件,则安装所述待更新固件,解决了现有技术中由于未进行版本检测直接进行安装造成的升级错误的固件版本进而引起无人飞行器安全性能下降的问题,保证了无人飞行器的安全性能;再一方面,在判断待更新固件为可升级固件后,再对待更新固件进行安装,避免了由于安装了错误版本需要对待升级固件进行再次安装引起的较为耗时的问题,提高了固件的升级效率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示意性示出一种无人飞行器的固件升级方法的流程图。
图2示意性示出另一种无人飞行器的固件升级方法的流程图。
图3示意性示出一种根据第二防回滚标志位,判断第一防回滚版本信息是否需要更新的方法流程图。
图4示意性示出另一种无人飞行器的固件升级方法的流程图。
图5示意性示出一种无人飞行器的装置示例图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
用语“一个”、“一”、“该”和“所述”用以表示存在一个或多个要素/组成部分/等;用语“包括”和“具有”用以表示开放式的包括在内的意思并且是指除了列出的要素/组成部分/等之外还可存在另外的要素/组成部分/等;用语“第一”和“第二”等仅作为标记使用,不是对其对象的数量限制。
首先,对防回滚固件版本(当前固件的版本信息)以及防回滚固件的防回滚版本信息(防回滚版本号)以及防回滚标志位之间的关系进行说明。例如,当前固件的版本信息可以为V1,V2,……,Vn;防回滚版本信息可以为N1,N2,……,Nn。例如:
历史固件的版本信息以及防回滚版本信息为(V1,N1);
当前固件的版本信息以及防回滚版本信息为(V2,N2);
待更新固件的版本信息为V3;如果待更新固件的防回滚标志位为1,表示待更新固件的版本是关键版本,此时待更新固件的防回滚版本信息可以为N3;如果待更新固件的防回滚标志位为0,表示待更新固件的版本为非关键版本,此时待更新固件的防回滚版本信息不在原有的基础上递增,还保持原有的N2。
基于上述方案,当V3可以退回到V2时,防回滚标志位可以为0;当V3不能退回到V2时,防回滚标志位可以为1。
在本公开的一种示例实施方式中,防回滚固件版本信息可以配置在固件的固件头中。其中,固件头可以如下表1所示,可以包含固件版本信息以及防回滚标志位。
表1:固件头格式说明(Firmware Header-FWH)
Figure PCTCN2018120968-appb-000001
进一步的,防回滚版本信息可以包括禁止回滚版本号、回滚信息更新序号以及CRC校验值等等。具体的可以参考如下表2所示。其中,固件可以通过设置在固件头中的防回滚标志位(Anti-rollback flag)来确定是否需要防回滚,loader会通过该标志位来更新存储固件防回滚版本信息。
表2:防回滚版本信息格式说明
名称 起始地址 Size 初始值 描述
SOF 0 4 0x5A5AEEFF  
Anti_rollback_version 4 4   禁止回滚版本号
Update_seq 8 2   回滚信息更新序号,每次更新增加1
resv 10 20 0xFFFF  
CRC16 30 2   CRC16差错校验码
本示例实施方式中首先提供了一种无人飞行器的固件升级方法。参考图1所示,该无人飞行器的固件升级方法可以包括步骤S110、步骤S120以及步骤S130。其中:
在步骤S110中,获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚 版本信息。
在本示例实施方式中,防回滚版本信息可以包括防回滚版本号、防回滚标志位以及禁止防回滚版本等等;其中,防回滚版本号例如可以是N1,N2,……,Nn等等;防回滚标志位例如可以是0或者1;并且,当防回滚标志位为1时,可以确定该防回滚标志位为有效标志位;当防回滚标志位为0时,可以确定该防回滚标志位为无效标志位;禁止防回滚版本号例如可以是当前固件(或者待更新固件)禁止回滚的与当前固件对应的历史固件的防回滚版本号。此处需要说明的是,第一防回滚版本信息与第二防回滚版本信息可以相同,也可以不同;第一防回滚版本信息例如可以存储在当前固件的安装包中;第二防回滚版本信息例如可以存储在待更新固件的安装包中。因此,可以从无人飞行器的本地存储器中获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息,也可以从服务器或者云端获取,本示例对此不做特殊限制。
进一步的,当前固件例如可以是已安装在无人飞行器中的某一应用程序软件,例如可以是农业植保应用软件等等;待更新固件例如可以是该应用程序软件的较高版本。
在步骤S120中,根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件。
在本示例实施方式中,可以根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件。具体的可以包括:若所述第一防回滚版本信息小于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件;若所述第一防回滚版本信息大于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
在另一实施例中,由于防回滚版本信息的编码规则不同,也可以认为若所述第一防回滚版本信息大于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件;若所述第一防回滚版本信息小于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。需要理解的是,防回滚版本信息的比对,是为了能够区分待更新固件是否为可升级固件,而具体的防回滚版本信息的编码规则在此不做限制。
在本示例实施方式中,所述第一防回滚版本信息包括第一防回滚版本号;所述第二防回滚版本信息包括第二防回滚版本号;进一步的,所述第一防回滚版本号以及第二防回滚版本号根据所述当前固件能否更新为与所述当前固件对应的历史固件进行确定;例如,当当前固件可以更新为与该当前固件对应的上一版本的历史固件时,该防回滚版本号可以保持不变;又例如,当当前固件没有炸机风险,且待更新固件相对于当前固件来说,仅仅是对一些小的地方进行了改进,那么,第一防回滚版本号与第二防回滚版本号可以相同,即可以同时为N1。
在本示例实施方式中,不同发布时间的各所述当前固件能够公用同一所述第一防回滚版本号;不同发布时间的各所述待更新固件能够公用同一所述第二防回滚版本号。
在本示例实施方式中,可以根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件。具体的可以包括:如果所述第一防回滚版本号小于等于所述第二防回滚版本号,则所述待更新固件为可升级固件;若所述第一防回滚版本号大于所述第二防回滚版本号,则所述待更新固件为不可升级固件。
在另一事实例中,由于防回滚版本号的编号规则的不同,也可以认为如果所述第一防回滚版本号小于等于所述第二防回滚版本号,则所述待更新固件为可升级固件;若所述第一防回滚版本号大于所述第二防回滚版本号,则所述待更新固件为不可升级固件。需要理解的是,防回滚版本号的比对,是为了能够区分待更新固件是否为可升级固件,而具体的防回滚版本号的编号规则在此不做限制。
举例而言:在某一实施例中,第一防回滚版本号为N1,第二防回滚版本号为N1或者N2时,可以确定待更新固件为可升级固件(即第一防回滚版本号小于或等于第二防回滚版本号,待更新固件为可升级固件)。在另一实施例中,第一防回滚版本号为N1,而第二防回滚版本号为N0,可以确定待更新固件为不可升级固件(即第一防回滚版本号大于第二防回滚版本号,待更新固件为不可升级固件)。
在步骤S130中,若所述待更新固件为可升级固件,则安装所述待更新固件。
在本示例实施方式中,如果待更新固件为可升级固件,则可以运行待更新固件的软件程序,对待更新固件进行安装,使得待更新固件覆盖当前固件。
图2示意性示出另一种无人飞行器的固件升级方法。参考图2所示,该无人飞行器的固件升级方法还可以包括步骤S210-步骤S230。
在步骤S210中,确定所述第一防回滚版本信息是否需要更新。
在本示例实施方式中,可以根据当前固件是否有重大漏洞(例如,无人飞行器存在炸机风险,可以为重大漏洞)确定第一防回滚版本信息是否需要更新。即:如果当前固件存在重大漏洞(bug),则需要对第一防回滚版本信息进行更新。
在步骤S220中,当所述第一防回滚版本信息需要更新时,将所述第二防回滚版本信息覆盖至所述第一存储区域。
在步骤S230中,当所述第一防回滚版本信息不需要更新时,将所述第一防回滚版本信息覆盖至所述第二存储区域。
下面,将对步骤S220以及步骤S230进行解释以及说明。
首先,所述第一防回滚版本信息以及第二防回滚版本信息同时存储在本地存储器的多个存储区域。其中,本地存储器可以为无人飞行器的存储硬盘;具体的,可以在该存储硬盘的多个扇区(sector)分别对第一防回滚版本信息以及第二防回滚版本信息进行备份。
其次,为了可以防止第一防回滚版本信息的丢失,进而导致无法对防回滚版本信息进行比对引起的固件版本错误的问题,在进行升级之前,还需要对第一防回滚版本信息 进行存储。具体的可以包括:将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域;其中,所述多个存储区域分别位于所述本地存储器的多个不同扇区。此处需要补充说明的是,由于本地存储器的空间有限,因此备份防回滚版本信息所占的空间不能太多,因此上述多个存储区域可以被配置为第一存储区域以及第二存储区域。因此,将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域可以包括:将所述第一防回滚版本信息同步至所述本地存储器的第一存储区域;利用所述第一存储区域的第一防回滚版本信息对所述第二存储区域的历史防回滚版本信息进行覆盖。
进一步的,在某一实施例中,当前固件的版本信息以及防回滚版本信息为(V2,N2);待更新固件的版本信息为V3;如果待更新固件的防回滚标志位为1,则待更新固件的防回滚版本信息可以为N3;如果待更新固件的防回滚标志位为0,则待更新固件的防回滚版本信息可以为N2。进一步的,当待更新固件的防回滚版本信息为N3时,需要对第一存储区域中的第一防回滚版本信息进行更新,可以直接将待更新固件的第二防回滚版本信息发覆盖至第一存储区域。
更进一步的,当待更新固件的防回滚版本信息为N2时,可以不用对第一存储区域中的第一防回滚版本信息进行更新(不需要擦除第一存储区域中的第一防回滚版本信息),因此可以直接将待更新固件的第二防回滚版本信息发覆盖至第二存储区域。
下面,对上述存储硬盘的整体分区以及防回滚备份区域进行说明。具体的,可以参考下表3所示。
表3:固件分区说明
名称 起始地址 Size 描述
Firmware Header 0 128 固件头信息
Anti_rollback backup 128 32 防回滚信息备份区(1)
Firmware 512 Firmware_size 起始地址取决于CPU特性,SAMV7为512bytes
User flag Flash_size-128 64 用户标志
Anti_rollback backup Flash_size-64 32 防回滚信息备份区(2)
Firmware flag Flash_size-32 32 固件升级标志
在本公开的一种示例实施方式中,所述第一防回滚版本信息包括第一防回滚标志位;所述第二防回滚版本信息包括第二防回滚标志位;其中,第一防回滚标志位以及第二防回滚标志均可以包括有效标志位以及无效标志位;并且,所述有效标志位用于表示所述当前固件不能更新为与所述当前固件对应的历史固件;所述无效标志位用于表示所述当前固件能够更新为与所述当前固件对应的历史固件。进一步的,有效标志位可以用1表示,也可以用其他字符表示,例如可以是Y等等,本示例对此不做特殊限制;无效标志位可以用0表示,也可以用其他字符表示,例如可以是N等等,本示例对此不做特殊限制。
在本公开的一种示例实施方式中,该无人飞行器的固件升级方法还可以包括:根据 所述第二防回滚标志位,确定所述第一防回滚版本信息是否需要更新。具体的,参考图3所示,根据第二防回滚标志位,确定第一防回滚版本信息是否需要更新可以包括步骤S310以及步骤S320。其中:
在步骤S310中,判断所述第二防回滚标志是否为有效标志位。
在步骤S320中,如果所述第二防回滚标志位为有效标志位,则更新所述第一防回滚版本信息。
下面,对步骤S310以及步骤S320进行解释以及说明。如果待更新固件的第二防回滚标志位有效标志位,例如第二防回滚标志位为1,则需要更新第一防回滚版本信息。具体的可以包括:利用第二防回滚版本信息对所述第一防回滚版本信息进行更新。例如,可以利用第二防回滚版本信息对第一存储区域中的第一防回滚版本信息进行更新。此处需要补充说明的是,为了保证防回滚版本信息的安全性,当需要对第一存储区域的防回滚版本信息进行擦除,并存储第二防回滚版本信息时,需要先确定第二存储区域的第一防回滚版本信息是否完整;并在第二存储区域的第一防回滚版本信息完整时,再对第一存储区域的第一防回滚版本信息进行擦除并更新。
进一步的,如果所述第二防回滚标志位为无效标志位,即当前固件能够更新为与所述当前固件对应的历史固件,则可以直接安装所述待更新固件。
下面,将结合图4对本公开的无人飞行器的固件升级方法进行进一步的解释以及说明。参考图4所示,该无人飞行器的固件升级方法可以包括以下步骤:
步骤S410,更新两个存储区域的第一防回滚版本信息,并返回最新第一防回滚版本信息(可回退版本信息);
步骤S420,获取最新第一防回滚版本信息(可回退版本信息);
步骤S430,接收待更新固件,并校验待更新固件的固件头中包括的第二防回滚版本信息是否大于上述第一防回滚版本信息;
步骤S440,如果固件头中包括的防回滚版本信息大于上述最新防回滚版本信息,则确定固件头中的防回滚标志位是否为有效标志位;
步骤S450,如果防回滚标志位为有效标志位,则将第一存储区域的第一防回滚版本信息更新为第二防回滚版本信息;并利用第一存储区域的第一防回滚版本信息覆盖第二存储区域的第一防回滚版本信息;
步骤S460,如果防回滚标志位为无效标志位,则利用第二防回滚版本信息覆盖第二存储区域的第一防回滚版本信息;
步骤S470,安装待更新固件。
本公开还提供了一种无人飞行器。参考图5所示,该无人飞行器可以包括存储器510以及一个或多个处理器520;进一步的,处理器可以为飞行控制器。其中:
存储器510可以用于存储当前固件;一个或多个处理器520,与所述存储器通信连 接;其中,当升级所述当前固件时,所述处理器用于执行如下操作:获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件;若所述待更新固件为可升级固件,则安装所述待更新固件。
在本示例实施方式中,防回滚版本信息可以包括防回滚版本号、防回滚标志位以及禁止防回滚版本等等;其中,防回滚版本号例如可以是N1,N2,……,Nn等等;防回滚标志位例如可以是0或者1;并且,当防回滚标志位为1时,可以确定该防回滚标志位为有效标志位;当防回滚标志位为0时,可以确定该防回滚标志位为无效标志位;禁止防回滚版本号例如可以是当前固件(或者待更新固件)禁止回滚的与当前固件对应的历史固件的防回滚版本号。此处需要说明的是,第一防回滚版本信息与第二防回滚版本信息可以相同,也可以不同;第一防回滚版本信息例如可以存储在当前固件的安装包中;第二防回滚版本信息例如可以存储在待更新固件的安装包中。因此,可以从无人飞行器的本地存储器中获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息,也可以从服务器或者云端获取,本示例对此不做特殊限制。
进一步的,当前固件例如可以是已安装在无人飞行器中的某一应用程序软件,例如可以是农业植保应用软件等等;待更新固件例如可以是该应用程序软件的较高版本。
在本示例实施方式中,飞行控制器520还可以用于根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件。具体的可以包括:若所述第一防回滚版本信息小于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件;若所述第一防回滚版本信息大于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
在本示例实施方式中,所述第一防回滚版本信息包括第一防回滚版本号;所述第二防回滚版本信息包括第二防回滚版本号;进一步的,所述第一防回滚版本号以及第二防回滚版本号根据所述当前固件能否更新为与所述当前固件对应的历史固件进行确定;例如,当当前固件可以更新为与该当前固件对应的上一版本的历史固件时,该防回滚版本号可以保持不变;又例如,当当前固件没有炸机风险,且待更新固件相对于当前固件来说,仅仅是对一些小的地方进行了改进,那么,第一防回滚版本号与第二防回滚版本号可以相同,即可以同时为N1。
在本示例实施方式中,不同发布时间的各所述当前固件能够公用同一所述第一防回滚版本号;不同发布时间的各所述待更新固件能够公用同一所述第二防回滚版本号。
在本示例实施方式中,飞行控制器520还可以用于根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件。具体的可以包括:如果所述第一防回滚版本号小于等于所述第二防回滚版本号,则所述待更新固件为可升级固件;若所述第一防回滚版本号大于所述第二防回滚版本号,则所述待更新 固件为不可升级固件。举例而言:
当第一防回滚版本号为N1,第二防回滚版本号为N1或者N2时,可以确定待更新固件为可升级固件(即第一防回滚版本号小于等于第二防回滚版本号,待更新固件为可升级固件);当第一防回滚版本号为N1,第二防回滚版本号为N0时,可以确定待更新固件为不可升级固件(即第一防回滚版本号大于第二防回滚版本号,待更新固件为不可升级固件)。
在本示例实施方式中,飞行控制器520还可以用于如果待更新固件为可升级固件,则可以运行待更新固件的软件程序,对待更新固件进行安装,利用待更新固件覆盖当前固件。
在本示例实施方式中,飞行控制器520还可以用于根据当前固件是否有重大漏洞(例如,无人飞行器存在炸机风险,可以为重大漏洞)确定第一防回滚版本信息是否需要更新。即:如果当前固件存在重大漏洞(bug),则需要对第一防回滚版本信息进行更新。
进一步的,所述第一防回滚版本信息以及第二防回滚版本信息同时存储在本地存储器的多个存储区域。其中,本地存储器可以为无人飞行器的存储硬盘;具体的,可以在该存储硬盘的多个扇区(sector)分别对第一防回滚版本信息以及第二防回滚版本信息进行备份。
其次,为了可以防止第一防回滚版本信息的丢失,进而导致无法对防回滚版本信息进行比对引起的固件版本错误的问题,飞行控制器520还可以用于:将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域;其中,所述多个存储区域分别位于所述本地存储器的多个不同扇区。此处需要补充说明的是,由于本地存储器的空间有限,因此备份防回滚版本信息所占的空间不能太多,因此上述多个存储区域可以被配置为第一存储区域以及第二存储区域。进一步的,飞行控制器520还可以用于:将所述第一防回滚版本信息同步至所述本地存储器的第一存储区域;利用所述第一存储区域的第一防回滚版本信息对所述第二存储区域的历史防回滚版本信息进行覆盖。
进一步的,当前固件的版本信息以及防回滚版本信息为(V2,N2);待更新固件的版本信息为V3;如果待更新固件的防回滚标志位为1,则待更新固件的防回滚版本信息可以为N3;如果待更新固件的防回滚标志位为0,则待更新固件的防回滚版本信息可以为N2。进一步的,当待更新固件的防回滚版本信息为N3时,需要对第一存储区域中的第一防回滚版本信息进行更新,可以直接将待更新固件的第二防回滚版本信息发覆盖至第一存储区域。
更进一步的,飞行控制器520还可以用于当待更新固件的防回滚版本信息为N2时,可以不用对第一存储区域中的第一防回滚版本信息进行更新(不需要擦除第一存储区域中的第一防回滚版本信息),因此可以直接将待更新固件的第二防回滚版本信息发覆盖至第二存储区域。
下面,对上述存储硬盘的整体分区以及防回滚备份区域进行说明。具体的,可以参考下表3所示。
表3:固件分区说明
名称 起始地址 Size 描述
Firmware Header 0 128 固件头信息
Anti_rollback backup 128 32 防回滚信息备份区(1)
Firmware 512 Firmware_size 起始地址取决于CPU特性,SAMV7为512bytes
User flag Flash_size-128 64 用户标志
Anti_rollback backup Flash_size-64 32 防回滚信息备份区(2)
Firmware flag Flash_size-32 32 固件升级标志
在本公开的一种示例实施方式中,所述第一防回滚版本信息包括第一防回滚标志位;所述第二防回滚版本信息包括第二防回滚标志位;其中,第一防回滚标志位以及第二防回滚标志均可以包括有效标志位以及无效标志位;并且,所述有效标志位用于表示所述当前固件不能更新为与所述当前固件对应的历史固件;所述无效标志位用于表示所述当前固件能够更新为与所述当前固件对应的历史固件。进一步的,有效标志位可以用1表示,也可以用其他字符表示,例如可以是Y等等,本示例对此不做特殊限制;无效标志位可以用0表示,也可以用其他字符表示,例如可以是N等等,本示例对此不做特殊限制。
在本公开的一种示例实施方式中,飞行控制器520还可以用于根据所述第二防回滚标志位,确定所述第一防回滚版本信息是否需要更新。具体的,如果待更新固件的第二防回滚标志位有效标志位,例如第二防回滚标志位为1,则需要更新第一防回滚版本信息。具体的可以包括:利用第二防回滚版本信息对所述第一防回滚版本信息进行更新。例如,可以利用第二防回滚版本信息对第一存储区域中的第一防回滚版本信息进行更新。此处需要补充说明的是,为了保证防回滚版本信息的安全性,当需要对第一存储区域的防回滚版本信息进行擦除,并存储第二防回滚版本信息时,需要先确定第二存储区域的第一防回滚版本信息是否完整;并在第二存储区域的第一防回滚版本信息完整时,再对第一存储区域的第一防回滚版本信息进行擦除并更新。
进一步的,飞行控制器520还可以用于如果所述第二防回滚标志位为无效标志位,即当前固件能够更新为与所述当前固件对应的历史固件,则可以直接安装所述待更新固件。
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它 实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由所附的权利要求指出。

Claims (59)

  1. 一种无人飞行器的固件升级方法,其特征在于,包括:
    获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;
    根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件;
    若所述待更新固件为可升级固件,则安装所述待更新固件。
  2. 根据权利要求1所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件包括:
    根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件。
  3. 根据权利要求2所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件包括:
    若所述第一防回滚版本信息小于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件。
  4. 根据权利要求3所述的无人飞行器的固件升级方法,其特征在于,所述无人飞行器的固件升级方法还包括:
    若所述第一防回滚版本信息大于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
  5. 根据权利要求2所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件包括:
    若所述第一防回滚版本信息大于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件。
  6. 根据权利要求5所述的无人飞行器的固件升级方法,其特征在于,所述无人飞行器的固件升级方法还包括:
    若所述第一防回滚版本信息小于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
  7. 根据权利要求1所述无人飞行器的固件升级方法,其特征在于,所述第一防回滚版本信息包括第一防回滚版本号;所述第二防回滚版本信息包括第二防回滚版本号。
  8. 根据权利要求7所述的无人飞行器的固件升级方法,其特征在于,所述第 一防回滚版本号以及第二防回滚版本号根据所述当前固件能否更新为与所述当前固件对应的历史固件进行确定。
  9. 根据权利要求7所述的无人飞行器的固件升级方法,其特征在于,不同发布时间的各所述当前固件能够公用同一所述第一防回滚版本号;
    不同发布时间的各所述待更新固件能够公用同一所述第二防回滚版本号。
  10. 根据权利要求7所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件包括:
    根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件。
  11. 根据权利要求10所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件包括:
    如果所述第一防回滚版本号小于等于所述第二防回滚版本号,则所述待更新固件为可升级固件。
  12. 根据权利要求11所述的无人飞行器的固件升级方法,其特征在于,所述无人飞行器的固件升级方法还包括:
    若所述第一防回滚版本号大于所述第二防回滚版本号,则所述待更新固件为不可升级固件。
  13. 根据权利要求10所述的无人飞行器的固件升级方法,其特征在于,根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件包括:
    如果所述第一防回滚版本号大于等于所述第二防回滚版本号,则所述待更新固件为可升级固件。
  14. 根据权利要求13所述的无人飞行器的固件升级方法,其特征在于,所述无人飞行器的固件升级方法还包括:
    若所述第一防回滚版本号小于所述第二防回滚版本号,则所述待更新固件为不可升级固件。
  15. 根据权利要求1所述的无人飞行器的固件升级方法,其特征在于,所述第一防回滚版本信息以及第二防回滚版本信息同时存储在本地存储器的多个存储区域。
  16. 根据权利要求15所述的无人飞行器的固件升级方法,其特征在于,在安装所述待更新固件之前,所述无人飞行器的固件升级方法还包括:
    将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域。
  17. 根据权利要求15所述的无人飞行器的固件升级方法,其特征在于,所述多个存储区域分别位于所述本地存储器的多个不同扇区。
  18. 根据权利要求16所述的无人飞行器的固件升级方法,其特征在于,所述多个存储区域包括第一存储区域以及第二存储区域。
  19. 根据权利要求18所述的无人飞行器的固件升级方法,其特征在于,将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域包括:
    将所述第一防回滚版本信息同步至所述本地存储器的第一存储区域;
    利用所述第一存储区域的第一防回滚版本信息对所述第二存储区域的历史防回滚版本信息进行覆盖。
  20. 根据权利要求18所述的无人飞行器的固件升级方法,其特征在于,所述无人飞行器的固件升级方法还包括:
    确定所述第一防回滚版本信息是否需要更新;
    当所述第一防回滚版本信息需要更新时,将所述第二防回滚版本信息覆盖至所述第一存储区域;和/或
    当所述第一防回滚版本信息不需要更新时,将所述第一防回滚版本信息覆盖至所述第二存储区域。
  21. 根据权利要求1所述的无人飞行器的固件升级方法,其特征在于,所述第一防回滚版本信息包括第一防回滚标志位;所述第二防回滚版本信息包括第二防回滚标志位。
  22. 根据权利要求21所述的无人飞行器的固件升级方法,其特征在于,在安装所述待更新固件之前,所述固件升级方法还包括:
    根据所述第二防回滚标志位,确定所述第一防回滚版本信息是否需要更新。
  23. 根据权利要求22所述的无人飞行器的固件升级方法,其特征在于,根据所述第二防回滚标志位,确定所述第一防回滚版本信息是否需要更新包括:
    确定所述第二防回滚标志是否为有效标志位;
    如果所述第二防回滚标志位为有效标志位,则更新所述当前固件的第一防回滚版本信息。
  24. 根据权利要求23所述的无人飞行器的固件升级方法,其特征在于,更新所述当前固件的第一防回滚版本信息包括:
    利用所述第二防回滚版本信息覆盖所述第一防回滚版本信息,以使所述第二防回滚版本信息成为当前固件的防回滚版本信息。
  25. 根据权利要求23所述的无人飞行器的固件升级方法,其特征在于,安装所述待更新固件包括:
    如果所述第二防回滚标志位为无效标志位,则直接安装所述待更新固件。
  26. 根据权利要求21所述的无人飞行器的固件升级方法,其特征在于,所述第一防回滚标志位以及第二防回滚标志位均包括有效标志位以及无效标志位;
    其中,所述有效标志位用于表示所述当前固件不能更新为与所述当前固件对应的历史固件;
    所述无效标志位用于表示所述当前固件能够更新为与所述当前固件对应的历史固件。
  27. 根据权利要求1所述的无人飞行器的固件升级方法,其特征在于,所述第二防回滚版本信息位于所述待更新固件的固件头中。
  28. 根据权利要求1所述的无人飞行器的固件升级方法,其特征在于,所述第二防回滚版本信息包括防回滚版本号、防回滚标志位以及禁止回滚版本号中的一种或多种。
  29. 根据权利要求28所述的无人飞行器的固件升级方法,其特征在于,所述禁止回滚版本号为所述当前固件禁止回滚的与所述当前固件对应的历史固件的防回滚版本号。
  30. 一种无人飞行器,其特征在于,包括:
    存储器,用于存储当前固件;
    一个或多个处理器,与所述存储器通信连接;其中,
    当升级所述当前固件时,所述处理器用于执行如下操作:
    获取当前固件的第一防回滚版本信息以及待更新固件的第二防回滚版本信息;
    根据所述第一防回滚版本信息以及所述第二防回滚版本信息,确定所述待更新固件是否为可升级固件;
    若所述待更新固件为可升级固件,则安装所述待更新固件。
  31. 根据权利要求30所述的无人飞行器,其特征在于,所述处理器包括飞行控制器。
  32. 根据权利要求31所述的无人飞行器,其特征在于,所述处理器还用于:
    根据所述第一防回滚版本信息与所述第二防回滚版本信息的比对结果,确定所述待更新固件是否为可升级固件。
  33. 根据权利要求32所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本信息小于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件。
  34. 根据权利要求33所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本信息大于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
  35. 根据权利要求32所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本信息大于等于所述第二防回滚版本信息,则确定所述待更新固件为可升级固件。
  36. 根据权利要求35所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本信息小于所述第二防回滚版本信息,则确定所述待更新固件为不可升级固件。
  37. 根据权利要求31所述无人飞行器,其特征在于,所述第一防回滚版本信息包括第一防回滚版本号;所述第二防回滚版本信息包括第二防回滚版本号。
  38. 根据权利要求37所述的无人飞行器,其特征在于,所述第一防回滚版本号以及第二防回滚版本号根据所述当前固件能否更新为与所述当前固件对应的历史固件进行确定。
  39. 根据权利要求38所述的无人飞行器,其特征在于,不同发布时间的各所述当前固件能够公用同一所述第一防回滚版本号;
    不同发布时间的各所述待更新固件能够公用同一所述第二防回滚版本号。
  40. 根据权利要求38所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    根据所述第一防回滚版本号以及所述第二防回滚版本号的比对关系,确定所述待更新固件是否为可升级固件。
  41. 根据权利要求40所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    如果所述第一防回滚版本号小于等于所述第二防回滚版本号,则所述待更新固件为可升级固件。
  42. 根据权利要求40所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本号大于所述第二防回滚版本号,则所述待更新固件为不可升级固件。
  43. 根据权利要求42所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    如果所述第一防回滚版本号大于等于所述第二防回滚版本号,则所述待更新固件为可升级固件。
  44. 根据权利要求43所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    若所述第一防回滚版本号小于所述第二防回滚版本号,则所述待更新固件为不可升级固件。
  45. 根据权利要求31所述的无人飞行器,其特征在于,所述第一防回滚版本信息以及第二防回滚版本信息同时存储在所述存储器的多个存储区域。
  46. 根据权利要求45所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    将所述第一防回滚版本信息同步至所述本地存储器的多个存储区域。
  47. 根据权利要求45所述的无人飞行器,其特征在于,所述多个存储区域分别位于所述本地存储器的多个不同扇区。
  48. 根据权利要求47所述的无人飞行器,其特征在于,所述多个存储区域包括第一存储区域以及第二存储区域。
  49. 根据权利要求48所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    将所述第一防回滚版本信息同步至所述本地存储器的第一存储区域;
    利用所述第一存储区域的第一防回滚版本信息对所述第二存储区域的历史防回滚版本信息进行覆盖。
  50. 根据权利要求48所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    确定所述第一防回滚版本信息是否需要更新;
    当所述第一防回滚版本信息需要更新时,将所述第二防回滚版本信息覆盖至所述第一存储区域;和/或
    当所述第一防回滚版本信息不需要更新时,将所述第一防回滚版本信息覆盖至所述第二存储区域。
  51. 根据权利要求31所述的无人飞行器,其特征在于,所述第一防回滚版本信息包括第一防回滚标志位;所述第二防回滚版本信息包括第二防回滚标志位。
  52. 根据权利要求51所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    根据所述第二防回滚标志位,确定所述第一防回滚版本信息是否需要更新。
  53. 根据权利要求52所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    确定所述第二防回滚标志是否为有效标志位;
    如果所述第二防回滚标志位为有效标志位,则更新所述当前固件的第一防回 滚版本信息。
  54. 根据权利要求53所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    利用所述第二防回滚版本信息覆盖所述第一防回滚版本信息,以使所述第二防回滚版本信息成为当前固件的防回滚版本信息。
  55. 根据权利要求53所述的无人飞行器,其特征在于,所述飞行控制器还用于:
    如果所述第二防回滚标志位为无效标志位,则直接安装所述待更新固件。
  56. 根据权利要求51所述的无人飞行器,其特征在于,所述第一防回滚标志位以及第二防回滚标志位均包括有效标志位以及无效标志位;
    其中,所述有效标志位用于表示所述当前固件不能更新为与所述当前固件对应的历史固件;
    所述无效标志位用于表示所述当前固件能够更新为与所述当前固件对应的历史固件。
  57. 根据权利要求31所述的无人飞行器,其特征在于,所述第二防回滚版本信息位于所述待更新固件的固件头中。
  58. 根据权利要求31所述的无人飞行器,其特征在于,所述第二防回滚版本信息包括防回滚版本号、防回滚标志位以及禁止回滚版本号中的一种或多种。
  59. 根据权利要求58所述的无人飞行器,其特征在于,所述禁止回滚版本号为所述当前固件禁止回滚的与所述当前固件对应的历史固件的防回滚版本号。
PCT/CN2018/120968 2018-12-13 2018-12-13 无人飞行器及其固件升级方法 WO2020118639A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/120968 WO2020118639A1 (zh) 2018-12-13 2018-12-13 无人飞行器及其固件升级方法
CN201880068400.2A CN111417926A (zh) 2018-12-13 2018-12-13 无人飞行器及其固件升级方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/120968 WO2020118639A1 (zh) 2018-12-13 2018-12-13 无人飞行器及其固件升级方法

Publications (1)

Publication Number Publication Date
WO2020118639A1 true WO2020118639A1 (zh) 2020-06-18

Family

ID=71075897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/120968 WO2020118639A1 (zh) 2018-12-13 2018-12-13 无人飞行器及其固件升级方法

Country Status (2)

Country Link
CN (1) CN111417926A (zh)
WO (1) WO2020118639A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931213A (zh) * 2020-08-20 2020-11-13 Oppo(重庆)智能科技有限公司 文件处理方法、装置、终端及存储介质
CN114115928A (zh) * 2020-08-31 2022-03-01 中强光电股份有限公司 无人载具、无人载具软韧件更新方法及系统
CN112256508A (zh) * 2020-10-23 2021-01-22 广州极飞科技有限公司 一种无人机自检方法
CN112988204B (zh) * 2021-05-19 2021-08-31 西安羚控电子科技有限公司 一种无人机软件远程升级及回滚的方法
CN113848852B (zh) * 2021-09-27 2023-06-23 一飞智控(天津)科技有限公司 编队飞机固件版本回传的方法、系统、终端、介质及应用

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466710A (zh) * 2000-09-26 2004-01-07 ����ɭ�绰�ɷ����޹�˾ 保护静态和动态数据免遭未授权操作的系统
CN101427259A (zh) * 2006-04-24 2009-05-06 艾利森电话股份有限公司 对软件版本的安装的授权
CN102339227A (zh) * 2010-07-28 2012-02-01 环旭电子股份有限公司 多固件嵌入式系统及其固件更新方法
CN104798040A (zh) * 2012-11-07 2015-07-22 高通股份有限公司 用于在没有内部非易失性存储器的设备中提供防回滚保护的方法
CN106406939A (zh) * 2016-09-05 2017-02-15 惠州Tcl移动通信有限公司 一种基于emmc芯片的移动终端防回滚方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107438830B (zh) * 2016-09-30 2021-02-05 深圳市大疆创新科技有限公司 升级方法、升级装置、升级设备及升级系统
US20170124353A1 (en) * 2017-01-12 2017-05-04 Mediatek Inc. Method And Apparatus For Preventing Rollback Of Secure Data
CN108985049A (zh) * 2018-06-06 2018-12-11 晶晨半导体(上海)股份有限公司 防回滚方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466710A (zh) * 2000-09-26 2004-01-07 ����ɭ�绰�ɷ����޹�˾ 保护静态和动态数据免遭未授权操作的系统
CN101427259A (zh) * 2006-04-24 2009-05-06 艾利森电话股份有限公司 对软件版本的安装的授权
CN102339227A (zh) * 2010-07-28 2012-02-01 环旭电子股份有限公司 多固件嵌入式系统及其固件更新方法
CN104798040A (zh) * 2012-11-07 2015-07-22 高通股份有限公司 用于在没有内部非易失性存储器的设备中提供防回滚保护的方法
CN106406939A (zh) * 2016-09-05 2017-02-15 惠州Tcl移动通信有限公司 一种基于emmc芯片的移动终端防回滚方法及系统

Also Published As

Publication number Publication date
CN111417926A (zh) 2020-07-14

Similar Documents

Publication Publication Date Title
WO2020118639A1 (zh) 无人飞行器及其固件升级方法
WO2019223469A1 (zh) 区块链网络的管理方法、装置、介质及电子设备
US10860302B2 (en) Memory-efficient upgrade staging
AU2014240245B2 (en) Aircraft configuration and software part management using a configuration software part
US20140075197A1 (en) Method for selective software rollback
US10025584B2 (en) Firmware management of SR-IOV adapters
US20070169101A1 (en) Multi-Branch Management for Updating Software
KR20100066576A (ko) 펌웨어 이미지 갱신 및 관리
WO2017161947A1 (zh) 多系统ota升级方法和多系统设备
US20080270782A1 (en) Boot process
US9268662B2 (en) Method and system for a high availability framework
US20130024850A1 (en) Systems, methods and apparatus for fast file transfer
CN107368513B (zh) 客户端数据库更新的方法及装置
CN110865819B (zh) 一种os的安装方法、服务器和系统
WO2022188690A1 (zh) 升级电子设备的方法及装置
US11550918B2 (en) Package-based remote firmware update
US10613993B2 (en) Method for protecting a program code, corresponding system and processor
CN109375953B (zh) 一种操作系统启动方法及装置
US11416233B1 (en) Software upgrade system and method for a baseboard management controller configured in an information handling system
CN111221553A (zh) 一种固件升级的方法及装置
US20080010246A1 (en) System and method for providing operating system component version verification
CN105677422A (zh) 同时更新监控程序和应用程序及后续更新应用程序的方法
US11500648B2 (en) Method for fast booting processors in a multi-processor architecture
US11698971B2 (en) Secure boot device
CN116028084A (zh) 一种基于OpenStack云平台跨版本热升级的方法、系统及终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18943038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 29.09.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18943038

Country of ref document: EP

Kind code of ref document: A1