WO2019140656A1 - 一种固件升级方法、装置、电子设备及控制设备 - Google Patents
一种固件升级方法、装置、电子设备及控制设备 Download PDFInfo
- Publication number
- WO2019140656A1 WO2019140656A1 PCT/CN2018/073500 CN2018073500W WO2019140656A1 WO 2019140656 A1 WO2019140656 A1 WO 2019140656A1 CN 2018073500 W CN2018073500 W CN 2018073500W WO 2019140656 A1 WO2019140656 A1 WO 2019140656A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- firmware
- identifier
- electronic device
- upgrade
- target
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present invention relates to the field of electronic technologies, and in particular, to a firmware upgrade method, apparatus, electronic device, and control device.
- Firmware refers to a program written in a rewritable read-only memory or an electrically erasable programmable read-only memory, or as a binary file stored in a medium for implementing the functions of an electronic device.
- the embodiment of the invention discloses a firmware upgrade method, device, electronic device and control device, which can improve the accuracy and reliability of the firmware upgrade, reduce the system crash caused by upgrading the wrong firmware, and ensure the normal operation of the device.
- an embodiment of the present invention provides a firmware upgrade method, including:
- the upgrade data required for the firmware to be upgraded is obtained, and the upgrade firmware is upgraded according to the upgrade data.
- the implementation of the present invention provides another firmware upgrade method, including:
- the upgrade data required for the firmware to be upgraded is sent to the electronic device.
- an embodiment of the present invention provides a firmware upgrading apparatus, where the firmware upgrading apparatus is configured in an electronic device, where the electronic device includes at least one controller, and the firmware upgrading apparatus includes:
- a receiving unit configured to receive a firmware upgrade command sent by the control device
- An acquiring unit configured to acquire a target hardware identifier of the current controller, where the target hardware identifier is used to uniquely determine an identity of the current controller, in response to the firmware upgrade command;
- the receiving unit is further configured to receive a target firmware identifier of the firmware to be upgrade sent by the control device;
- a determining unit configured to determine, according to a correspondence between the preset hardware identifier and the firmware identifier, whether the target firmware identifier matches the target hardware identifier
- the acquisition unit is also used to obtain the upgrade data required for the firmware to be upgraded, and to upgrade the firmware to be upgraded according to the upgrade data.
- an embodiment of the present invention provides another firmware upgrading apparatus, including:
- a sending unit configured to send a firmware upgrade command to the electronic device
- a sending unit configured to send, to the electronic device, a target firmware identifier of the firmware to be upgraded
- a determining unit configured to determine whether an error indication message sent by the electronic device is received within a preset time
- the sending unit is further configured to send, to the electronic device, upgrade data required for the firmware to be upgraded if the error indication message is not received.
- an embodiment of the present invention provides an electronic device, including at least one controller, a memory, and a transceiver:
- the memory is configured to store program instructions
- the processor is configured to invoke the program instruction in the memory to perform the following steps:
- the upgrade data required for the firmware to be upgraded is obtained, and the firmware to be upgraded is upgraded according to the upgrade data.
- an embodiment of the present invention provides a control device, including a memory, a transceiver device, and a processor:
- the memory is configured to store program instructions
- the processor is configured to invoke a program instruction in the memory to perform the following steps:
- the transceiver device is called to send the upgrade data required by the firmware to be upgraded to the electronic device.
- an embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by the processor, the processor executes the first aspect.
- the firmware upgrade method is not limited to:
- an embodiment of the present invention provides another computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program includes program instructions, and when the program instructions are executed by the processor, the processor executes the second Aspects of the firmware upgrade method.
- the firmware upgrade command sent by the received control device is obtained by acquiring the target hardware identifier of the current controller, and further determining the target hardware identifier according to the corresponding relationship between the preset hardware identifier and the firmware identifier. If the target firmware identifier sent by the control device is matched, the upgrade data required for the firmware to be upgraded is obtained, and the firmware to be upgraded is upgraded according to the upgrade data, which helps improve the accuracy and reliability of the firmware upgrade and reduces the cause. The system crash caused by upgrading the wrong firmware to ensure the normal operation of the device.
- FIG. 1 is a schematic flowchart of a firmware upgrade method according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of an upgrade file of a firmware according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart of another firmware upgrade method according to an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a firmware upgrading apparatus according to an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of another firmware upgrading apparatus according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a control device according to an embodiment of the present invention.
- the electronic device involved in the present invention may be a portable mobile terminal such as a mobile phone or a tablet computer, or may be a non-portable terminal such as a computer, or may be a cloud platform, or may be an aircraft such as a drone, wherein the pan/tilt can be carried On the aircraft.
- the electronic device may include a Printed Circuit Board (PCB) for connecting the components in the electronic device to provide necessary mechanical support for the electronic device.
- a plurality of Microcontroller Units (MCUs) or controllers or microcontrollers are integrated on the printed circuit board. The following is a description of the controller.
- Each controller can control the firmware of a plurality of electronic devices to implement a specific function of the electronic device, and each controller cooperates to implement various complicated functions of the electronic device.
- the printed circuit board of the electronic device may further include at least one register, and the register may be in one-to-one correspondence with the controller for storing related data of the controller.
- the control device can be a computer, a server, or a control terminal, and is configured to send a firmware upgrade command to the electronic device, and provide the electronic device with the authentication data, upgrade data, and other data required for the firmware to be upgraded. .
- the controller's software architecture can take a two-level structure, such as the first level BootLoader (boot loader), mainly responsible for the firmware upgrade function; the second level is the firmware, responsible for the normal product Features.
- the controller may be assigned a hardware identification, which may be a voltage divider value on the printed circuit board, or may be an identification stored in a register, etc., to uniquely determine the identity of the controller.
- the firmware identification can be determined, such as writing the firmware identification in a preset area. For example, by modifying the link script, a reserved area is divided at the firmware header and the firmware identification is written at a specified offset of the reserved area.
- the firmware identifier of the firmware under each controller corresponds to the hardware identifier of the controller.
- the hardware identifier may also be called a hardware ID, a product identifier, or other names; the firmware identifier may also be called a software identifier, a software ID, a product number, or other names.
- the firmware identifier of the firmware under one controller may be the same, for example, may be the same as the hardware identifier of the controller, and the firmware identifier of the firmware under one controller may also be different, and the corresponding correspondence between the hardware identifier and the firmware identifier is preset. The relationship can be, and the application is not limited.
- the control device can instruct the electronic device to perform a firmware upgrade by sending a firmware upgrade command to the electronic device. Therefore, after receiving the firmware upgrade command, the electronic device may acquire the target hardware identifier of the current controller of the electronic device in response to the firmware upgrade command sent by the control device, and prepare for the firmware upgrade. Further, the control device may further send the target firmware identifier of the firmware to be upgraded to the electronic device, so that the electronic device can receive the target firmware identifier and determine the target firmware identifier and the target hardware according to the preset correspondence between the firmware identifier and the hardware identifier.
- the firmware upgrade command, the target firmware identifier, and the upgrade data may be carried in a message and sent to the electronic device, or may be separately sent to the electronic device by using different messages, or the firmware upgrade command may be separately sent, the target
- the firmware identification and the upgrade data may be carried in a message, such as a message including an upgrade file, to the electronic device, and the like, which is not limited in this application.
- the current controller may refer to a controller that receives a firmware upgrade command.
- FIG. 1 is a schematic flowchart of a firmware upgrade method according to an embodiment of the present invention.
- the firmware upgrade method shown in FIG. 1 may include:
- the control device sends a firmware upgrade command to the electronic device.
- control device may first detect whether the connection with the electronic device is established. If the connection with the electronic device has been established, the control device sends a firmware upgrade command to the electronic device; if the connection with the electronic device is not established, the control device may not send the firmware upgrade command to the electronic device or the control device may first After the electronic device establishes a connection, it sends a firmware upgrade command, which saves the power consumption of the control device.
- the connection between the control device and the electronic device may be a wired connection or a wireless connection.
- the firmware upgrade command sent by the control device to the electronic device may be generated by the control device according to the firmware upgrade request sent by the electronic device, or the control device is generated according to the firmware detection result of the electronic device. That is, the control device sends a firmware upgrade command to the electronic device, possibly because the control device receives the firmware upgrade request sent by the electronic device, and then the control device generates a firmware upgrade command for the firmware upgrade request; the control device sends the firmware upgrade to the electronic device.
- the command may also be that the control device periodically (for example, detecting according to a preset time interval) or irregularly detects the firmware of the electronic device. If the control device detects that there is firmware in the electronic device that needs to be upgraded, the firmware that needs to be upgraded is Generate a firmware upgrade command.
- the embodiments of the present invention are only used to enumerate the two possible control devices to generate firmware upgrade commands and send them to the electronic device. The specific implementation manner is not limited.
- the electronic device acquires a target hardware identifier of the current controller.
- the hardware identifier is used to uniquely determine the identity of the controller, that is, each controller corresponds to a unique and fixed hardware identifier.
- the target hardware identifier is used to uniquely determine the identity of the current controller.
- the hardware identification can be that the electronic device is pre-set at the beginning of production for each controller on the printed circuit board. Or the hardware identification may also be pre-set for the printed circuit board in the initial stage of electronic device production. For example, when the printed circuit board includes only one controller, the hardware identification may also be the identification of the printed circuit board. That is, the hardware identification may be for each controller in the embodiment of the present invention.
- the electronic device After receiving the firmware upgrade command sent by the control device, the electronic device prepares for the firmware upgrade, and first obtains the target hardware identifier of the current controller, and is used to determine the identity of the currently running controller.
- obtaining the target hardware identifier of the current controller including: collecting a partial voltage value of the current controller on the printed circuit board, and determining a target hardware identifier of the current controller according to the partial pressure value. That is to say, the electronic device can collect the current controller voltage value by collecting the voltage value of the current controller, for example, by collecting the voltage distributed by the current controller on the printed circuit board, and determining the target hardware identifier of the current controller according to the voltage dividing value.
- each controller of the printed circuit board has a different partial voltage value, and the electronic device may use the collected partial pressure value as a target hardware identifier of the current controller, or the electronic device may perform a preset operation on the partial pressure value. Or other operations to determine the target hardware ID of the current controller.
- obtaining the target hardware identifier of the current controller including: reading hardware information of the current controller from a register of the current controller; and determining a target hardware identifier of the current controller according to the hardware information.
- the hardware information of the controller may include hardware identification, numerical values or other hardware information. That is, the target hardware identifier of the current controller may also be pre-stored in a register corresponding to the current controller, and the electronic device may read hardware information of the current controller from a register corresponding to the current controller, where the hardware information is
- the target hardware identification may be included, such as a certain value, or the target hardware identification may be determined by some information in the hardware information.
- the control device sends the target firmware identifier of the firmware to be upgraded to the electronic device.
- the target firmware identifier is used to uniquely determine the firmware identity.
- the firmware identifier can be an identity added to the firmware when the firmware is generated.
- the control device sends the target firmware identifier of the firmware to be upgraded to the electronic device, including: sending an upgrade file of the firmware to be upgraded to the electronic device, where the preset area of the upgrade file carries the target firmware identifier.
- the control device can leave a preset area in the upgrade file of the firmware to be upgraded, write the target firmware identifier of the firmware to be upgraded into the preset area, and the control device sends the upgrade file to the electronic device, Send the target firmware ID of the firmware to be upgraded to the electronic device.
- the electronic device receives the target firmware identifier of the firmware to be upgraded sent by the control device, and includes: receiving an upgrade file of the firmware to be upgrade sent by the control device; and parsing the target firmware identifier from the preset area of the upgrade file.
- the control device writes the target firmware identifier of the firmware to be upgraded in the reserved area of the upgrade file of the firmware to be upgraded, and then sends the upgrade file to the electronic device, and after the electronic device receives the upgrade file, the upgrade file may be
- the target firmware ID of the firmware to be upgraded is parsed in the reserved area. For example, as shown in FIG.
- the upgrade file of the firmware to be upgraded sent by the control device to the electronic device is composed of vector table data, a reserved area, and other firmware data. It can be assumed that the control device writes the target firmware identifier into the pre-prepared The reserved area, after the electronic device receives the upgrade file, the target firmware identifier can be parsed from the reserved area.
- the firmware upgrade command and the target firmware identifier may be carried in a message and sent to the electronic device, or may be separately sent to the electronic device, which is not limited in this application.
- the electronic device determines whether the target firmware identifier matches a target hardware identifier of the current controller.
- the electronic device can receive the target firmware identifier of the firmware to be upgraded sent by the control device, and determine whether the target firmware identifier matches the target hardware identifier according to the preset correspondence between the hardware identifier and the firmware identifier.
- the electronic device may obtain the correspondence between the at least one set of firmware identifiers and the hardware identifier of the controller, and store the corresponding firmware identifiers according to the preset correspondence between the at least one set of firmware identifiers and the hardware identifiers. Whether it matches the target hardware ID of the current controller.
- the electronic device can determine the firmware identifier of the firmware under one controller and the hardware identifier of the controller to have a corresponding relationship, that is, match.
- the electronic device determines whether the target firmware identifier matches the target hardware identifier of the current controller, that is, determines whether the target firmware identifier and the target hardware identifier of the current controller meet the foregoing correspondence relationship, and if yes, the electronic device may determine the The target firmware identifier matches the target hardware identifier of the current controller; if not, the electronic device can determine that the target firmware identifier does not match the target hardware identifier of the current controller.
- the error indication message may be sent to the control device, where the control device does not continue to send the upgrade data of the firmware to be upgraded to the electronic device, or the control device is re-selected to be re-selected. Upgrade the firmware to upgrade.
- the error indication message may carry the target firmware identifier, so that after receiving the error indication message, the control device can quickly determine, according to the target firmware identifier, which firmware to be upgraded for the firmware to be upgraded, thereby obtaining the fast The upgrade data of the firmware to be upgraded, especially when there is more firmware to be upgraded, this saves the control device query time.
- control device can simultaneously send a plurality of firmware upgrade commands to the electronic device, respectively, for instructing the electronic device to upgrade the plurality of firmware to be upgraded, and the electronic device acquires the target hardware identifier of the current controller and receives the control device to send
- the plurality of target firmware identifiers are assumed to receive two target firmware identifiers, which are respectively recorded as the target firmware identifier 1 and the target firmware identifier 2, and the electronic device matches the target hardware identifier with the target firmware 1 and the target firmware identifier 2, respectively.
- the electronic device sends an error indication message to the control device, where the error indication message includes the target firmware identifier 2, so that the control device can quickly after receiving the error indication message.
- the upgrade data corresponding to the target firmware identifier 2 is found from the upgrade data of the firmware to be upgraded, and the upgrade data is processed.
- an acknowledgement indication message may be sent to the controller.
- the confirmation indication message is used to indicate that the control device can continue to send the upgrade data required for the firmware to be upgraded to the electronic device, so that the control device can send the upgrade data of the firmware to be upgraded to the electronic device in a short time to facilitate the electronic device.
- the device upgrades the firmware to be upgraded, saving firmware upgrade time.
- the acknowledgment indication message carries the target firmware identifier, and in the case that the plurality of firmware to be upgraded are simultaneously upgraded, the control device can quickly determine, according to the target firmware identifier, which firmware is sent by the acknowledgment indication message, which is convenient.
- the control device sends the upgrade data of the firmware to be upgrade corresponding to the target firmware identifier to the electronic device, thereby saving the firmware upgrade time.
- the electronic device may not send the confirmation indication message to the control device, for example, may not send any message, and wait until the control device does not receive the error indication message sent by the electronic device within the preset time.
- the control device sends the upgrade data of the firmware to be upgraded to the electronic device, so that the power consumption of the electronic device can be saved.
- control device does not receive the error indication message sent by the electronic device or receives the confirmation indication message within the preset time, send the upgrade data of the firmware to be upgraded to the electronic device.
- the control device does not receive the error indication message sent by the electronic device or receives the confirmation indication message, and the target firmware identifier of the firmware to be upgraded sent by the control device matches the hardware identifier of the current controller of the electronic device. That is, the firmware to be upgraded corresponding to the target firmware identifier is the correct firmware to be upgraded. For example, if the firmware to be upgraded belongs to the firmware under the control of the current controller, the control device may send the upgrade data of the firmware to be upgraded to the electronic device, so that Upgrade the correct firmware to be upgraded.
- the electronic device obtains upgrade data of the firmware to be upgraded, and upgrades the firmware to be upgraded.
- obtaining the upgrade data of the firmware to be upgraded including: receiving the upgrade data sent by the control device, where the upgrade data is upgrade data required for the firmware to be upgraded, and the upgrade data is that the control device does not receive the preset time. The error is sent when the message is sent, or the upgrade data is sent when the control device does not receive any message within the preset time.
- the obtaining the upgrade data of the firmware to be upgraded includes: receiving, by the control device, the upgrade data sent by the response confirmation indication message, where the upgrade data is upgrade data required for the firmware to be upgraded.
- the upgrade data of the firmware to be upgraded acquired by the electronic device may be sent when the control device does not receive the error indication message (or other indication message) sent by the electronic device within a preset time, or may The control device sends the acknowledgement message sent by the electronic device.
- the electronic device after receiving the firmware upgrade command sent by the control device, acquires the target hardware identifier of the current controller, and receives the target firmware identifier of the firmware to be upgraded sent by the control device.
- the electronic device matches the target hardware identifier with the target firmware identifier. If the matching succeeds, that is, if the electronic device does not send an error indication message or sends an acknowledgement indication message to the control device within a preset time, the acquiring control device sends the identifier.
- the upgrade data of the firmware to be upgraded and the upgrade of the firmware to be upgraded can help improve the accuracy and reliability of the firmware upgrade, and reduce the system crash caused by upgrading the wrong firmware to ensure the normal operation of the device.
- FIG. 3 is a schematic flowchart of another firmware upgrade method according to an embodiment of the present invention.
- the firmware upgrade method shown in FIG. 3 may include:
- the control device sends a firmware upgrade command to the electronic device.
- the electronic device acquires a target hardware identifier of the current controller.
- the electronic device After receiving the firmware upgrade command sent by the control device, the electronic device prepares for the firmware upgrade, and first obtains the target hardware identifier of the current controller, and is used to determine the identity of the currently running controller.
- the electronic device obtains the target hardware identifier refer to the description of the manner in which the target hardware identifier is obtained in the embodiment shown in FIG. 1 , and details are not described herein.
- the control device sends an upgrade file of the firmware to be upgraded to the electronic device.
- the electronic device obtains a target firmware identifier of the firmware to be upgraded from the upgrade file sent by the control device.
- the upgrade file may include the target firmware identifier of the firmware to be upgraded.
- the electronic device may send a firmware upgrade request to the control device, and the control device generates a firmware upgrade command for the firmware upgrade request. And sending the firmware upgrade command to the electronic device for instructing the electronic device to prepare for firmware upgrade.
- the control device sends an upgrade file of the firmware to be upgraded to the electronic device, and the electronic device is ready to enter the formal firmware upgrade step.
- the upgrade file of the to-be-upgraded firmware sent by the control device to the electronic device may carry the target firmware identifier in the preset area, so that after receiving the upgrade file sent by the control device, the electronic device may parse the target from the preset area.
- Firmware identification may be carried by the control device to the electronic device.
- step 306 can be performed.
- the electronic device determines whether the target firmware identifier matches the target hardware identifier according to a preset correspondence between the firmware identifier and the hardware identifier.
- the electronic device determines whether the target hardware identifier matches the target firmware identifier, that is, determines whether the target hardware identifier and the target firmware identifier meet the preset firmware identifier and the hardware identifier, and if yes, the target hardware identifier and the target firmware identifier are Match; if not, the target hardware ID does not match the target firmware ID.
- the correspondence between the firmware identifier preset by the electronic device and the hardware identifier of the controller may be that one hardware identifier corresponds to multiple firmware identifiers, and one firmware identifier corresponds to one hardware identifier.
- one target hardware identifier may correspond to multiple target firmware identifiers, and one target firmware identifier may only correspond to one target hardware identifier.
- the controller 1 of the electronic device may include firmware 10, firmware 11 and firmware 12; the controller 2 may include firmware 20, firmware 21, and firmware 22.
- the hardware identifier set by the electronic device in advance for the controller 1 is ID1
- the firmware identifier of the firmware 10 included in the controller 1 can be ID 110
- the firmware identifier of the firmware 11 can be ID 111
- the firmware identifier of the firmware 12 can be ID 112
- the hardware identification of the device 2 is ID2
- the firmware identification of the firmware 20 included in the controller 2 is ID220
- the firmware identification of the firmware 21 is ID221
- the firmware identification of the firmware 22 can be ID222.
- the corresponding relationship between the firmware identifier of the electronic device and the hardware identifier of the controller may be: the controller ID1 has a corresponding relationship with the ID 110, the ID 111, and the ID 112, and the controller ID 2 has a corresponding relationship with the ID 220, the ID 221, and the ID 222, respectively. That is, the hardware identifiers corresponding to the firmware IDs of ID110, ID111, and ID112 are all ID1, and the hardware identifiers corresponding to ID220, ID221, and ID221 are ID2.
- the target hardware identifier of the current controller acquired by the electronic device is ID2. If it is assumed that the target firmware identifier sent by the control device received by the electronic device is the ID 110, the electronic device according to the preset firmware identifier and the hardware identifier. The corresponding relationship may be determined that the target hardware identifier ID2 and the target firmware identifier ID 110 do not match the preset correspondence, that is, no match; if the target firmware identifier sent by the control device received by the electronic device is assumed to be ID 220, the electronic device may determine The target hardware identifier ID2 and the target firmware identifier ID220 conform to a preset correspondence, that is, match.
- the electronic device obtains upgrade data of the firmware to be upgraded from the upgrade file sent by the control device, and upgrades the firmware to be upgraded.
- the upgrade file may further include upgrade data of the firmware to be upgraded.
- the target firmware identifier obtained by the electronic device from the upgrade file is matched with the target hardware identifier of the current controller. If the matching is successful, the firmware to be upgrade selected by the control device is determined to be the firmware under the current controller, that is, the control is performed.
- the firmware to be upgraded by the device is the firmware to be upgraded by the electronic device, that is, the correct firmware.
- the electronic device can obtain the upgrade data required for the upgrade from the upgrade data of the firmware to be upgraded sent by the control device, and upgrade the firmware to be upgraded; If the matching is unsuccessful, it may be determined that the firmware to be upgraded selected by the control device is not the firmware under the current controller or the firmware to be upgraded selected by the control device is not the correct firmware, that is, the firmware to be upgraded selected by the control device is not the firmware to be upgraded by the electronic device. That is, the wrong firmware, the electronic device can obtain the upgrade data required for the upgrade from the upgrade data of the firmware to be upgraded sent by the control device, thus saving power consumption.
- control device may further send the target firmware identifier and the upgrade data to the electronic device, or the control device may further carry the firmware upgrade command, the target firmware identifier, and the upgrade data.
- a message is sent to the electronic device, which is not limited in this application.
- the electronic device after receiving the upgrade command of the firmware to be upgraded, acquires the target hardware identifier of the current controller, and receives the upgrade file of the firmware to be upgraded sent by the control device. Further, the electronic device matches the target hardware identifier with the target firmware identifier included in the upgrade file, and if the matching is successful, the electronic device obtains the upgrade data of the firmware to be upgraded from the upgrade file, and upgrades the firmware to be upgraded. Helps improve the accuracy and reliability of firmware upgrades and reduce system crashes caused by upgrading wrong firmware to ensure proper operation of the device.
- FIG. 4 is a schematic structural diagram of a firmware upgrading apparatus according to an embodiment of the present invention. Specifically, the firmware upgrading apparatus may be disposed in the electronic device.
- the firmware upgrading apparatus shown in FIG. 4 may include a receiving unit 401, an obtaining unit 402, and a determining unit 403.
- the receiving unit 401 is configured to receive a firmware upgrade command sent by the control device.
- the obtaining unit 402 is configured to obtain a target hardware identifier of the current controller in response to the firmware upgrade command, where the target hardware identifier is used to uniquely determine the identity of the current controller;
- the receiving unit 401 is further configured to receive a target firmware identifier of the firmware to be upgrade sent by the control device;
- the determining unit 403 is configured to determine, according to the correspondence between the preset hardware identifier and the firmware identifier, whether the target firmware identifier matches the target hardware identifier;
- the obtaining unit 402 is further configured to: if the target firmware identifier matches the target hardware identifier, obtain upgrade data required for the firmware to be upgraded, and upgrade the firmware to be upgraded according to the upgrade data.
- the specific manner of the acquiring unit 402 acquiring the target hardware identifier of the current controller is: collecting a partial pressure value of the current controller on the printed circuit board; and determining a target hardware identifier of the current controller according to the partial pressure value.
- the electronic device comprises at least one controller, further comprising a printed circuit board, and at least one controller is disposed on the printed circuit board.
- the acquiring unit 402 obtains the target hardware identifier of the current controller by: reading hardware information of the current controller from a register of the current controller; and determining a target hardware identifier of the current controller according to the hardware information.
- the electronic device may further include at least one register, and the controller on the printed circuit board may have a one-to-one correspondence with the configured registers.
- the receiving unit 401 receives the target firmware identifier of the to-be-upgraded firmware sent by the control device by receiving an upgrade file of the firmware to be upgrade sent by the control device, and parsing the target firmware identifier from the preset area of the upgrade file.
- the upgrade file includes the upgrade data
- the obtaining unit 402 obtains the upgrade data required for the firmware to be upgraded by: if the target firmware identifier matches the target hardware identifier, extracting the upgrade data from the upgrade file, where The upgrade data is the upgrade data required for the firmware to be upgraded.
- the firmware upgrading apparatus further includes a sending unit 404, configured to send an error indication message to the control device if the target firmware identifier does not match the target hardware identifier.
- the error indication message carries the target firmware identifier.
- the specific manner in which the obtaining unit 402 obtains the upgrade data required for the firmware to be upgraded is: receiving the upgrade data sent by the control device, the upgrade data is the upgrade data required for the firmware to be upgraded, and the upgrade data is the preset of the control device. Sent when the error indication message was not received within the time.
- the sending unit 404 is further configured to send an acknowledgement indication message to the control device if the target firmware identifier matches the target hardware identifier.
- the confirmation indication message carries the target firmware identifier.
- the specific manner in which the obtaining unit 402 obtains the upgrade data required for the firmware to be upgraded is: receiving the upgrade data sent by the control device in response to the confirmation indication message, and the upgrade data is the upgrade data required for the firmware to be upgraded.
- the firmware upgrade device can be installed in the cloud platform, and the pan/tilt can be mounted on the aircraft.
- the firmware upgrade device can be placed in the aircraft.
- the receiving unit 401 after receiving the firmware upgrade command sent by the control device, the receiving unit 401 further receives the target firmware identifier of the firmware to be upgraded sent by the control device, and the obtaining unit 402 is configured to obtain the target of the current controller in response to the firmware upgrade command.
- the hardware identifier is determined, so that the determining unit 403 determines whether the target firmware identifier acquired by the obtaining unit 402 matches the target hardware identifier received by the receiving unit 401. In the case of matching, the obtaining unit 402 acquires the upgrade data required for the firmware to be upgraded.
- the embodiments of the present invention help to improve the accuracy and reliability of the firmware upgrade, and reduce the system crash caused by upgrading the wrong firmware to ensure the normal operation of the device.
- FIG. 5 is a schematic structural diagram of another firmware upgrading apparatus according to an embodiment of the present invention.
- the firmware upgrading apparatus shown in FIG. 5 may include a sending unit 501 and a determining unit 502.
- the sending unit 501 is configured to send a firmware upgrade command to the electronic device.
- the sending unit 501 is further configured to send, to the electronic device, a target firmware identifier of the firmware to be upgraded;
- the determining unit 502 is configured to determine whether an error indication message sent by the electronic device is received within a preset time
- the sending unit 501 is further configured to send, to the electronic device, upgrade data required for the firmware to be upgraded if the error indication message is not received.
- the sending unit 501 is configured to send, to the electronic device, an upgrade file of the firmware to be upgraded, where the preset area of the upgrade file carries the target firmware identifier.
- the sending unit 501 is further configured to: if the error indication message is received within the preset time, prohibit sending the upgrade data required for the firmware to be upgraded to the electronic device.
- the error indication message carries the target firmware identifier.
- the determining unit 502 is further configured to determine whether an acknowledgement message sent by the electronic device is received within a preset time
- the sending unit 501 is further configured to: if the confirmation indication message is received, send the upgrade data required for the firmware to be upgraded to the electronic device.
- the confirmation indication message carries the target firmware identifier.
- the electronic device is a cloud platform, and the cloud platform is mounted on the aircraft.
- the sending unit 501 sends a firmware upgrade command and a target firmware identifier of the firmware to be upgraded to the electronic device, and sends a to-be-upgrade to the electronic device if the determining unit 502 determines that the error indication message is not received within the preset time.
- the upgrade data of the firmware can help improve the accuracy and reliability of the firmware upgrade and reduce the system crash caused by upgrading the wrong firmware to ensure the normal operation of the device.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
- the electronic device in the embodiment of the present invention may be a cloud platform or an aircraft such as a drone.
- the electronic device may include at least one controller 601, a memory 602, and a transceiver device 603.
- the controller 601, the memory 602, and the transceiver device 603 may be connected by a bus 604, or may be connected by other means, which is illustrated in FIG.
- the controller 601 can be used to control firmware to be upgraded for upgrading, and the memory 602 can be used to store program instructions.
- the electronic device may further include one or more processors, the one or more processors may be connected to the controller 601, or the controller 601 may include one or more processors.
- the controller 601 can call the stored program instructions in the memory 602 to execute:
- the calling transceiver device 603 receives the target firmware identifier of the firmware to be upgraded sent by the control device;
- the upgrade data required for the firmware to be upgraded is obtained, and the firmware to be upgraded is upgraded according to the upgrade data.
- the electronic device further includes a printed circuit board for supporting the connection between the various components in the electronic device to provide mechanical support for the electronic device.
- the controller 601 can be configured on the printed circuit board, and the specific manner in which the controller 601 acquires the target hardware identifier of the current controller is:
- the electronic device may further include a register 605, where the register is in one-to-one correspondence with the controller, and the specific manner in which the controller 601 acquires the target hardware identifier of the current controller is:
- the target hardware identifier of the current controller is determined according to the hardware information.
- the specific manner in which the controller 601 invokes the transceiver device 603 to receive the target firmware identifier of the firmware to be upgrade sent by the control device is:
- the calling transceiver device 603 receives an upgrade file of the firmware to be upgraded sent by the control device;
- the target firmware ID is parsed from the preset area of the upgrade file.
- the specific manner in which the controller 601 obtains the upgrade data required for the firmware to be upgraded is:
- the upgrade data is extracted from the upgrade file, wherein the extracted upgrade data is the upgrade data required for the firmware to be upgraded.
- controller 601 is further configured to:
- the calling transceiver device 603 is sent an error indication message to the control device.
- the error indication message carries the target firmware identifier.
- the specific manner in which the controller 601 obtains the upgrade data required for the firmware to be upgraded is:
- the calling transceiver device 603 receives the upgrade data sent by the control device, and the upgrade data is the upgrade data required for the firmware to be upgraded, and the upgrade data is sent when the control device does not receive the error indication message within the preset time.
- controller 601 is further configured to:
- the calling transceiver device 603 is sent a confirmation indication message to the control device.
- the confirmation indication message carries the target firmware identifier.
- the specific manner in which the controller 601 obtains the upgrade data required for the firmware to be upgraded is: receiving the upgrade data sent by the control device in response to the confirmation indication message, and the upgrade data is the upgrade data required for the firmware to be upgraded.
- the electronic device can be a pan/tilt head, and the pan/tilt head is mounted on the aircraft.
- the controller may be an MCU, and the processor may be a central processing unit (CPU), and the processor may also be another general-purpose processor or a digital signal processor (Digital Signal Processor). , DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc.
- the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
- Transceiver 605 can be used to receive or transmit data, such as components including signal sources, transducers, transmitters, and receivers.
- Memory 602 can include read only memory and random access memory and provides instructions and data to a controller or processor. A portion of the memory 602 may also include a non-volatile random access memory. For example, the memory 602 can also store firmware identification.
- the controller 601, the memory 602, the transceiver 603, the transceiver 605, and the like described in the embodiments of the present invention may perform the implementation described in the firmware upgrade method shown in FIG. 1-3, and may also perform the implementation.
- the implementation in the firmware upgrade device described in FIG. 4 is not described here.
- FIG. 7 is a schematic structural diagram of a control device according to an embodiment of the present invention.
- the server in the embodiment of the present invention as shown in FIG. 7 may include: a processor 701 and a memory 702, a transceiver device 703, a processor 701 and a memory 702, and a transceiver device 703 may be connected through a bus 704, or may be connected through other means.
- the memory 702 is used to store a computer program, the computer program includes program instructions, and the processor 701 is configured to execute program instructions stored in the memory 702. Wherein, the processor 701 is configured to invoke program instruction execution:
- the transceiver device 703 Calling the transceiver device 703 to send a firmware upgrade command to the electronic device; calling the transceiver device 703 to send the target firmware identifier of the firmware to be upgraded to the electronic device; determining whether an error indication message sent by the electronic device is received within a preset time; if no error is received When the message is indicated, the transceiver device 703 is called to send the upgrade data required for the firmware to be upgraded to the electronic device.
- the specific manner of the processor 701 calling the transceiver device 703 to send the target firmware identifier of the firmware to be upgraded to the electronic device is: calling the transceiver device 703 to send the upgrade file of the firmware to be upgraded to the electronic device, where the preset file of the upgrade file is carried. There is a target firmware ID.
- the processor 701 is further configured to: if the error indication message is received within the preset time, prohibit sending the upgrade data required for the firmware to be upgraded to the electronic device.
- the error indication message carries the target firmware identifier.
- the processor 701 is further configured to: determine whether an acknowledgment indication message sent by the electronic device is received within a preset time; if the acknowledgment indication message is received, the transceiver 703 is invoked to send an upgrade required to upgrade the firmware to the electronic device. data.
- the confirmation indication message carries the target firmware identifier.
- the electronic device can be a pan/tilt, and the pan/tilt can be mounted on the aircraft.
- the processor 701 may be a CPU, and the processor may also be other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. Wait.
- the transceiver device 703 can be used to receive or transmit data, such as components including signal sources, transducers, transmitters, and receivers.
- the memory 702 can include read only memory and random access memory and provides instructions and data to the processor 701.
- a portion of the memory 702 can also include a non-volatile random access memory.
- the memory 702 can also firmware identify and upgrade data, and the like.
- the processor 701, the memory 702, and the transceiver device 703 described in the embodiments of the present invention may perform the implementation manner described in the firmware upgrade method shown in FIG. 1-3, and may also perform the method described in FIG. The implementation of the firmware upgrade device will not be described here.
- the embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program includes program instructions, and when the program instructions are executed by the processor, the firmware update command sent by the control device is received;
- the firmware upgrade command acquires the target hardware identifier of the current controller, the target hardware identifier is used to uniquely determine the identity of the current controller, and receives the target firmware identifier of the firmware to be upgraded sent by the control device; according to the preset hardware identifier and the firmware identifier Relationship: Determine whether the target firmware identifier matches the target hardware identifier; if it matches, obtain the upgrade data required for the firmware to be upgraded, and upgrade the firmware to be upgraded according to the upgrade data.
- An embodiment of the present invention provides another computer readable storage medium.
- the computer readable storage medium stores a computer program.
- the computer program includes program instructions.
- the firmware update command is sent to the electronic device.
- the device sends the target firmware identifier of the firmware to be upgraded; determines whether an error indication message sent by the electronic device is received within a preset time; if the error indication message is not received, sends the upgrade data required for the firmware to be upgraded to the electronic device.
- the program may be stored in a computer readable storage medium, and the storage medium may include: Flash disk, Read-Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
一种固件升级方法、装置、电子设备及控制设备,其中一种固件升级方法包括:接收控制设备发送的固件升级命令,响应于该固件升级命令,获取当前控制器的目标硬件标识,接收控制设备发送的待升级固件的目标固件标识,根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配,在匹配的情况下,获取待升级固件所需的升级数据,并根据该升级数据对待升级固件进行升级。该方法有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
Description
本发明涉及电子技术领域,尤其涉及一种固件升级方法、装置、电子设备及控制设备。
固件是指写入可擦写只读存储器或者电可擦可编程只读存储器中的程序,也可以看作是存储在介质中的一种二进制文件,用于实现电子设备的功能。随着计算机技术的不断发展和用户对电子设备要求的不断提高,电子设备中的固件需要不断升级更新,以丰富产品功能,增强用户体验。
目前,在进行固件升级时,电子设备的微控制器一旦接收到新固件数据,就将新固件数据替换原固件数据存储在介质中,以实现固件的升级。然而,这样的固件升级方法容易将不需要升级固件误当作待升级固件进行升级,或者误将其他文件当作固件文件进行升级,导致固件升级错误,造成升级失败,甚至可能会因升级错固件导致***死机,使得电子设备无法正常使用。
发明内容
本发明实施例公开了一种固件升级方法、装置、电子设备及控制设备,有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
第一方面,本发明实施例提供了一种固件升级方法,包括:
接收控制设备发送的固件升级命令;
响应于固件升级命令,获取当前控制器的目标硬件标识,目标硬件标识用于唯一确定当前控制器的身份;
接收控制设备发送的待升级固件的目标固件标识;
根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配;
如果匹配,则获取待升级固件所需的升级数据,并根据升级数据对待升级 固件进行升级。
第二方面,本发明实施提供了另一种固件升级方法,包括:
向电子设备发送固件升级命令;
向电子设备发送待升级固件的目标固件标识;
判断在预设时间内是否接收到电子设备发送的错误指示消息;
如果没有接收到错误指示消息,则向电子设备发送待升级固件所需的升级数据。
第三方面,本发明实施例提供了一种固件升级装置,固件升级装置可配置于电子设备中,电子设备包括至少一个控制器,固件升级装置包括:
接收单元,用于接收控制设备发送的固件升级命令;
获取单元,用于响应于固件升级命令,获取当前控制器的目标硬件标识,目标硬件标识用于唯一确定当前控制器的身份;
接收单元,还用于接收控制设备发送的待升级固件的目标固件标识;
判断单元,用于根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配;
获取单元,还用于获取待升级固件所需的升级数据,并根据升级数据对待升级固件进行升级。
第四方面,本发明实施例提供了另一种固件升级装置,包括:
发送单元,用于向电子设备发送固件升级命令;
发送单元,还用于向电子设备发送待升级固件的目标固件标识;
判断单元,用于判断在预设时间内是否接收到电子设备发送的错误指示消息;
发送单元,还用于如果没有接收到错误指示消息,则向电子设备发送待升级固件所需的升级数据。
第五方面,本发明实施例提供了一种电子设备,包括至少一个控制器、存储器和收发设备:
所述存储器,用于存储程序指令;
所述处理器,用于调用所述存储器中的所述程序指令执行以下步骤:
调用所述收发设备接收控制设备发送的固件升级命令;
响应于所述固件升级命令,获取当前控制器的目标硬件标识,所述目标硬件标识用于唯一确定所述当前控制器的身份;
调用所述收发设备接收所述控制设备发送的待升级固件的目标固件标识;
根据预设的硬件标识与固件标识的对应关系,判断所述目标固件标识是否与所述目标硬件标识相匹配;
如果匹配,则获取所述待升级固件所需的升级数据,并根据所述升级数据对所述待升级固件进行升级。
第六方面,本发明实施例提供了一种控制设备,包括存储器、收发设备和处理器:
所述存储器,用于存储程序指令;
所述处理器,用于调用所述存储器中的程序指令执行以下步骤:
调用所述收发设备向电子设备发送固件升级命令;
调用所述收发设备向所述电子设备发送待升级固件的目标固件标识;
判断在预设时间内是否接收到所述电子设备发送的错误指示消息;
如果没有接收到所述错误指示消息,则调用所述收发设备向所述电子设备发送所述待升级固件所需的升级数据。
第七方面,本发明实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序包括程序指令,程序指令当被处理器执行时使处理器执行上述第一方面的固件升级方法。
第八方面,本发明实施例提供了另一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序包括程序指令,程序指令当被处理器执行时使处理器执行上述第二方面的固件升级方法。
本发明实施例中通过获取当前控制器的目标硬件标识来响应于接收到的控制设备发送的固件升级命令,进一步的根据预设的硬件标识与固件标识的对应关系,判断在该目标硬件标识与接收到的控制设备发送的目标固件标识匹配的情况下,获取待升级固件所需的升级数据,根据该升级数据对待升级固件进行升级,有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的一种固件升级方法的流程示意图;
图2是本发明实施例提供的一种固件的升级文件的结构示意图;
图3是本发明实施例提供的另一种固件升级方法的流程示意图;
图4是本发明实施例提供的一种固件升级装置的结构示意图;
图5是本发明实施例提供的另一种固件升级装置的结构示意图;
图6是本发明实施例提供的一种电子设备的结构示意图;
图7是本发明实施例提供的一种控制设备的结构示意图。
本发明中涉及到的电子设备可以为手机、平板电脑等便携式移动终端,也可以为计算机等非便携式终端,或者也可以为云台,或者可以为飞行器如无人机,其中,云台可以搭载于飞行器上。电子设备内部可包括印刷电路板(Printed Circuit Board,PCB),用于实现电子设备中各元器件之间的连接,为电子设备提供必要的机械支撑。印刷电路板上集成有多个微控制单元(Microcontroller Unit,MCU)或叫做控制器或叫做微控制器等等,下文以控制器为例进行描述。每个控制器可控制多个电子设备的固件,实现电子设备的某一具体功能,各个控制器共同配合实现电子设备各种复杂的功能。可选的,电子设备的印刷电路板上还可包括至少一个寄存器,寄存器可以与控制器一一对应,用于存储控制器的相关数据。
控制设备可以为计算机,也可以为服务器,或者为控制终端,用于向电子设备发送固件升级命令,并为电子设备提供待升级固件的身份验证数据、升级数据以及其他待升级固件所需的数据。
在产品生命周期内,为了应对功能需求变更,控制器的软件架构可采取两级结构,比如第一级BootLoader(引导加载程序),主要负责固件升级功能; 第二级是固件,负责产品的正常功能。在设计产品的初期,可给控制器分配硬件标识,该标识可以是印制电路板上的一个分压值,或者可以是寄存器中存储的标识等等,用于唯一确定该控制器的身份。固件生成的时候,可以确定固件标识,如在预设区域写入该固件标识。举例来说,可通过修改链接脚本,在固件头部划分出一段保留区,并在该保留区的指定偏移处写入固件标识。不同的控制器对应不同的固件标识,每个控制器下固件的固件标识与该控制器的硬件标识相对应。可选的,该硬件标识还可以叫做硬件ID、产品标识或者其余名称;该固件标识还可叫做软件标识、软件ID、产品编号或者其余名称。进一步可选的,一个控制器下固件的固件标识可以相同,比如可以为与该控制器的硬件标识相同,一个控制器下固件的固件标识也可以不同,预先设置得到硬件标识和固件标识的对应关系即可,本申请不做限定。
在实现固件升级时,控制设备可通过向电子设备发送固件升级命令,以指示电子设备进行固件升级。从而电子设备可在接收到该固件升级命令之后,可响应于控制设备发送的固件升级命令,获取电子设备当前控制器的目标硬件标识,为固件升级做准备。进一步的,控制设备还可向电子设备发送待升级固件的目标固件标识,从而电子设备可接收该目标固件标识并根据预设的固件标识与硬件标识的对应关系,判断该目标固件标识与目标硬件标识是否匹配,如果匹配,则可跳转到固件,正常运行,即电子设备可获取控制设备发送的待升级固件的升级数据对待升级固件进行固件升级;如果不匹配,则电子设备可不对待升级固件进行升级,比如可停留在BootLoader(引导加载程序)中。进一步可选的,该固件升级命令、目标固件标识和升级数据可携带于一条消息中发送给电子设备,或者可以采用不同的消息分别发送给电子设备,或者该固件升级命令可单独发送,该目标固件标识和升级数据可携带于一条消息中如包括升级文件的消息中发送给电子设备,等等,本申请不做限定。该当前控制器可以是指接收到固件升级命令的控制器。
参考图1为本发明实施例提供的一种固件升级方法的流程示意图,如图1所示的固件升级方法可包括:
101、控制设备向电子设备发送固件升级命令。
可选的,在控制设备向电子设备发送固件升级命令之前,可先检测与电子 设备之间的连接是否建立。如果与电子设备之间的连接已经建立,则控制设备向电子设备发送固件升级命令;如果与电子设备之间的连接未建立,则控制设备可不向电子设备发送固件升级命令或者控制设备可先与电子设备建立连接之后,再发送固件升级命令,如此可节省控制设备的功耗开销。其中,控制设备与电子设备之间的连接可以为有线连接,也可以为无线连接。
可选的,控制设备向电子设备发送的固件升级命令可以是控制设备根据电子设备发送的固件升级请求生成的,或者是控制设备根据对电子设备的固件检测结果生成的。也就是说,控制设备向电子设备发送固件升级命令,可能是由于控制设备接收到电子设备发送的固件升级请求,然后控制设备针对该固件升级请求生成固件升级命令;控制设备向电子设备发送固件升级命令,还可能是控制设备定期(比如按照预设时间间隔检测)或者不定期的对电子设备的固件进行检测,如果控制设备检测到电子设备中有需要升级的固件,则针对该需要升级的固件生成固件升级命令。本发明实施例只是列举两种可能的控制设备生成固件升级命令并向电子设备发送的方式,具体的实施方式不做限定。
102、电子设备获取当前控制器的目标硬件标识。
其中,硬件标识用于唯一确定控制器的身份,也就是说每个控制器对应一个唯一的且固定的硬件标识。目标硬件标识用于唯一确定当前控制器的身份标识。硬件标识可以是电子设备在生产初期,为印刷电路板上的每个控制器预先设定的。或者硬件标识也可以指在电子设备生产初期,为印刷电路板预先设定的,比如该印刷电路板仅包括一个控制器时该硬件标识也可以为该印刷电路板的标识。也就是说,在本发明实施例中硬件标识可以是针对每个控制器而言的。
具体的,电子设备接收到控制设备发送的固件升级命令之后,为固件升级做准备,可先获取当前控制器的目标硬件标识,用于确定当前正在运行的控制器的身份。
可选的,获取当前控制器的目标硬件标识,包括:采集当前控制器在印刷电路板上的分压值,并根据分压值确定当前控制器的目标硬件标识。也就是说电子设备可以通过采集当前控制器分压值,比如通过硬件电路采集当前控制器在印刷电路板上分配的电压,以根据该分压值确定当前控制器的目标硬件标识。可选的,印刷电路板上每个控制器的分压值不同,电子设备可以将采集到的分 压值作为当前控制器的目标硬件标识,或者电子设备可以对该分压值进行预设运算或者其他操作来确定当前控制器的目标硬件标识。
可选的,获取当前控制器的目标硬件标识,包括:从当前控制器的寄存器中读取当前控制器的硬件信息;根据硬件信息确定当前控制器的目标硬件标识。其中,控制器的硬件信息可包括硬件标识、数值或者其他硬件信息。也就是说,当前控制器的目标硬件标识也可以是预先存储在当前控制器对应的寄存器中的,电子设备可从当前控制器对应的寄存器中读取当前控制器的硬件信息,该硬件信息中可包括目标硬件标识,比如某一数值,或者可通过硬件信息中某些信息可确定目标硬件标识。
103、控制设备向电子设备发送待升级固件的目标固件标识。
其中,目标固件标识用于唯一确定固件身份。固件标识可以是在固件生成时,为固件添加的身份标识。可选的,控制设备向电子设备发送待升级固件的目标固件标识,包括:向电子设备发送待升级固件的升级文件,升级文件的预设区域中携带有目标固件标识。也就是说,控制设备可在待升级固件的升级文件中,留出预设区域,将待升级固件的目标固件标识写入该预设区域,控制设备将升级文件发送给电子设备,也就同时将待升级固件的目标固件标识发送给电子设备。可选的,电子设备接收到控制设备发送的待升级固件的目标固件标识,包括:接收控制设备发送的待升级固件的升级文件;从升级文件的预设区域中解析出目标固件标识。具体的,假设控制设备将待升级固件的升级文件的保留区域中写入待升级固件的目标固件标识,然后将该升级文件发送给电子设备,电子设备接收到升级文件之后,可从升级文件的保留区中解析出待升级固件的目标固件标识。举例来说,如图2所示,假设控制设备向电子设备发送的待升级固件的升级文件由向量表数据、保留区以及其他固件数据三部分组成,可假设控制设备将目标固件标识写入预设的保留区,电子设备接收到升级文件后,可从保留区中解析出目标固件标识。
在本申请中,该固件升级命令和目标固件标识可携带于一条消息中发送给电子设备,也可以分别发送给电子设备,本申请不做限定。
104、电子设备判断该目标固件标识与当前控制器的目标硬件标识是否匹配。
可选的,电子设备可接收控制设备发送的待升级固件的目标固件标识,进而可根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配。也就是说,电子设备可预先获取得到至少一组固件标识与控制器的硬件标识的对应关系并进行存储,进而可根据预设的至少一组固件标识与硬件标识的对应关系,判断目标固件标识与当前控制器的目标硬件标识是否匹配。例如,电子设备可将一个控制器下的固件的固件标识和该控制器的硬件标识确定为具有对应关系,也即相匹配。进一步的,电子设备判断该目标固件标识与当前控制器的目标硬件标识是否匹配也就是判断目标固件标识与当前控制器的目标硬件标识是否符合上述的对应关系,如果符合,则电子设备可判断该目标固件标识与当前控制器的目标硬件标识匹配;如果不符合,则电子设备可判断该目标固件标识与当前控制器的目标硬件标识不匹配。
可选的,如果目标硬件标识与目标固件标识不匹配,则可向控制设备发送错误指示消息,用于指示控制设备不继续向电子设备发送待升级固件的升级数据,或者指示控制设备重新选择待升级固件以进行升级。可选的,错误指示消息中可携带有目标固件标识,从而控制设备接收到错误指示消息后,能够根据该目标固件标识快速确定该错误指示消息是针对哪个待升级固件发出的,进而可快速获取该待升级固件的升级数据,尤其是在需升级的固件较多时,这就节约了控制设备查询时间。
举例来说,假设控制设备可同时向电子设备发送多个固件升级命令,用于分别指示电子设备对多个待升级固件进行升级,电子设备获取当前控制器的目标硬件标识并接收到控制设备发送的多个目标固件标识,假设接收到两个目标固件标识,分别记为目标固件标识1和目标固件标识2,电子设备将目标硬件标识分别与目标固件1和目标固件标识2进行匹配。如果目标固件标识2与目标硬件标识匹配不成功,则电子设备向控制设备发送错误指示消息,该错误指示消息中包括目标固件标识2,如此,控制设备在接收到错误指示消息后,可以快速的从发送的待升级固件的升级数据中查找到目标固件标识2对应的升级数据,并对该升级数据进行处理。
可选的,如果硬件标识与目标固件相匹配,则可向控制器发送确认指示消息。该确认指示消息用于指示控制设备可继续向电子设备发送待升级固件所需 的升级数据,如此,可以保证控制设备在较短时间内将待升级固件的升级数据发送给电子设备,以便于电子设备对待升级固件进行升级,节省固件升级时间。可选的,确认指示消息中携带有目标固件标识,可以在多个待升级固件同时升级的情况下,保证控制设备能够根据该目标固件标识快速确定该确认指示消息是针对哪个固件发出的,便于控制设备向电子设备发送该目标固件标识对应的待升级固件的升级数据,节省固件升级时间。
可选的,如果硬件标识与目标固件相匹配,则电子设备也可不向控制设备发送确认指示消息比如可不发送任何消息,等到控制设备在预设时间内没有接收到电子设备发送的错误指示消息时,控制设备再向电子设备发送待升级固件的升级数据,如此可以节省电子设备的功耗开销。
105、如果预设时间内控制设备未接收到电子设备发送的错误指示消息或者接收到确认指示消息,则向电子设备发送待升级固件的升级数据。
具体的,预设时间内控制设备未接收到电子设备发送的错误指示消息或者接收到确认指示消息,可表示控制设备发送的待升级固件的目标固件标识与电子设备当前控制器的硬件标识相匹配,也就是表明该目标固件标识对应的待升级固件是需要升级的正确固件,比如该待升级固件属于当前控制器控制下的固件,则控制设备可向电子设备发送待升级固件的升级数据,以便于对该正确的待升级固件进行升级。
106、电子设备获取待升级固件的升级数据,对待升级固件进行升级。
可选的,获取待升级固件的升级数据,包括:接收控制设备发送的升级数据,该升级数据为待升级固件所需的升级数据,且该升级数据是控制设备在预设时间内未接收到错误指示消息时发送的,或者该升级数据是控制设备在预设时间内未接收到任何消息时发送的。可选的,获取待升级固件的升级数据,包括:接收控制设备响应确认指示消息发送的升级数据,该升级数据为待升级固件所需的升级数据。也就是说,电子设备获取到的待升级固件的升级数据,可能是在控制设备在预设时间内未接收到电子设备发送的错误指示消息(或者其他指示消息)的情况下发送的,也可能是控制设备在接收到电子设备发送的确认指示消息情况下发送的。
本发明实施例中电子设备接收到控制设备发送的固件升级命令后,获取当 前控制器的目标硬件标识,并接收控制设备发送的待升级固件的目标固件标识。电子设备将目标硬件标识与目标固件标识进行匹配,在匹配成功的情况下,也即电子设备在预设时间内没有向控制设备发送错误指示消息或者发送确认指示消息的情况下,获取控制设备发送的待升级固件的升级数据,对待升级固件进行升级,有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
参考图3,为本发明实施例提供的另一种固件升级方法的示意流程图,如图3所示的固件升级方法,可包括:
301、控制设备向电子设备发送固件升级命令。
302、电子设备获取当前控制器的目标硬件标识。
具体的,电子设备接收到控制设备发送的固件升级命令之后,为固件升级做准备,可先获取当前控制器的目标硬件标识,用于确定当前正在运行的控制器的身份。可选的,该电子设备获取目标硬件标识的方式可参照上述图1所示实施例中获取目标硬件标识的方式的描述,此处不赘述。
303、控制设备向电子设备发送待升级固件的升级文件。
304、电子设备从控制设备发送的升级文件中获取待升级固件的目标固件标识。
其中,升级文件中可包括待升级固件的目标固件标识。可选的,在电子设备与控制设备之间的连接建立时,电子设备如果检测到内部有固件需要升级,则可向控制设备发送固件升级请求,控制设备针对该固件升级请求生成固件升级命令,并将该固件升级命令发送给电子设备,用于指示电子设备进行固件升级准备。换句话说,电子设备接收到控制设备发送的固件升级命令之后,获取电子设备当前控制器的目标硬件标识可以看作电子设备为开始固件升级做准备。电子设备为开始固件升级做准备后,控制设备向电子设备发送待升级固件的升级文件,电子设备准备进入正式固件升级步骤。
具体的,控制设备向电子设备发送的待升级固件的升级文件中,可在预设区域携带有目标固件标识,从而电子设备接收到控制设备发送的升级文件后,可从预设区域解析出目标固件标识。
305、电子设备判断目标硬件标识是否与目标固件标识相匹配。如果匹配, 则可执行步骤306。
电子设备可根据预设的固件标识与硬件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配。电子设备判断目标硬件标识是否与目标固件标识相匹配也就是判断目标硬件标识与目标固件标识是否符合预设的固件标识与硬件标识的对应关系,如果符合,则表示目标硬件标识与目标固件标识相匹配;如果不符合,则表示目标硬件标识与目标固件标识不匹配。可选的,电子设备预设的固件标识与控制器的硬件标识的对应关系可以为一个硬件标识对应多个固件标识,一个固件标识对应一个硬件标识。在本发明实施例中一个目标硬件标识可对应多个目标固件标识,一个目标固件标识只能对应一个目标硬件标识。举例来说,可假设电子设备的控制器1可包括固件10、固件11以及固件12;控制器2可包括固件20、固件21以及固件22。可假设电子设备预先为控制器1设置的硬件标识为ID1,控制器1包括的固件10的固件标识可为ID110、固件11的固件标识可为ID111,以及固件12的固件标识可为ID112;控制器2的硬件标识为ID2,控制器2包括的固件20的固件标识为ID220,固件21的固件标识为ID221,固件22的固件标识可为ID222。电子设备预设的固件标识与控制器的硬件标识的对应关系可以为:控制器ID1分别与ID110、ID111以及ID112具有对应关系,控制器ID2分别与ID220、ID221以及ID222具有对应关系。也即固件标识为ID110、ID111以及ID112的固件对应的硬件标识为均为ID1,固件标识为ID220、ID221以及ID221对应的硬件标识为均为ID2。
在上述例子中,假设电子设备获取到的当前控制器的目标硬件标识为ID2,若假设电子设备接收到的控制设备发送的目标固件标识为ID110,则电子设备根据预设的固件标识与硬件标识的对应关系,可判断出目标硬件标识ID2与目标固件标识ID110不符合预设的对应关系,即不匹配;若假设电子设备接收到的控制设备发送的目标固件标识为ID220,则电子设备可判断出目标硬件标识ID2与目标固件标识ID220符合预设的对应关系,即相匹配。
306、电子设备从控制设备发送的升级文件中获取待升级固件的升级数据,对待升级固件进行升级。
可选的,该升级文件中还可包括该待升级固件的升级数据。具体的,电子 设备可从升级文件中获得的目标固件标识与当前控制器的目标硬件标识进行匹配,如果匹配成功,可确定控制设备选择的待升级固件为当前控制器下的固件,即表示控制设备选择的待升级固件是电子设备欲升级的固件,即正确的固件,则电子设备可从控制设备发送的待升级固件的升级数据中获取升级所需的升级数据,对待升级固件进行升级;如果匹配不成功,可确定控制设备选择的待升级固件不是当前控制器下的固件或者控制设备选择的待升级固件不是正确的固件,即表示控制设备选择的待升级固件不是电子设备欲升级的固件,即错误的固件,则电子设备可不从控制设备发送的待升级固件的升级数据中获取升级所需的升级数据,如此可节省功耗开销。
应理解,在其他可选的实施例中,控制设备还可分别向电子设备发送目标固件标识和该升级数据,或者,控制设备还可将该固件升级命令、目标固件标识和该升级数据携带于一条消息发送给电子设备,本申请不做限定。
本发明实施例中电子设备接收到控制设备发送的待升级固件的升级命令后,获取当前控制器的目标硬件标识,同时接收控制设备发送的待升级固件的升级文件。进一步的,电子设备将目标硬件标识与升级文件中包括的目标固件标识进行匹配,并在匹配成功的情况下,电子设备从升级文件中获取待升级固件的升级数据,对待升级固件进行升级,有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
参考图4,为本发明实施例提供的一种固件升级装置的结构示意图,具体的,该固件升级装置可设置于上述电子设备中。如图4所示的固件升级装置,可包括接收单元401、获取单元402以及判断单元403。
接收单元401,用于接收控制设备发送的固件升级命令;
获取单元402,用于响应于固件升级命令,获取当前控制器的目标硬件标识,目标硬件标识用于唯一确定当前控制器的身份;
接收单元401,还用于接收控制设备发送的待升级固件的目标固件标识;
判断单元403,用于根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配;
获取单元402,还用于如果目标固件标识与目标硬件标识相匹配,获取待升级固件所需的升级数据,并根据升级数据对待升级固件进行升级。
可选的,获取单元402获取当前控制器的目标硬件标识的具体方式为:采集当前控制器在印刷电路板上的分压值;根据分压值确定当前控制器的目标硬件标识。其中,该电子设备包括至少一个控制器,还包括印刷电路板,至少一个控制器配置于印刷电路板上。
可选的,获取单元402获取当前控制器的目标硬件标识的具体方式为:从当前控制器的寄存器中读取当前控制器的硬件信息;根据硬件信息确定当前控制器的目标硬件标识。进一步可选的,该电子设备还可包括至少一个寄存器,印刷电路板上的控制器可以和配置的寄存器一一对应。
可选的,接收单元401接收控制设备发送的待升级固件的目标固件标识的具体方式为:接收控制设备发送的待升级固件的升级文件;从升级文件的预设区域中解析出目标固件标识。
可选的,升级文件中包括升级数据,获取单元402获取待升级固件所需的升级数据的具体方式为:如果目标固件标识与目标硬件标识相匹配,从升级文件中提取升级数据,其中,提取的升级数据为待升级固件所需的升级数据。
可选的,固件升级装置还包括发送单元404,用于如果目标固件标识与目标硬件标识不匹配,则向控制设备发送错误指示消息。可选的,错误指示消息中携带有目标固件标识。可选的,获取单元402获取待升级固件所需的升级数据的具体方式为:接收控制设备发送的升级数据,升级数据为待升级固件所需的升级数据,且升级数据是控制设备在预设时间内未接收到错误指示消息时发送的。
可选的,发送单元404,还用于如果目标固件标识与目标硬件标识相匹配,则向控制设备发送确认指示消息。可选的,确认指示消息中携带有目标固件标识。可选的,获取单元402获取待升级固件所需的升级数据的具体方式为:接收控制设备响应确认指示消息发送的升级数据,升级数据为待升级固件所需的升级数据。
可选的,固件升级装置可设置于云台中,云台可搭载于飞行器上。或者,该固件升级装置可设置于飞行器中。
本发明实施例中接收单元401接收到控制设备发送的固件升级命令之后,进一步接收控制设备发送的待升级固件的目标固件标识,获取单元402用于响 应该固件升级命令,获取当前控制器的目标硬件标识,从而判断单元403判断获取单元402获取到的目标固件标识是否与接收单元401接收到的目标硬件标识相匹配,在匹配的情况下,获取单元402获取待升级固件所需的升级数据。本发明实施例有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
参考图5,为本发明实施例提供的另一种固件升级装置的结构示意图,如图5所示的固件升级装置,可包括发送单元501和判断单元502。
发送单元501,用于向电子设备发送固件升级命令;
发送单元501,还用于向电子设备发送待升级固件的目标固件标识;
判断单元502,用于判断在预设时间内是否接收到电子设备发送的错误指示消息;
发送单元501,还用于如果没有接收到错误指示消息,则向电子设备发送待升级固件所需的升级数据。
可选的,发送单元501,具体用于向电子设备发送待升级固件的升级文件,升级文件的预设区域中携带有目标固件标识。
可选的,发送单元501还用于如果在预设时间内接收到错误指示消息,则禁止向电子设备发送待升级固件所需的升级数据。可选的,错误指示消息中携带有目标固件标识。
可选的,判断单元502,还用于判断在预设时间内是否接收到电子设备发送的确认指示消息;
发送单元501,还用于如果接收到确认指示消息,则向电子设备发送待升级固件所需的升级数据。
可选的,确认指示消息中携带有目标固件标识。可选的,电子设备为云台,云台搭载于飞行器上。
本发明实施例中发送单元501向电子设备发送固件升级命令和待升级固件的目标固件标识,并且在判断单元502判断在预设时间内没有接收到错误指示消息情况下,向电子设备发送待升级固件的升级数据,可以有助于提升固件升级的准确性和可靠性,减少因升级错固件导致的***死机,以确保设备的正常运行。
参考图6为本发明实施例提供的一种电子设备的结构示意图,本发明实施例中的电子设备可以为云台或者飞行器如无人机。电子设备可包括至少一个控制器601、存储器602以及收发设备603,控制器601、存储器602和收发设备603可通过总线604连接,或者可以通过其余方式连接,图5中以总线方式进行说明。其中,控制器601可用于控制待升级固件进行升级,存储器602可用于存储程序指令。进一步可选的,该电子设备还可包括一个或多个处理器,该一个或多个处理器可以和该控制器601连接,或者该控制器601中可包括一个或多个处理器。具体的,控制器601可调用存储器602中存储程序指令执行:
调用收发设备603接收控制设备发送的固件升级命令;
响应于固件升级命令,获取当前控制器的目标硬件标识,目标硬件标识用于唯一确定当前控制器的身份;
调用收发设备603接收控制设备发送的待升级固件的目标固件标识;
根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配;
如果匹配,则获取待升级固件所需的升级数据,并根据升级数据对待升级固件进行升级。
可选的,电子设备还包括印刷电路板,用于支持电子设备内各个元器件之间的连接,为电子设备提供机械支撑。控制器601可配置于印刷电路板上,控制器601获取当前控制器的目标硬件标识的具体方式为:
采集当前控制器在印刷电路板上的分压值;
根据分压值确定当前控制器的目标硬件标识。
可选的,电子设备还可包括寄存器605,寄存器与控制器一一对应,控制器601获取当前控制器的目标硬件标识的具体方式为:
从当前控制器的寄存器中读取当前控制器的硬件信息;
根据硬件信息确定当前控制器的目标硬件标识。
可选的,控制器601调用收发设备603接收控制设备发送的待升级固件的目标固件标识的具体方式为:
调用收发设备603接收控制设备发送的待升级固件的升级文件;
从升级文件的预设区域中解析出目标固件标识。
可选的,控制器601获取待升级固件所需的升级数据的具体方式为:
如果目标固件标识与目标硬件标识相匹配,从升级文件中提取升级数据,其中,提取的升级数据为待升级固件所需的升级数据。
可选的,控制器601还用于执行:
如果目标固件标识与目标硬件标识不匹配,则调用收发设备603向控制设备发送错误指示消息。可选的,错误指示消息中携带有目标固件标识。
可选的,控制器601获取待升级固件所需的升级数据的具体方式为:
调用收发设备603接收控制设备发送的升级数据,升级数据为待升级固件所需的升级数据,且升级数据是控制设备在预设时间内未接收到错误指示消息时发送的。
可选的,控制器601还用于执行:
如果目标固件标识与目标硬件标识相匹配,则调用收发设备603向控制设备发送确认指示消息。可选的,确认指示消息中携带有目标固件标识。可选的,控制器601获取待升级固件所需的升级数据的具体方式为:接收控制设备响应确认指示消息发送的升级数据,升级数据为待升级固件所需的升级数据。
可选的,电子设备可为云台,云台搭载于飞行器上。
应当理解,在本发明实施例中,控制器可以是MCU,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
收发设备605可用于接收或者发送数据,比如组成部分可以包括信号源、变换器、发射机和接收机等。
存储器602可以包括只读存储器和随机存取存储器,并向控制器或处理器提供指令和数据。存储器602的一部分还可以包括非易失性随机存取存储器。例如,存储器602还可以存储固件标识。
具体实现中,本发明实施例中所描述的控制器601、存储器602、收发设 备603、收发设备605等可执行图1-3所示的固件升级方法中所描述的实现方式,也可以执行图4所描述的固件升级装置中的实现方式,在此不再赘述。
参考图7,是本发明实施例提供的一种控制设备的结构示意图。如图7所示的本发明实施例中的服务器可以包括:处理器701和存储器702、收发设备703,处理器701和存储器702、收发设备703可通过总线704连接,或者可以通过其余方式连接。存储器702用于存储计算机程序,计算机程序包括程序指令,处理器701用于执行存储器702存储的程序指令。其中,处理器701被配置用于调用程序指令执行:
调用收发设备703向电子设备发送固件升级命令;调用收发设备703向电子设备发送待升级固件的目标固件标识;判断在预设时间内是否接收到电子设备发送的错误指示消息;如果没有接收到错误指示消息,则调用收发设备703向电子设备发送待升级固件所需的升级数据。
可选的,处理器701调用收发设备703向电子设备发送待升级固件的目标固件标识的具体方式为:调用收发设备703向电子设备发送待升级固件的升级文件,升级文件的预设区域中携带有目标固件标识。
可选的,处理器701还用于执行:如果在预设时间内接收到错误指示消息,则禁止向电子设备发送待升级固件所需的升级数据。可选的,错误指示消息中携带有目标固件标识。
可选的,处理器701还用于判断在预设时间内是否接收到电子设备发送的确认指示消息;如果接收到确认指示消息,则调用收发设备703向电子设备发送待升级固件所需的升级数据。可选的,确认指示消息中携带有目标固件标识。可选的,电子设备可为云台,云台可搭载于飞行器上。
应当理解,在本发明实施例中,处理器701可以是CPU,该处理器还可以是其他通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。
收发设备703可用于接收或者发送数据,比如组成部分可以包括信号源、变换器、发射机和接收机等。
该存储器702可以包括只读存储器和随机存取存储器,并向处理器701提供指令和数据。存储器702的一部分还可以包括非易失性随机存取存储器。例如, 存储器702还可以固件标识和升级数据等等。
具体实现中,本发明实施例中所描述的处理器701、存储器702和收发设备703可执行图1-3所示的固件升级方法中所描述的实现方式,也可以执行图5中所描述的固件升级装置的实现方式,在此不再赘述。
本发明实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序包括程序指令,程序指令被处理器执行时实现:接收控制设备发送的固件升级命令;响应于固件升级命令,获取当前控制器的目标硬件标识,目标硬件标识用于唯一确定当前控制器的身份;接收控制设备发送的待升级固件的目标固件标识;根据预设的硬件标识与固件标识的对应关系,判断目标固件标识是否与目标硬件标识相匹配;如果匹配,则获取待升级固件所需的升级数据,并根据升级数据对待升级固件进行升级。
本发明实施例提供了另一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序包括程序指令,程序指令被处理器执行时实现:向电子设备发送固件升级命令;向电子设备发送待升级固件的目标固件标识;判断在预设时间内是否接收到电子设备发送的错误指示消息;如果没有接收到错误指示消息,则向电子设备发送待升级固件所需的升级数据。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
以上对本发明实施例所提供的一种固件升级方法、装置、电子设备及控制设备进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。
Claims (40)
- 一种固件升级方法,所述方法应用于电子设备中,所述电子设备包括至少一个控制器,其特征在于,包括:接收控制设备发送的固件升级命令;响应于所述固件升级命令,获取当前控制器的目标硬件标识,所述目标硬件标识用于唯一确定所述当前控制器的身份;接收所述控制设备发送的待升级固件的目标固件标识;根据预设的硬件标识与固件标识的对应关系,判断所述目标固件标识是否与所述目标硬件标识相匹配;如果匹配,则获取所述待升级固件所需的升级数据,并根据所述升级数据对所述待升级固件进行升级。
- 如权利要求1所述的方法,其特征在于,所述电子设备还包括印刷电路板,所述至少一个控制器配置于所述印刷电路板上;所述获取当前控制器的目标硬件标识,包括:采集所述当前控制器在所述印刷电路板上的分压值;根据所述分压值确定所述当前控制器的所述目标硬件标识。
- 如权利要求1所述的方法,其特征在于,所述电子设备还包括至少一个寄存器,所述寄存器与所述控制器一一对应;所述获取当前控制器的目标硬件标识,包括:从所述当前控制器的寄存器中读取所述当前控制器的硬件信息;根据所述硬件信息确定所述当前控制器的所述目标硬件标识。
- 如权利要求1-3中任一项所述的方法,其特征在于,所述接收所述控制设备发送的待升级固件的目标固件标识,包括:接收所述控制设备发送的待升级固件的升级文件;从所述升级文件的预设区域中解析出所述目标固件标识。
- 如权利要求4所述的方法,其特征在于,所述升级文件中包括升级数据,所述获取所述待升级固件所需的升级数据,包括:如果所述目标固件标识与所述目标硬件标识相匹配,从所述升级文件中提取升级数据,其中,提取的所述升级数据为所述待升级固件所需的升级数据。
- 如权利要求1-4中任一项所述的方法,其特征在于,还包括:如果所述目标固件标识与所述目标硬件标识不匹配,则向所述控制设备发送错误指示消息。
- 如权利要求6所述的方法,其特征在于,所述错误指示消息中携带有所述目标固件标识。
- 如权利要求6所述的方法,其特征在于,所述获取所述待升级固件所需的升级数据,包括:接收所述控制设备发送的升级数据,所述升级数据为所述待升级固件所需的升级数据,且所述升级数据是所述控制设备在预设时间内未接收到所述错误指示消息时发送的。
- 如权利要求1-4中任一项所述的方法,其特征在于,还包括:如果所述目标固件标识与所述目标硬件标识相匹配,则向所述控制设备发送确认指示消息。
- 如权利要求9所述的方法,其特征在于,所述确认指示消息中携带有所述目标固件标识。
- 如权利要求9所述的方法,其特征在于,所述获取所述待升级固件所需的升级数据,包括:接收所述控制设备响应所述确认指示消息发送的升级数据,所述升级数据 为所述待升级固件所需的升级数据。
- 如权利要求1-11中任一项所述的方法,其特征在于,所述电子设备为云台,所述云台搭载于飞行器上。
- 一种固件升级方法,其特征在于,包括:向电子设备发送固件升级命令;向所述电子设备发送待升级固件的目标固件标识;判断在预设时间内是否接收到所述电子设备发送的错误指示消息;如果没有接收到所述错误指示消息,则向所述电子设备发送所述待升级固件所需的升级数据。
- 如权利要求13所述的方法,其特征在于,所述向所述电子设备发送待升级固件的目标固件标识,包括:向所述电子设备发送待升级固件的升级文件,所述升级文件的预设区域中携带有所述目标固件标识。
- 如权利要求13或14所述的方法,其特征在于,还包括:如果在所述预设时间内接收到所述错误指示消息,则禁止向所述电子设备发送所述待升级固件所需的升级数据。
- 如权利要求15所述的方法,其特征在于,所述错误指示消息中携带有所述目标固件标识。
- 如权利要求13或14所述的方法,其特征在于,在所述向所述电子设备发送待升级固件的目标固件标识之后,所述方法还包括:判断在所述预设时间内是否接收到所述电子设备发送的确认指示消息;如果接收到所述确认指示消息,则向所述电子设备发送待升级固件所需的升级数据。
- 如权利要求17所述的方法,其特征在于,所述确认指示消息中携带有所述目标固件标识。
- 如权利要求13-18中任一项所述的方法,其特征在于,所述电子设备为云台,所述云台搭载于飞行器上。
- 一种固件升级装置,所述固件升级装置可配置于电子设备中,所述电子设备包括至少一个控制器,其特征在于,包括:接收单元,用于接收控制设备发送的固件升级命令;获取单元,用于响应于所述固件升级命令,获取当前控制器的目标硬件标识,所述目标硬件标识用于唯一确定所述当前控制器的身份;所述接收单元,还用于接收所述控制设备发送的待升级固件的目标固件标识;判断单元,用于根据预设的硬件标识与固件标识的对应关系,判断所述目标固件标识是否与所述目标硬件标识相匹配;所述获取单元,还用于如果所述目标固件标识与所述目标硬件标识相匹配,获取所述待升级固件所需的升级数据,并根据所述升级数据对所述待升级固件进行升级。
- 一种固件升级装置,其特征在于,包括:发送单元,用于向电子设备发送固件升级命令;所述发送单元,还用于向所述电子设备发送待升级固件的目标固件标识;判断单元,用于判断在预设时间内是否接收到所述电子设备发送的错误指示消息;所述发送单元,还用于如果没有接收到所述错误指示消息,则向所述电子设备发送所述待升级固件所需的升级数据。
- 一种电子设备,其特征在于,包括至少一个控制器、存储器和收发设 备:所述存储器,用于存储程序指令;所述处理器,用于调用所述存储器中的所述程序指令执行以下步骤:调用所述收发设备接收控制设备发送的固件升级命令;响应于所述固件升级命令,获取当前控制器的目标硬件标识,所述目标硬件标识用于唯一确定所述当前控制器的身份;调用所述收发设备接收所述控制设备发送的待升级固件的目标固件标识;根据预设的硬件标识与固件标识的对应关系,判断所述目标固件标识是否与所述目标硬件标识相匹配;如果匹配,则获取所述待升级固件所需的升级数据,并根据所述升级数据对所述待升级固件进行升级。
- 如权利要求22所述的电子设备,其特征在于,所述电子设备还包括印刷电路板,所述至少一个控制器配置于所述印刷电路板上;所述控制器获取当前控制器的目标硬件标识的具体方式为:采集所述当前控制器在所述印刷电路板上的分压值;根据所述分压值确定所述当前控制器的所述目标硬件标识。
- 如权利要求22所述的电子设备,其特征在于,所述电子设备还包括至少一个寄存器,所述寄存器与所述控制器一一对应;所述控制器获取当前控制器的目标硬件标识的具体方式为:从所述当前控制器的寄存器中读取所述当前控制器的硬件信息;根据所述硬件信息确定所述当前控制器的所述目标硬件标识。
- 如权利要求22-24中任一项所述的电子设备,其特征在于,所述控制器调用所述收发设备接收所述控制设备发送的待升级固件的目标固件标识的具体方式为:调用所述收发设备接收所述控制设备发送的待升级固件的升级文件;从所述升级文件的预设区域中解析出所述目标固件标识。
- 如权利要求25所述的电子设备,其特征在于,所述升级文件中包括升级数据,所述控制器获取所述待升级固件所需的升级数据的具体方式为:如果所述目标固件标识与所述目标硬件标识相匹配,从所述升级文件中提取升级数据,其中,提取的所述升级数据为所述待升级固件所需的升级数据。
- 如权利要求22-25中任一项所述的电子设备,其特征在于,所述处理器还用于执行:如果所述目标固件标识与所述目标硬件标识不匹配,则调用所述收发设备向所述控制设备发送错误指示消息。
- 如权利要求27中任一项所述的电子设备,其特征在于,所述错误指示消息中携带有所述目标固件标识。
- 如权利要求28中任一项所述的电子设备,其特征在于,所述控制器获取所述待升级固件所需的升级数据的具体方式为:调用所述收发设备接收所述控制设备发送的升级数据,所述升级数据为所述待升级固件所需的升级数据,且所述升级数据是所述控制设备在预设时间内未接收到所述错误指示消息时发送的。
- 如权利要求22-25中任一项所述的电子设备,其特征在于,所述处理器还用于执行:如果所述目标固件标识与所述目标硬件标识相匹配,则调用所述收发设备向所述控制设备发送确认指示消息。
- 如权利要求30所述的电子设备,其特征在于,所述确认指示消息中携带有所述目标固件标识。
- 如权利要求30所述的电子设备,其特征在于,所述控制器获取所述待 升级固件所需的升级数据的具体方式为:调用所述收发设备接收所述控制设备响应所述确认指示消息发送的升级数据,所述升级数据为所述待升级固件所需的升级数据。
- 如权利要求22-32中任一项所述的电子设备,其特征在于,所述电子设备为云台,所述云台搭载于飞行器上。
- 一种控制设备,其特征在于,包括存储器、收发设备和处理器:所述存储器,用于存储程序指令;所述处理器,调用所述存储器中的程序指令执行以下步骤:调用所述收发设备向电子设备发送固件升级命令;调用所述收发设备向所述电子设备发送待升级固件的目标固件标识;判断在预设时间内是否接收到所述电子设备发送的错误指示消息;如果没有接收到所述错误指示消息,则调用所述收发设备向所述电子设备发送所述待升级固件所需的升级数据。
- 如权利要求34所述的控制设备,其特征在于,所述处理器调用所述收发设备向所述电子设备发送待升级固件的目标固件标识的具体方式为:调用所述收发设备向所述电子设备发送待升级固件的升级文件,所述升级文件的预设区域中携带有所述目标固件标识。
- 如权利要求34或者35所述的控制设备,其特征在于,所述处理器还用于执行:如果在所述预设时间内接收到所述错误指示消息,则调用所述收发设备禁止向所述电子设备发送所述待升级固件所需的升级数据。
- 如权利要求36所述的控制设备,其特征在于,所述错误指示消息中携带有所述目标固件标识。
- 如权利要求34或35所述的控制设备,其特征在于,所述处理器还用于执行:判断在所述预设时间内是否接收到所述电子设备发送的确认指示消息;如果接收到所述确认指示消息,则调用所述收发设备向所述电子设备发送待升级固件所需的升级数据。
- 如权利要求38所述的控制设备,其特征在于,所述确认指示消息中携带有所述目标固件标识。
- 如权利要求34-39中任一项所述的控制设备,其特征在于,所述电子设备为云台,所述云台搭载于飞行器上。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/073500 WO2019140656A1 (zh) | 2018-01-19 | 2018-01-19 | 一种固件升级方法、装置、电子设备及控制设备 |
CN201880010765.XA CN110268386A (zh) | 2018-01-19 | 2018-01-19 | 一种固件升级方法、装置、电子设备及控制设备 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/073500 WO2019140656A1 (zh) | 2018-01-19 | 2018-01-19 | 一种固件升级方法、装置、电子设备及控制设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019140656A1 true WO2019140656A1 (zh) | 2019-07-25 |
Family
ID=67301891
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/073500 WO2019140656A1 (zh) | 2018-01-19 | 2018-01-19 | 一种固件升级方法、装置、电子设备及控制设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110268386A (zh) |
WO (1) | WO2019140656A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110750285A (zh) * | 2019-10-17 | 2020-02-04 | 和美(深圳)信息技术股份有限公司 | 固件升级方法、装置、计算机设备和存储介质 |
CN110764811A (zh) * | 2019-09-05 | 2020-02-07 | 深圳优地科技有限公司 | 一种固件升级的方法及装置 |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111273930A (zh) * | 2020-01-21 | 2020-06-12 | 深圳市雷赛软件技术有限公司 | 固件升级控制方法、上位机及固件升级*** |
CN111475186A (zh) * | 2020-03-13 | 2020-07-31 | 苏州浪潮智能科技有限公司 | 一种基于bmc的固件升级方法、装置、设备及介质 |
CN113944991A (zh) * | 2020-07-17 | 2022-01-18 | 海信(山东)空调有限公司 | 一种空调器及固件升级方法 |
CN113242145A (zh) * | 2021-04-30 | 2021-08-10 | 合肥移瑞通信技术有限公司 | 无线设备、固件升级方法、固件服务器及可读存储介质 |
CN113721953B (zh) * | 2021-08-11 | 2024-06-04 | 西安诺瓦星云科技股份有限公司 | 固件程序升级方法、装置及显示控制设备 |
CN113778496A (zh) * | 2021-09-16 | 2021-12-10 | 联想(北京)有限公司 | 固件升级方法、装置及电子设备和存储介质 |
CN117075958B (zh) * | 2023-10-16 | 2024-01-23 | 广东优力普物联科技有限公司 | 一种适应多机型的固件生成方法、存储介质及电子设备 |
CN117850565B (zh) * | 2024-03-08 | 2024-06-11 | 闪极科技(深圳)有限公司 | 电源设备、固件升级方法和可读存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104202471A (zh) * | 2014-08-22 | 2014-12-10 | 惠州Tcl移动通信有限公司 | 基于移动终端的固件升级处理方法、***及移动终端 |
CN105100021A (zh) * | 2014-05-20 | 2015-11-25 | 西安中兴新软件有限责任公司 | 一种设备管理会话的触发方法、设备及*** |
US20160246649A1 (en) * | 2015-02-24 | 2016-08-25 | Red Hat Israel, Ltd. | Dynamic Guest Virtual Machine Identifier Allocation |
CN107168750A (zh) * | 2017-06-08 | 2017-09-15 | 郑州云海信息技术有限公司 | 一种固件升级保护方法及*** |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102868945B (zh) * | 2012-10-15 | 2016-03-02 | 上海斐讯数据通信技术有限公司 | 一种epon中onu的升级方法 |
CN106815050B (zh) * | 2016-12-30 | 2020-06-09 | 深圳怡化电脑股份有限公司 | 一种嵌入式设备的固件管理方法及装置 |
CN107066300B (zh) * | 2017-04-21 | 2021-08-24 | 杭州宏杉科技股份有限公司 | 一种存储设备的固件升级方法和存储设备 |
-
2018
- 2018-01-19 CN CN201880010765.XA patent/CN110268386A/zh active Pending
- 2018-01-19 WO PCT/CN2018/073500 patent/WO2019140656A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105100021A (zh) * | 2014-05-20 | 2015-11-25 | 西安中兴新软件有限责任公司 | 一种设备管理会话的触发方法、设备及*** |
CN104202471A (zh) * | 2014-08-22 | 2014-12-10 | 惠州Tcl移动通信有限公司 | 基于移动终端的固件升级处理方法、***及移动终端 |
US20160246649A1 (en) * | 2015-02-24 | 2016-08-25 | Red Hat Israel, Ltd. | Dynamic Guest Virtual Machine Identifier Allocation |
CN107168750A (zh) * | 2017-06-08 | 2017-09-15 | 郑州云海信息技术有限公司 | 一种固件升级保护方法及*** |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764811A (zh) * | 2019-09-05 | 2020-02-07 | 深圳优地科技有限公司 | 一种固件升级的方法及装置 |
CN110750285A (zh) * | 2019-10-17 | 2020-02-04 | 和美(深圳)信息技术股份有限公司 | 固件升级方法、装置、计算机设备和存储介质 |
CN110750285B (zh) * | 2019-10-17 | 2023-08-04 | 和美(深圳)信息技术股份有限公司 | 固件升级方法、装置、计算机设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN110268386A (zh) | 2019-09-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019140656A1 (zh) | 一种固件升级方法、装置、电子设备及控制设备 | |
CN108196878B (zh) | 应用程序安装包的生成方法、装置、电子设备及存储介质 | |
US9983790B2 (en) | System management controller and method of configuration file backup and recovery | |
WO2019076037A1 (zh) | 升级固件的方法和装置 | |
CN109358882B (zh) | 一种电视终端进行固件升级的方法及装置 | |
WO2016206514A1 (zh) | 启动处理方法及装置 | |
WO2018032757A1 (zh) | 组件升级的方法及装置 | |
WO2021136200A1 (zh) | 引导程序的加载方法、存储介质及嵌入式终端 | |
WO2015154538A1 (zh) | 存储器的启动方法及装置 | |
WO2015074435A1 (zh) | 移动终端固件更新方法及装置 | |
CN116932010B (zh) | ***固件升级方法、装置及服务器 | |
KR20150079837A (ko) | 시스템 업그레이드 방법, 장치, 기기, 프로그램 및 기록매체 | |
CN109002305B (zh) | 一种设备程序的更新方法及其*** | |
CN111752577B (zh) | 一种***版本的升级方法及设备 | |
CN111966380A (zh) | 一种bmc固件升级方法、***、终端及存储介质 | |
CN105045671A (zh) | 一种智能终端的***升级方法及装置 | |
CN106919423B (zh) | 一种固件升级方法及装置 | |
WO2024041283A1 (zh) | 一种客户端升级方法、装置、终端设备及存储介质 | |
JP2013513874A (ja) | データカードのアップグレーディング方法およびデバイス | |
WO2017121077A1 (zh) | 一种双引导文件的切换方法及装置 | |
CN106484442B (zh) | 服务器***及更新开机映像档的方法 | |
CN113360161A (zh) | 资源升级方法及相关产品 | |
CN105426304A (zh) | 一种重启测试的控制方法及装置 | |
CN101727333A (zh) | 微处理器中固件更新的方法及固件更新*** | |
CN115220978B (zh) | 包括在线调试模式的芯片启动方法和装置、芯片和设备 |
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: 18900775 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18900775 Country of ref document: EP Kind code of ref document: A1 |