WO2016095452A1 - 固件刷新方法及装置 - Google Patents

固件刷新方法及装置 Download PDF

Info

Publication number
WO2016095452A1
WO2016095452A1 PCT/CN2015/080806 CN2015080806W WO2016095452A1 WO 2016095452 A1 WO2016095452 A1 WO 2016095452A1 CN 2015080806 W CN2015080806 W CN 2015080806W WO 2016095452 A1 WO2016095452 A1 WO 2016095452A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
electronic device
access device
storage area
information
Prior art date
Application number
PCT/CN2015/080806
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 JP2016564376A priority Critical patent/JP6190978B2/ja
Priority to RU2015129670A priority patent/RU2630371C2/ru
Priority to MX2015010388A priority patent/MX369881B/es
Priority to BR112015019779A priority patent/BR112015019779A2/pt
Priority to KR1020157020627A priority patent/KR20160086754A/ko
Priority to US15/082,617 priority patent/US10613848B2/en
Publication of WO2016095452A1 publication Critical patent/WO2016095452A1/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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present disclosure relates to the field of smart devices, and in particular, to a firmware refresh method and apparatus.
  • the firmware needs to be refreshed using a dedicated brush tool.
  • the dedicated brush tool is usually connected to the electronic device, and the electronic device reads the firmware in the special brush tool by running a driver corresponding to the professional brush tool to implement refreshing of the original firmware.
  • the disclosed person finds that the above method has at least the following defects: when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, resulting in failure of the firmware refresh.
  • the embodiment of the present disclosure provides a firmware refreshing method and device.
  • the technical solutions are as follows:
  • a firmware refresh method comprising:
  • the access device is detected as a drive-free device, the updated firmware in the access device is written into the electronic device;
  • the update firmware written in the electronic device is run when the electronic device is in a normal operating phase after the restart.
  • the detecting whether the access device connected to the electronic device before the startup phase is a non-distribution device comprises:
  • the device type information indicates that the device type of the access device is a drive-free type, determining that the access device is the drive-free device.
  • the writing the update firmware in the access device to the electronic device includes:
  • the updated firmware stored in the storage address is written into the firmware storage area.
  • the obtaining, by the access device, the storage address of the updated firmware including:
  • Reading information in a specific sector of the access device
  • the access device does not adopt a specific file system, determining, according to meta information carried in the information in the specific sector, a storage address of the updated firmware, where the meta information includes a starting address of the updated firmware And the length of the data.
  • the writing the updated firmware stored in the storage address into the firmware storage area includes:
  • the access device includes one of the firmware storage areas, replacing the updated firmware with the original firmware stored in the firmware storage area;
  • the update firmware is written into a firmware storage area disposed as an inactive area, and the firmware storage area set as an inactive area is used for A firmware that does not run the electronic device is stored.
  • the method further includes:
  • the firmware storage area originally set as the active area is set as the inactive area, and the update firmware is correctly written.
  • the firmware storage area is set as an active area, and the firmware storage area set as an active area is used to store firmware that is running when the electronic device is in a normal operation phase.
  • a firmware refreshing apparatus comprising:
  • the device detecting module is configured to detect, when the electronic device is in a startup phase, whether the access device connected to the electronic device before the startup phase is a non-disable device;
  • a firmware writing module configured to: when the device detecting module detects that the access device is a non-distribution device, write update firmware in the access device into the electronic device;
  • a firmware operation module configured to run the firmware write module to write the update firmware in the electronic device when the electronic device is in a normal operation phase after the restart.
  • the device detection module includes:
  • a first information obtaining submodule configured to acquire interface descriptor information of the access device connected to the electronic device before the startup phase
  • a second information acquiring submodule configured to be the interface descriptor letter acquired by the first information acquiring submodule Obtaining device type information of the access device when the access device is a large-capacity storage device;
  • a device determining sub-module configured to determine, when the device type information acquired by the second information acquiring sub-module indicates that the device type of the access device is a drive-free type, determining that the access device is the drive-free device.
  • the firmware writing module includes:
  • An address obtaining submodule configured to acquire a storage address of the updated firmware from the access device
  • a region determining submodule configured to determine a firmware storage area in the electronic device
  • a firmware writing submodule configured to write the updated firmware stored in the storage address acquired by the address obtaining submodule into the firmware storage area determined by the area determining submodule.
  • the address obtaining submodule includes:
  • a sector information reading submodule configured to read information in a particular sector of the access device
  • the system determining submodule is configured to determine, according to the information in the specific sector acquired by the sector information reading submodule, whether the access device adopts a specific file system;
  • a first determining submodule configured to: when the system determining submodule determines that the access device adopts a specific file system, determine a predetermined storage address as a storage address of the updated firmware;
  • a second determining submodule configured to: when the system determining submodule determines that the access device does not adopt a specific file system, determine, according to meta information carried in the information in the specific sector, storage of the updated firmware An address, the meta information including a start address and a data length of the update firmware.
  • firmware writing submodule includes:
  • a first write submodule configured to replace the updated firmware in the firmware storage area with the original firmware stored in the firmware storage area when the access device includes one of the firmware storage areas;
  • a second write submodule configured to write the update firmware into a firmware storage area in which the inactive area is set when the access device includes at least two of the firmware storage areas, where A firmware storage area that is an inactive area is used to store firmware that the electronic device is not running.
  • the device further includes:
  • firmware detecting module configured to detect whether the updated firmware is correctly written into the firmware storage area set as an inactive area
  • a regional setting module configured to: when the firmware detecting module detects that the updated firmware has been correctly written into the firmware storage area set as the inactive area, set the firmware storage area originally set to the active area as The inactive area, the firmware storage area that is correctly written into the update firmware is set as an active area, and the firmware storage area set as an active area is used to store firmware that is running when the electronic device is in a normal operation phase.
  • a firmware refreshing apparatus comprising:
  • a memory for storing executable instructions of the processor
  • processor is configured to:
  • the access device is detected as a drive-free device, the updated firmware in the access device is written into the electronic device;
  • the update firmware written in the electronic device is run when the electronic device is in a normal operating phase after the restart.
  • the electronic device When the electronic device is in the startup phase, it is detected whether the access device connected to the electronic device before the startup phase is a non-drive device; if the access device is detected as a non-discharge device, the update firmware in the access device is written In the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, the firmware refresh of the electronic device can also be completed through the drive-free device.
  • the firmware in the professional brush tool cannot be read, which causes the firmware to fail to refresh; the simplified firmware refresh process is achieved, and the firmware refresh success rate is improved.
  • FIG. 1 is a flowchart of a method of a firmware refreshing method provided by an exemplary embodiment of the present invention
  • FIG. 2 is a flowchart of a method for a firmware refresh method according to another exemplary embodiment of the present invention
  • FIG. 3 is a structural block diagram of a firmware refresh apparatus according to an exemplary embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a firmware refresh apparatus according to an exemplary embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a firmware refresh apparatus according to an exemplary embodiment of the present invention.
  • the firmware refreshing method provided by the various embodiments of the present invention may be implemented by an electronic device having a firmware refresh function.
  • the electronic device can be a smart phone, a smart TV, a tablet, an e-book reader, an MP3 player (Moving) Picture Experts Group Audio Layer III, motion picture experts compress standard audio level 3) and MP4 (Moving Picture Experts Group Audio Layer IV), and so on.
  • firmware refresh method is applied to the electronic device for exemplification, but it is not limited thereto.
  • FIG. 1 is a flowchart of a method for a firmware refreshing method, which may be applied to an electronic device, including the following steps, according to an exemplary embodiment.
  • step 101 when the electronic device is in the startup phase, it is detected whether the access device connected to the electronic device before the startup phase is a non-drive device.
  • step 102 if it is detected that the access device is a drive-free device, the update firmware in the access device is written into the electronic device.
  • step 103 the update firmware written in the electronic device is run while the electronic device is in the normal operating phase after the restart.
  • detecting whether the access device connected to the electronic device before the startup phase is a non-distribution device includes: acquiring interface descriptor information of the access device connected to the electronic device before the startup phase;
  • the device type information indicates that the device type of the access device is a drive-free type
  • the update firmware in the access device is written into the electronic device, including:
  • the updated firmware stored in the storage address is written to the firmware storage area.
  • the storage address of the updated firmware is obtained from the access device, including:
  • the storage address of the updated firmware is determined according to the meta information carried in the information in the specific sector, and the meta information includes the start address and the data length of the updated firmware.
  • the updated firmware stored in the storage address is written into the firmware storage area, including:
  • the firmware is replaced with the original firmware stored in the firmware storage area
  • the update firmware is written into the firmware storage area in which the inactive area is set, and the firmware storage area set as the inactive area is used to store firmware that the electronic device does not run.
  • the method further includes: detecting whether the updated firmware is correctly written into the firmware storage area of the inactive area; if it is detected that the updated firmware has been correctly written into the firmware storage area of the inactive area, the original The firmware storage area set as the active area is set as the inactive area, and the firmware storage area correctly written to the updated firmware is set as the active area, and the firmware storage area set as the active area is used to store the electronic device running during the normal operation phase. firmware.
  • the firmware refreshing method detects whether the access device connected to the electronic device before the startup phase is a non-disable device when the electronic device is in the startup phase; When the device is driven, the update firmware in the access device is written into the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, It is also possible to complete the firmware refresh of the electronic device through the drive-free device, and solve the problem that when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, which causes the firmware to fail to be refreshed; the simplified firmware refresh is achieved. Process to improve the firmware refresh rate.
  • FIG. 2 is a flowchart of a method for a firmware refreshing method, which may be applied to an electronic device, including the following steps, according to another exemplary embodiment.
  • step 201 when the electronic device is in the startup phase, it is detected whether the access device connected to the electronic device before the startup phase is a non-drive device.
  • the access device When the electronic device is not activated, the access device is connected to the electronic device through an external interface provided by the electronic device, and the external interface may be a USB (Universal Serial Bus) interface on the electronic device.
  • the USB interface When the USB interface is not provided on the electronic device, the electronic device can also be connected to the access device through a dedicated connection cable.
  • a USB interface is not provided in an electronic device such as a smart phone, and the smart phone can be connected to the access device through a dedicated connection cable.
  • the electronic device After the electronic device is connected to the access device, the electronic device is activated. During the startup phase, the electronic device detects whether the access device is connected. When it detects that the access device is connected, the electronic device detects whether the access device is a non-disable device. The device that the driver can run. The detecting, by the electronic device, whether the access device is a free drive device may include the following substeps:
  • the electronic device acquires interface descriptor information of an access device connected to the electronic device prior to the startup phase.
  • the interface descriptor information of the access device is used to identify the function of the access device, and the electronic device determines which driver needs to be loaded to drive the access device by acquiring the interface descriptor information.
  • the interface descriptor information includes the base class type of the interface, the subclass type of the interface, and the interface protocol.
  • the electronic device obtains the base class type of the interface in the interface descriptor information, the subclass type of the interface, and the interface through the interface enumeration. Agreement information.
  • the electronic device obtains the base class type of the interface of the access device as USB_CLASS_MASS_STORAGE through the interface enumeration, the subclass type of the interface is USB_SCSI, and the interface protocol is USB_PR_BULK.
  • the electronic device acquires device type information of the access device.
  • the electronic device identifies the interface descriptor information obtained during the interface enumeration process, and when the interface descriptor information When the access device is instructed to be a large-capacity storage device, the electronic device further obtains device type information of the access device, and the device type information may be obtained by the electronic device transmitting a SCSI (Small Computer System Interface) acquisition command. .
  • SCSI Small Computer System Interface
  • the interface descriptor information obtained by the electronic device is that the base class type of the interface is USB_CLASS_MASS_STORAGE, the subclass type of the interface is USB_SCSI, and the interface protocol is USB_PR_BULK, so that the access device is determined to be a large-capacity storage device, and the electronic device The device sends a SCSI acquisition command and determines the obtained return value as the device type information of the device.
  • the electronic device determines that the access device is a drive-free device.
  • the correspondence between the return value and the device type may be preset. For example, after the SCSI acquisition command is sent by the electronic device, the received return value is 0x00. According to the return value and the corresponding relationship, the electronic device can determine that the access device is a U disk, and belongs to the non-drive type, and the access device can be determined. To avoid drive equipment.
  • step 202 the storage address of the updated firmware is obtained from the access device.
  • the electronic device can read the updated firmware stored in the access device without using a specific driver.
  • the storage address of the corresponding update firmware is different because the type of the file system used by the access device is different, so the electronic device needs to determine the storage address of the updated firmware according to the file system type of the access device.
  • the electronic device reads information in a particular sector of the access device.
  • the storage format of information in a specific sector corresponding to different file systems is different, so the electronic device can determine the file system of the access device by reading information in a specific sector of the access device. It should be noted that the electronic device usually reads the information in the first sector of the access device.
  • the electronic device determines whether the access device adopts a specific file system according to information in a specific sector.
  • the electronic device determines the file system type adopted by the access device according to the information in the read specific sector, the electronic device stores in advance a correspondence table between the information in the specific sector and the file system type, and the electronic device according to the electronic device The information in the specific sector that is read finds the corresponding file system type. When the corresponding file system type can be found, it can be determined that the access device adopts a specific file system.
  • the table structure of the correspondence table between the information in a specific sector and the file system type may be as shown in Table 1:
  • the electronic device determines the predetermined storage address as the storage address of the updated firmware.
  • the electronic device After the electronic device determines the file system according to the information in the specific sector, the electronic device can determine the update according to the file system.
  • the storage address of the firmware The correspondence between the file system and the storage address of the updated firmware can be as shown in Table 2:
  • File system Update firmware storage address A file system Storage address A B file system Storage address B C file system Storage address C
  • the predetermined storage address may be a storage path in the access device.
  • the predetermined storage address may be “H: ⁇ firmware”, indicating that the storage address of the updated firmware is a firmware folder in the root directory of the H drive.
  • the storage addresses of the updated firmware corresponding to the different file systems may be the same or different.
  • the present embodiment only exemplifies the storage addresses of the updated firmware corresponding to different file systems, and does not limit the present invention.
  • the electronic device determines, according to the meta information carried in the information in the specific sector, the storage address of the updated firmware, where the meta information includes the starting address and the data length of the updated firmware.
  • the electronic device determines that the access device does not adopt the specific File system.
  • the electronic device may obtain the start address and the data length of the updated firmware included in the meta information according to the meta information included in the information in the specific sector, and determine the storage address of the updated firmware.
  • step 203 a firmware storage area in the electronic device is determined.
  • the electronic device can read the meta information of the internal flash memory and determine the firmware storage address where the updated firmware is stored.
  • the firmware storage area is used to store firmware.
  • the firmware storage area When there is a firmware storage area in the electronic device, the firmware storage area is used to store firmware running when the electronic device is in a normal operation phase; when there are at least two firmware storage areas in the electronic device, one of the firmware storage areas is set to The active area, the firmware storage area set as the active area is used to store firmware running when the electronic device is in a normal operation phase, and the remaining firmware storage areas are all set as inactive areas, and the firmware storage area set as the inactive area is used. The firmware that the storage electronics does not run.
  • the electronic device can read the meta information of the internal flash memory, determine the only firmware storage area in the electronic device as the firmware storage area for storing the updated firmware, or determine the firmware storage area in the electronic device as the inactive area as the storage. Update the firmware storage area of the firmware.
  • step 202 There is no strict sequence relationship between step 202 and step 203. This embodiment is only described by step 202 before step 203, and does not limit the present invention.
  • step 204 the updated firmware stored in the storage address is written into the firmware storage area.
  • the present embodiment describes the writing process of the updated firmware by taking the two firmware storage areas determined above as an example.
  • the electronic device replaces the original firmware stored in the firmware storage area with the updated firmware.
  • the electronic device When there is only one firmware storage area in the electronic device, the electronic device reads the update firmware in the access device and writes the update firmware to the firmware storage area storage to replace the original firmware stored in the firmware storage area.
  • the electronic device also needs to detect whether the updated firmware is correctly written into the firmware storage area.
  • the electronic device detects whether the updated firmware is correctly written according to a check value stored at a predetermined location, and the check value may be stored at the head or the tail of the updated firmware.
  • the electronic device obtains the check value from the head of the updated firmware, and uses the check value to perform a CRC (Cyclic Redundancy Check) check on the written update firmware, and determines according to the check result.
  • CRC Cyclic Redundancy Check
  • the electronic device After the update firmware in the access device is written into the firmware storage area, the electronic device sends a prompt message for reminding the user that the firmware is written, prompting the user to disconnect the access device, and restarting the electronic device.
  • the prompt information may be voice or text information.
  • the electronic device when there are at least two firmware storage areas in the electronic device, the electronic device writes the update firmware into a firmware storage area that is set as an inactive area, and the firmware storage area that is set as the inactive area is used to store the electronic device. Firmware that is not running.
  • firmware storage areas in the electronic device there are two firmware storage areas in the electronic device, one of which is a firmware storage area that is set as an active area, and the other is a firmware storage area that is set as an inactive area, and the electronic device writes the updated firmware stored in the access device. This is placed in the firmware storage area of the inactive area.
  • firmware update method provided in this embodiment further includes:
  • the firmware storage area originally set as the active area is set as the inactive area, and the firmware storage area of the updated firmware is correctly written.
  • the firmware storage area set as the active area is used to store the firmware running when the electronic device is in the normal running phase.
  • the electronic device detects whether the updated firmware is correctly written according to the check value stored at the predetermined location, and the check value may be stored at the head or the tail of the updated firmware. For example, the electronic device obtains the check value from the head of the updated firmware, and uses the check value to perform a CRC check on the written update firmware, and determines whether the updated firmware is correctly written into the firmware storage area according to the check result.
  • the electronic device determines that the update firmware can be correctly operated, and the electronic device sets the inactive area as an active area. In order to ensure that only one active area exists in the electronic device, the electronic device also needs to set the original active area as an inactive area. After the setting is completed, the electronic device will issue a prompt message, which is used to remind the user to update the firmware writing, prompt the user to disconnect the access device, and restart the electronic device.
  • the electronic device may retain the firmware in the inactive area, and may also delete or replace the firmware, which is not limited by the present invention.
  • step 205 the update firmware written in the electronic device is run while the electronic device is in the normal operating phase after the reboot.
  • the electronic device When the electronic device is in the startup phase, it will detect whether an access device is connected to the electronic device. When no access device is detected to be connected to the electronic device, the electronic device enters a normal operation phase and is written into the firmware storage area. The firmware is updated to implement firmware update; when it is detected that an access device is connected to the electronic device, the electronic device performs steps 201 to 204.
  • the firmware refreshing method detects whether the access device connected to the electronic device before the startup phase is a non-disable device when the electronic device is in the startup phase; Driving the device, the update firmware in the access device is written into the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, It is also possible to complete the firmware refresh of the electronic device through the drive-free device, and solve the problem that when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, which causes the firmware to fail to be refreshed; the simplified firmware refresh is achieved. Process to improve the firmware refresh rate.
  • the access device adopts a specific file system is detected by the electronic device, when the specific file system is adopted, the updated firmware is obtained from the predetermined storage location, and when the specific file system is not used, the element carried according to the information in the specific sector is used.
  • the information acquisition update firmware enables the electronic device to read the updated firmware from different file systems, which improves the success rate of the firmware refresh and expands the use range of the firmware refresh.
  • the firmware storage area is set As the active area, the inactive area is set as the active area when it is detected that the updated firmware is correctly written, and the normal operation of the written update firmware is guaranteed.
  • FIG. 3 is a block diagram showing the structure of a firmware refresh apparatus according to an exemplary embodiment.
  • the firmware refresh device can be implemented as all or part of the electronic device by software, hardware or a combination of both.
  • the firmware refreshing device includes: a device detecting module 320, a firmware writing module 340, and a firmware running module 360.
  • the device detecting module 320 is configured to detect, when the electronic device is in the startup phase, whether the access device connected to the electronic device before the startup phase is a non-disable device;
  • the firmware writing module 340 is configured to write the updated firmware in the access device to the electronic device when the device detecting module 320 detects that the access device is a drive-free device;
  • the firmware execution module 360 is configured to run the firmware write module 340 to write updated firmware in the electronic device while the electronic device is in a normal operating phase after the reboot.
  • the firmware refreshing apparatus detects whether the access device connected to the electronic device before the startup phase is a non-disable device when the electronic device is in the startup phase; Driving the device, the update firmware in the access device is written into the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, It is also possible to complete the firmware refresh of the electronic device through the drive-free device, and solve the problem that when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, which causes the firmware to fail to be refreshed; the simplified firmware refresh is achieved. Process High firmware refresh success rate effect.
  • FIG. 4 is a block diagram showing the structure of a firmware refresh apparatus according to another exemplary embodiment.
  • the firmware refresh device can be implemented as all or part of the electronic device by software, hardware or a combination of both.
  • the firmware refreshing device includes: a device detecting module 420, a firmware writing module 440, and a firmware running module 460.
  • the device detecting module 420 is configured to detect, when the electronic device is in the startup phase, whether the access device connected to the electronic device before the startup phase is a non-disable device;
  • the firmware writing module 440 is configured to write the updated firmware in the access device to the electronic device when the device detecting module 420 detects that the access device is a free drive device;
  • the firmware execution module 460 is configured to run the firmware write module 440 to write updated firmware in the electronic device while the electronic device is in a normal operating phase after the reboot.
  • the device detection module 420 includes: a first information acquisition submodule 421, a second information acquisition submodule 422, and a device determination submodule 423.
  • the first information obtaining submodule 421 is configured to acquire interface descriptor information of an access device connected to the electronic device before the startup phase;
  • the second information acquisition sub-module 422 is configured to acquire device type information of the access device when the interface descriptor information acquired by the first information acquisition sub-module 421 indicates that the access device is a mass storage device;
  • the device determining sub-module 423 is configured to determine that the access device is a drive-free device when the device type information acquired by the second information acquisition sub-module 422 indicates that the device type of the access device is a drive-free type.
  • the firmware writing module 440 includes: an address obtaining submodule 441, an area determining submodule 442, and a firmware writing submodule 443.
  • the address obtaining submodule 441 is configured to obtain a storage address of the updated firmware from the access device
  • the area determining sub-module 442 is configured to determine a firmware storage area in the electronic device
  • the firmware write sub-module 443 is configured to write the updated firmware written in the storage address acquired by the address acquisition sub-module 441 into the firmware storage area determined by the sub-module 442 determined by the sub-module 442.
  • the address obtaining submodule 441 includes: a sector information reading submodule 441a, a system determining submodule 441b, a first determining submodule 441c, and a second determining submodule 441d.
  • the sector information reading submodule 441a is configured to read information in a specific sector of the access device
  • the system determining sub-module 441b is configured to determine, according to the information in the specific sector acquired by the sector information reading sub-module 441a, whether the access device adopts a specific file system;
  • the first determining submodule 441c is configured to determine, when the system determining submodule 441b determines that the access device adopts the specific file system, the predetermined storage address as the storage address of the updated firmware;
  • the second determining sub-module 441d is configured to determine, when the system determining sub-module 441b determines that the access device does not adopt the specific file system, the storage address of the updated firmware according to the meta-information carried in the information in the specific sector, the meta-information This includes the starting address and data length of the updated firmware.
  • the firmware writing submodule 443 includes: a first writing submodule 443a and a second writing submodule 443b.
  • the first writing sub-module 443a is configured to replace the original firmware stored in the firmware storage area with the updated firmware when the access device includes a firmware storage area;
  • the second write submodule 443b is configured to write the update firmware into the firmware storage area set as the inactive area and set the firmware of the inactive area when the access device includes at least two firmware storage areas.
  • the storage area is used to store firmware that the electronic device is not running.
  • the device further includes: a firmware detection module and a regional setting module.
  • the firmware detecting module 470 is configured to detect whether the updated firmware is correctly written into the firmware storage area set as the inactive area;
  • the area setting module 480 is configured to set the firmware storage area originally set as the active area as an inactive area when the firmware detecting module detects 470 that the updated firmware has been correctly written into the firmware storage area of the inactive area.
  • the firmware storage area correctly written to the updated firmware is set as the active area, and the firmware storage area set as the active area is used to store the firmware running when the electronic device is in the normal running phase.
  • the firmware refreshing apparatus detects whether the access device connected to the electronic device before the startup phase is a non-disable device when the electronic device is in the startup phase; Driving the device, the update firmware in the access device is written into the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, It is also possible to complete the firmware refresh of the electronic device through the drive-free device, and solve the problem that when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, which causes the firmware to fail to be refreshed; the simplified firmware refresh is achieved. Process to improve the firmware refresh rate.
  • the access device adopts a specific file system is detected by the electronic device, when the specific file system is adopted, the updated firmware is obtained from the predetermined storage location, and when the specific file system is not used, the element carried according to the information in the specific sector is used.
  • the information acquisition update firmware enables the electronic device to read the updated firmware from different file systems, which improves the success rate of the firmware refresh and expands the use range of the firmware refresh.
  • the firmware storage area is set As the active area, the inactive area is set as the active area when it is detected that the updated firmware is correctly written, and the normal operation of the written update firmware is guaranteed.
  • An exemplary embodiment of the present disclosure further provides a firmware refreshing apparatus, where the firmware refreshing apparatus is applied to an electronic device of a friend firmware refresh function, including:
  • a memory for storing executable instructions of the processor
  • processor is configured to:
  • the update firmware in the access device is written into the electronic device
  • the update firmware written in the electronic device is run while the electronic device is in the normal operating phase after the restart.
  • detecting whether the access device connected to the electronic device before the startup phase is a non-distribution device includes: acquiring interface descriptor information of the access device connected to the electronic device before the startup phase;
  • the device type information indicates that the device type of the access device is a drive-free type
  • the update firmware in the access device is written into the electronic device, including:
  • the updated firmware stored in the storage address is written to the firmware storage area.
  • the storage address of the updated firmware is obtained from the access device, including:
  • the storage address of the updated firmware is determined according to the meta information carried in the information in the specific sector, and the meta information includes the start address and the data length of the updated firmware.
  • the updated firmware stored in the storage address is written into the firmware storage area, including:
  • the firmware is replaced with the original firmware stored in the firmware storage area
  • the update firmware is written into a firmware storage area in which the inactive area is set, and the firmware storage area set as the inactive area is used to store firmware that the electronic device does not run. .
  • the method further includes: detecting whether the updated firmware is correctly written into the firmware storage area of the inactive area; if it is detected that the updated firmware has been correctly written into the firmware storage area of the inactive area, the original The firmware storage area set as the active area is set as the inactive area, and the firmware storage area correctly written to the updated firmware is set as the active area, and the firmware storage area set as the active area is used to store the electronic device running during the normal operation phase. firmware.
  • the firmware refreshing apparatus detects whether the access device connected to the electronic device before the startup phase is a non-disable device when the electronic device is in the startup phase; Driving the device, the update firmware in the access device is written into the electronic device; when the electronic device is in the normal operation phase after the restart, the update firmware written in the electronic device is run; when the corresponding driver is not installed in the electronic device, It is also possible to complete the firmware refresh of the electronic device through the drive-free device, and solve the problem that when the corresponding driver is not installed in the electronic device, the firmware in the professional brush tool cannot be read, which causes the firmware to fail to be refreshed; the simplified firmware refresh is achieved. Process High firmware refresh success rate effect.
  • FIG. 5 is a schematic structural diagram of a firmware refreshing apparatus according to an exemplary embodiment.
  • device 500 can be an electronic device with a firmware refresh function.
  • apparatus 500 can include one or more of the following components: processing component 502, memory 504, power component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor component 514, And a communication component 516.
  • Processing component 502 typically controls the overall operation of device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • Processing component 502 can include one or more processors 520 to execute instructions to perform all or part of the steps of the above described methods.
  • processing component 502 can include one or more modules to facilitate interaction between component 502 and other components.
  • processing component 502 can include a multimedia module to facilitate interaction between multimedia component 508 and processing component 502.
  • Memory 504 is configured to store various types of data to support operation at device 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phone book data, messages, pictures, videos, and the like.
  • the memory 504 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM Electrically erasable programmable read only memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Disk Disk or Optical Disk.
  • Power component 506 provides power to various components of device 500.
  • Power component 506 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 500.
  • the multimedia component 508 includes a screen between the device 500 and the user that provides an output interface.
  • the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
  • the multimedia component 508 includes a front camera and/or a rear camera. When the device 500 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 510 is configured to output and/or input an audio signal.
  • audio component 510 includes a microphone (MIC) that is configured to receive an external audio signal when device 500 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
  • the received audio signal may be further stored in memory 504 or transmitted via communication component 516.
  • audio component 510 also includes a speaker for outputting an audio signal.
  • the I/O interface 512 provides an interface between the processing component 502 and the peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
  • Sensor assembly 514 includes one or more sensors for providing device 500 with various aspects of status assessment.
  • sensor assembly 514 can detect an open/closed state of device 500, a relative positioning of components, such as the display and keypad of device 500, and sensor component 514 can also detect a change in position of one component of device 500 or device 500. The presence or absence of user contact with device 500, device 500 orientation or acceleration/deceleration, and temperature variation of device 500.
  • Sensor assembly 514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 514 can also include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 516 is configured to facilitate wired or wireless communication between device 500 and other devices.
  • the device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • communication component 516 receives broadcast signals or broadcast associated information from an external broadcast management system via a broadcast channel.
  • the communication component 516 also includes a near field communication (NFC) module to facilitate short range communication.
  • NFC near field communication
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor, or other electronic component implementation for performing the above methods.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor, or other electronic component implementation for performing the above methods.
  • non-transitory computer readable storage medium comprising instructions, such as a memory 504 comprising instructions executable by processor 520 of apparatus 500 to perform the above method.
  • the non-transitory computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
  • a non-transitory computer readable storage medium that, when executed by a processor of apparatus 500, enables apparatus 500 to perform a firmware refresh method applied to an electronic device having a firmware refresh function.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)

Abstract

一种固件刷新方法及装置,属于智能设备领域。所述方法包括:在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备(101);若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中(102);在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件(103)。可解决当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题,可达到简化固件刷新过程,提高固件刷新成功率的效果。

Description

固件刷新方法及装置
本申请基于申请号为201410778909X、申请日为2014/12/15的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及智能设备领域,特别涉及一种固件刷新方法及装置。
背景技术
固件作为电子设备中最基础的软件,保证着电子设备的正常工作,但是某些外因会导致固件出现问题,影响电子设备的正常工作。
当电子设备的固件出现问题时,需要使用专用刷机工具对固件进行刷新。在更新固件时,通常是将专用刷机工具接入电子设备,电子设备通过运行与该专业刷机工具相对应的驱动程序来读取专用刷机工具中的固件,实现对原有固件的刷新。
公开人在实现本公开的过程中,发现上述方式至少存在如下缺陷:当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败。
发明内容
为了解决相关技术中当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题,本公开实施例提供了一种固件刷新方法及装置,所述技术方案如下:
根据本公开实施例的第一方面,提供一种固件刷新方法,所述方法包括:
在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备;
若检测出所述接入设备为免驱设备,则将所述接入设备中的更新固件写入所述电子设备中;
在所述电子设备处于重启之后的正常运行阶段时,运行写入所述电子设备中的所述更新固件。
可选的,所述检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备,包括:
获取在所述启动阶段之前与所述电子设备相连的所述接入设备的接口描述符信息;
当所述接口描述符信息指示所述接入设备为大容量存储设备时,获取所述接入设备的设备类型信息;
当所述设备类型信息指示所述接入设备的设备类型为免驱类型时,确定所述接入设备为所述免驱设备。
可选的,所述将所述接入设备中的更新固件写入所述电子设备中,包括:
从所述接入设备中获取所述更新固件的存储地址;
确定所述电子设备中的固件存储区域;
将所述存储地址中存储的所述更新固件写入所述固件存储区域中。
可选的,所述从所述接入设备中获取所述更新固件的存储地址,包括:
读取所述接入设备的特定扇区中的信息;
根据所述特定扇区中的信息判断所述接入设备是否采用了特定文件系统;
若判断出所述接入设备采用了特定文件系统,则将预定存储地址确定为所述更新固件的存储地址;
若判断出所述接入设备未采用特定文件系统,则根据所述特定扇区中的信息携带的元信息确定所述更新固件的存储地址,所述元信息包括所述更新固件的起始地址和数据长度。
可选的,所述将所述存储地址中存储的所述更新固件写入所述固件存储区域中,包括:
当所述接入设备中包含一个所述固件存储区域时,将所述更新固件替换所述固件存储区域中存储的原始固件;
当所述接入设备中包含至少两个所述固件存储区域时,将所述更新固件写入其中置为非活跃区的固件存储区域中,所述置为非活跃区的固件存储区域用于存储所述电子设备不运行的固件。
可选的,所述方法,还包括:
检测所述更新固件是否被正确写入所述置为非活跃区的固件存储区域中;
若检测出所述更新固件已经被正确写入所述置为非活跃区的固件存储区域中,则将原来置为活跃区的固件存储区域置为非活跃区,将正确写入所述更新固件的所述固件存储区域置为活跃区,所述置为活跃区的固件存储区域用于存储所述电子设备处于正常运行阶段时运行的固件。
根据本公开实施例的第二方面,提供一种固件刷新装置,所述装置包括:
设备检测模块,被配置为在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备;
固件写入模块,被配置为当所述设备检测模块检测出所述接入设备为免驱设备时,将所述接入设备中的更新固件写入所述电子设备中;
固件运行模块,被配置为在所述电子设备处于重启之后的正常运行阶段时,运行所述固件写入模块写入所述电子设备中的所述更新固件。
所述设备检测模块,包括:
第一信息获取子模块,被配置为获取在所述启动阶段之前与所述电子设备相连的所述接入设备的接口描述符信息;
第二信息获取子模块,被配置为当所述第一信息获取子模块获取的所述接口描述符信 息指示所述接入设备为大容量存储设备时,获取所述接入设备的设备类型信息;
设备确定子模块,被配置为当所述第二信息获取子模块获取的所述设备类型信息指示所述接入设备的设备类型为免驱类型时,确定所述接入设备为所述免驱设备。
可选的,所述固件写入模块,包括:
地址获取子模块,被配置为从所述接入设备中获取所述更新固件的存储地址;
区域确定子模块,被配置为确定所述电子设备中的固件存储区域;
固件写入子模块,被配置为将所述地址获取子模块获取到的所述存储地址中存储的所述更新固件写入所述区域确定子模块确定的所述固件存储区域中。
可选的,所述地址获取子模块,包括:
扇区信息读取子模块,被配置为读取所述接入设备的特定扇区中的信息;
系统判断子模块,被配置为根据所述扇区信息读取子模块获取的所述特定扇区中的信息判断所述接入设备是否采用了特定文件系统;
第一确定子模块,被配置为当所述系统判断子模块判断出所述接入设备采用了特定文件系统时,将预定存储地址确定为所述更新固件的存储地址;
第二确定子模块,被配置为当所述系统判断子模块判断出所述接入设备未采用特定文件系统时,根据所述特定扇区中的信息携带的元信息确定所述更新固件的存储地址,所述元信息包括所述更新固件的起始地址和数据长度。
可选的,所述固件写入子模块,包括:
第一写入子模块,被配置为当所述接入设备中包含一个所述固件存储区域时,将所述更新固件替换所述固件存储区域中存储的原始固件;
第二写入子模块,被配置为当所述接入设备中包含至少两个所述固件存储区域时,将所述更新固件写入其中置为非活跃区的固件存储区域中,所述置为非活跃区的固件存储区域用于存储所述电子设备不运行的固件。
可选的,所述装置,还包括:
固件检测模块,被配置为检测所述更新固件是否被正确写入所述置为非活跃区的固件存储区域中;
区域设置模块,被配置为当所述固件检测模块检测出所述更新固件已经被正确写入所述置为非活跃区的固件存储区域中时,将原来置为活跃区的固件存储区域置为非活跃区,将正确写入所述更新固件的所述固件存储区域置为活跃区,所述置为活跃区的固件存储区域用于存储所述电子设备处于正常运行阶段时运行的固件。
根据本公开实施例的第三方面,提供一种固件刷新装置,所述装置包括:
处理器;
用于存储所述处理器的可执行指令的存储器;
其中,所述处理器被配置为:
在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设 备是否为免驱设备;
若检测出所述接入设备为免驱设备,则将所述接入设备中的更新固件写入所述电子设备中;
在所述电子设备处于重启之后的正常运行阶段时,运行写入所述电子设备中的所述更新固件。
本公开实施例提供的技术方案可以包括以下有益效果:
通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提高固件刷新成功率的效果。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是本发明一个示例性实施例提供的固件刷新方法的方法流程图;
图2是本发明另一个示例性实施例提供的固件刷新方法的方法流程图;
图3是本发明一个示例性实施例提供的固件刷新装置的结构方框图;
图4是本发明一个示例性实施例提供的固件刷新装置的结构方框图;
图5是本发明一个示例性实施例提供的固件刷新装置的结构示意图。
通过上述附图,已示出本公开明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本公开构思的范围,而是通过参考特定实施例为本领域技术人员说明本公开的概念。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
本发明各个实施例提供的固件刷新方法,可以由具有固件刷新功能的电子设备实现。该电子设备可以是智能手机、智能电视、平板电脑、电子书阅读器、MP3播放器(Moving  Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)和MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器等等。
为了简化描述,下文中仅以固件刷新方法应用于电子设备来举例说明,但对此不构成限定。
图1是根据一示例性实施例示出的一种固件刷新方法的方法流程图,该固件刷新方法可以适用于电子设备中,包括如下步骤。
在步骤101中,在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备。
在步骤102中,若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中。
在步骤103中,在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件。
可选的,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备,包括:获取在启动阶段之前与电子设备相连的接入设备的接口描述符信息;
当接口描述符信息指示接入设备为大容量存储设备时,获取接入设备的设备类型信息;
当设备类型信息指示接入设备的设备类型为免驱类型时,确定接入设备为所述免驱设备。
可选的,将接入设备中的更新固件写入所述电子设备中,包括:
从接入设备中获取更新固件的存储地址;
确定电子设备中的固件存储区域;
将存储地址中存储的更新固件写入固件存储区域中。
可选的,从接入设备中获取所述更新固件的存储地址,包括:
读取接入设备的特定扇区中的信息;
根据特定扇区中的信息判断接入设备是否采用了特定文件系统;
若判断出接入设备采用了特定文件系统,则将预定存储地址确定为更新固件的存储地址;
若判断出接入设备未采用特定文件系统,则根据特定扇区中的信息携带的元信息确定更新固件的存储地址,元信息包括更新固件的起始地址和数据长度。
可选的,将存储地址中存储的更新固件写入固件存储区域中,包括:
当接入设备中包含一个固件存储区域时,将更新固件替换固件存储区域中存储的原始固件;
当接入设备中包含至少两个固件存储区域时,将更新固件写入其中置为非活跃区的固件存储区域中,置为非活跃区的固件存储区域用于存储电子设备不运行的固件。
可选的,还包括:检测更新固件是否被正确写入置为非活跃区的固件存储区域中;若检测出更新固件已经被正确写入置为非活跃区的固件存储区域中,则将原来置为活跃区的固件存储区域置为非活跃区,将正确写入更新固件的固件存储区域置为活跃区,该置为活跃区的固件存储区域用于存储电子设备处于正常运行阶段时运行的固件。
综上所述,本实施例提供的固件刷新方法,通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;当检测出接入设备为免驱设备时,将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提高固件刷新成功率的效果。
图2是根据另一示例性实施例示出的一种固件刷新方法的方法流程图,该固件刷新方法可以适用于电子设备中,包括如下步骤。
在步骤201中,在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备。
电子设备未启动时,接入设备通过电子设备提供的外部接口与电子设备相连,该外部接口可以是电子设备上的USB(Universal Serial Bus,通用串行总线)接口。当电子设备上没有提供USB接口时,电子设备也可以通过专用连接线与接入设备进行连接。比如,智能手机一类的电子设备中没有提供USB接口,智能手机可以通过专用连接线与接入设备进行连接。
电子设备与接入设备相连后,启动该电子设备。在启动阶段,电子设备会检测是否连接了接入设备,当检测到连接了接入设备时,电子设备会对该接入设备是否是免驱设备进行检测,免驱设备是指不需要特定的驱动程序即可运行的设备。其中,电子设备检测接入设备是否是免驱设备可以包括如下子步骤:
一、电子设备获取在启动阶段之前与电子设备相连的接入设备的接口描述符信息。
接入设备的接口描述符信息用于标识接入设备的功能,电子设备通过获取该接口描述符信息来确定需要加载何种驱动程序来驱动该接入设备。该接口描述符信息包含接口的基类类型、接口的子类类型和接口协议,电子设备通过接口枚举,分别获取该接口描述符信息中的接口的基类类型、接口的子类类型和接口协议信息。比如,电子设备通过接口枚举,获取到该接入设备的接口的基类类型为USB_CLASS_MASS_STORAGE,接口的子类类型为USB_SCSI,接口协议为USB_PR_BULK。
二、当接口描述符信息指示接入设备为大容量存储设备时,电子设备获取接入设备的设备类型信息。
电子设备对接口枚举过程中获取到的接口描述符信息进行识别,当该接口描述符信息 指示该接入设备为大容量存储设备时,电子设备将进一步获取该接入设备的设备类型信息,该设备类型信息可以由电子设备发送SCSI(Small Computer System Interface,小型计算机系统接口)获取指令获得。
比如,电子设备获取到接入设备的接口描述符信息为接口的基类类型为USB_CLASS_MASS_STORAGE,接口的子类类型为USB_SCSI,接口协议为USB_PR_BULK,即可确定该接入设备为大容量存储设备,电子设备发送SCSI获取指令,并将获取到的返回值确定为该设备的设备类型信息。
三、当设备类型信息指示接入设备的设备类型为免驱类型时,电子设备确定接入设备为免驱设备。
其中,可以预先设置返回值与设备类型的对应关系。比如,电子设备发送SCSI获取指令后,收到的返回值为0x00,根据该返回值和对应关系,电子设备可以确定该接入设备为U盘,属于免驱类型,即可确定该接入设备为免驱设备。
在步骤202中,从接入设备中获取更新固件的存储地址。
由于确定了该接入设备为免驱设备,电子设备不需要使用特定的驱动即可读取该接入设备中存储的更新固件。在读取更新固件时,由于接入设备采用的文件系统类型的不同,对应的更新固件的存储地址也不相同,所以电子设备需要根据接入设备的文件系统类型确定该更新固件的存储地址。该步骤可以包括如下子步骤:
一、电子设备读取接入设备的特定扇区中的信息。
不同的文件系统对应的特定扇区中的信息的存储格式不同,所以电子设备可以通过读取接入设备的特定扇区中的信息来确定接入设备的文件系统。需要说明的是,电子设备通常读取接入设备的第一个扇区中的信息。
二、电子设备根据特定扇区中的信息判断接入设备是否采用了特定文件系统。
在电子设备根据读取到的特定扇区中的信息确定接入设备采用的文件系统类型时,该电子设备中预先存储有特定扇区中的信息与文件系统类型的对应关系表,电子设备根据读取到的特定扇区中的信息查找对应的文件系统类型,当能够查找到对应的文件系统类型时,即可确定该接入设备采用了特定文件系统。其中,特定扇区中的信息与文件系统类型的对应关系表的表结构可以如表一所示:
表一
特定扇区中的信息 文件系统
A格式存储的信息 A文件系统
B格式存储的信息 B文件系统
C格式存储的信息 C文件系统
三、若判断出接入设备采用了特定文件系统,电子设备则将预定存储地址确定为更新固件的存储地址。
电子设备在根据特定扇区中的信息确定文件系统之后,可以根据该文件系统确定更新 固件的存储地址。其中,文件系统与更新固件的存储地址的对应关系可以如表二所示:
表二
文件系统 更新固件的存储地址
A文件系统 存储地址A
B文件系统 存储地址B
C文件系统 存储地址C
其中,该预定存储地址可以是接入设备中的一条存储路径。比如,该预定存储地址可以为“H:\固件”,表示更新固件的存储地址为H盘根目录下的固件文件夹。
不同文件系统对应的更新固件的存储地址可以相同也可以不同,本实施例仅以不同文件系统对应的更新固件的存储地址不同进行举例说明,并不对本发明构成限定。
四、若判断出接入设备未采用特定文件系统,电子设备则根据特定扇区中的信息携带的元信息确定更新固件的存储地址,该元信息包括更新固件的起始地址和数据长度。
当电子设备未能从特定扇区中的信息与文件系统类型的对应关系表中查找到与读取到的特定扇区中的信息对应的文件系统时,电子设备确定该接入设备未采用特定文件系统。电子设备可以根据该特定扇区中的信息包含的元信息,获取该元信息中包含的更新固件的起始地址和数据长度,确定更新固件的存储地址。
在步骤203中,确定电子设备中的固件存储区域。
由于电子设备中固件存储区域的信息存储在内部闪存的元信息中,所以电子设备可以读取内部闪存的元信息,确定存放更新固件的固件存储地址。其中,固件存储区域用于存储固件。
当电子设备中存在一个固件存储区域时,该固件存储区域用于存储电子设备处于正常运行阶段时运行的固件;当电子设备中存在至少两个固件存储区域时,其中一个固件存储区域被置为活跃区,该置为活跃区的固件存储区域用于存储电子设备处于正常运行阶段时运行的固件,其余的固件存储区域均被置为非活跃区,该置为非活跃区的固件存储区域用于存储电子设备不运行的固件。
电子设备可以读取内部闪存的元信息,将电子设备中仅存的一个固件存储区域确定为存储更新固件的固件存储区域,或,将电子设备中置为非活跃区的固件存储区域确定为存储更新固件的固件存储区域。
步骤202与步骤203没有严格的先后关系,本实施例仅以步骤202在步骤203之前执行进行说明,并不对本发明构成限定。
在步骤204中,将存储地址中存储的更新固件写入固件存储区域中。
由于将更新固件写入不同的固件存储区域中的方式不同,因此,本实施例分别以上述确定的两种固件存储区域为例,对更新固件的写入流程进行说明。
第一,当电子设备中仅存在一个固件存储区域时,电子设备将更新固件替换固件存储区域中存储的原始固件。
当电子设备中仅存在一个固件存储区域时,电子设备读取接入设备中的更新固件,并将该更新固件写入固件存储区域存储,替换该固件存储区域存储的原始固件。
可选的,为了保证更新固件的准确性,电子设备还需要检测更新固件是否被正确写入固件存储区域。电子设备会根据存储在预定位置的校验值对该更新固件是否被正确写入进行检测,该校验值可以存储在该更新固件的头部或者尾部。比如,电子设备从更新固件的头部获取该校验值,并使用该校验值对写入的更新固件做CRC(Cyclic Redundancy Check,循环冗余校验码)校验,根据校验结果确定更新固件是否被正确写入固件存储区域。
在将接入设备中的更新固件写入固件存储区域后,电子设备会发出提示信息,该提示信息用于提醒用户更新固件写入完毕,提示用户断开接入设备,并重新启动电子设备,其中该提示信息可以是语音或文字信息。
第二,当电子设备中存在至少两个固件存储区域时,电子设备将更新固件写入其中置为非活跃区的固件存储区域中,该置为非活跃区的固件存储区域用于存储电子设备不运行的固件。
比如,电子设备中有两个固件存储区域,其中一个是置为活跃区的固件存储区域,另一个是置为非活跃区的固件存储区域,电子设备将接入设备中存储的更新固件写入该置为非活跃区的固件存储区域中。
可选的,本实施例提供的固件更新方法还包括:
1)检测更新固件是否被正确写入置为非活跃区的固件存储区域中;
2)若检测出更新固件已经被正确写入置为非活跃区的固件存储区域中,则将原来置为活跃区的固件存储区域置为非活跃区,将正确写入更新固件的固件存储区域置为活跃区,该置为活跃区的固件存储区域用于存储电子设备处于正常运行阶段时运行的固件。
其中,为了保证更新固件的准确性,电子设备会根据存储在预定位置的校验值对该更新固件是否被正确写入进行检测,该校验值可以存储在该更新固件的头部或者尾部。比如,电子设备从更新固件的头部获取该校验值,并使用该校验值对写入的更新固件做CRC校验,根据校验结果确定更新固件是否被正确写入固件存储区域。
当检测到该更新固件被正确写入时,电子设备确定能够正确运行该更新固件,电子设备将该非活跃区置为活跃区。为了保证电子设备中仅存在一个活跃区,电子设备还需要将原先的活跃区置为非活跃区。在设置完毕后,电子设备会发出提示信息,该提示信息用于提醒用户更新固件写入完毕,提示用户断开接入设备,并重新启动电子设备
电子设备可以保留非活跃区中的固件,也可以将该固件进行删除或替换,本发明并不对此进行限定。
在步骤205中,在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件。
电子设备处于启动阶段时,将会检测是否有接入设备与该电子设备相连,当未检测到有接入设备与该电子设备相连时,电子设备进入正常运行阶段,将运行写入固件存储区域 的更新固件,从而实现固件的更新;当检测到有接入设备与该电子设备相连时,电子设备将执行步骤201至步骤204。
综上所述,本实施例提供的固件刷新方法,通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提高固件刷新成功率的效果。
另外,通过电子设备对接入设备是否采用特定文件系统进行检测,当采用了特定文件系统时从预定存储位置获取更新固件,当未采用特定文件系统时,根据特定扇区中的信息携带的元信息获取更新固件,使得电子设备可以从不同的文件系统中读取更新固件,提高了固件刷新的成功率,扩大了固件刷新的使用范围。
另外,通过检测更新固件是否被正确写入置为非活跃区的固件存储区域中;若检测出更新固件已经被正确写入置为非活跃区的固件存储区域中,则将该固件存储区域置为活跃区,在检测到更新固件被正确写入时将该非活跃区设置为活跃区,保证了写入的更新固件的正常运行。
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。
图3是根据一示例性实施例示出的一种固件刷新装置的结构方框图。该固件刷新装置可以通过软件、硬件或者两者的结合实现成为电子设备的全部或者一部分。该固件刷新装置,包括:设备检测模块320、固件写入模块340和固件运行模块360。
该设备检测模块320,被配置为在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;
该固件写入模块340,被配置为当设备检测模块320检测出接入设备为免驱设备时,将接入设备中的更新固件写入电子设备中;
该固件运行模块360,被配置为在电子设备处于重启之后的正常运行阶段时,运行固件写入模块340写入电子设备中的更新固件。
综上所述,本实施例提供的固件刷新装置,通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提 高固件刷新成功率的效果。
图4是根据另一示例性实施例示出的一种固件刷新装置的结构方框图。该固件刷新装置可以通过软件、硬件或者两者的结合实现成为电子设备的全部或者一部分。该固件刷新装置,包括:设备检测模块420、固件写入模块440和固件运行模块460。
该设备检测模块420,被配置为在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;
该固件写入模块440,被配置为当设备检测模块420检测出接入设备为免驱设备时,将接入设备中的更新固件写入电子设备中;
该固件运行模块460,被配置为在电子设备处于重启之后的正常运行阶段时,运行固件写入模块440写入电子设备中的更新固件。
可选的,设备检测模块420,包括:第一信息获取子模块421、第二信息获取子模块422和设备确定子模块423。
该第一信息获取子模块421,被配置为获取在启动阶段之前与电子设备相连的接入设备的接口描述符信息;
该第二信息获取子模块422,被配置为当第一信息获取子模块421获取的接口描述符信息指示接入设备为大容量存储设备时,获取接入设备的设备类型信息;
该设备确定子模块423,被配置为当第二信息获取子模块422获取的设备类型信息指示接入设备的设备类型为免驱类型时,确定接入设备为免驱设备。
可选的,固件写入模块440,包括:地址获取子模块441、区域确定子模块442和固件写入子模块443。
该地址获取子模块441,被配置为从接入设备中获取更新固件的存储地址;
该区域确定子模块442,被配置为确定电子设备中的固件存储区域;
该固件写入子模块443,被配置为将地址获取子模块441获取到的存储地址中存储的更新固件写入区域确定子模块442确定的固件存储区域中。
可选的,地址获取子模块441,包括:扇区信息读取子模块441a、系统判断子模块441b、第一确定子模块441c和第二确定子模块441d。
该扇区信息读取子模块441a,被配置为读取接入设备的特定扇区中的信息;
该系统判断子模块441b,被配置为根据扇区信息读取子模块441a获取的特定扇区中的信息判断接入设备是否采用了特定文件系统;
该第一确定子模块441c,被配置为当系统判断子模块441b判断出接入设备采用了特定文件系统时,将预定存储地址确定为更新固件的存储地址;
该第二确定子模块441d,被配置为当系统判断子模块441b判断出接入设备未采用特定文件系统时,根据特定扇区中的信息携带的元信息确定更新固件的存储地址,该元信息包括更新固件的起始地址和数据长度。
可选的,固件写入子模块443,包括:第一写入子模块443a和第二写入子模块443b。
该第一写入子模块443a,被配置为当接入设备中包含一个固件存储区域时,将更新固件替换固件存储区域中存储的原始固件;
该第二写入子模块443b,被配置为当接入设备中包含至少两个固件存储区域时,将更新固件写入其中置为非活跃区的固件存储区域中,置为非活跃区的固件存储区域用于存储电子设备不运行的固件。
可选的,该装置,还包括:固件检测模块和区域设置模块。
该固件检测模块470,被配置为检测更新固件是否被正确写入置为非活跃区的固件存储区域中;
该区域设置模块480,被配置为当固件检测模块检测470出更新固件已经被正确写入置为非活跃区的固件存储区域中时,将原来置为活跃区的固件存储区域置为非活跃区,将正确写入更新固件的固件存储区域置为活跃区,置为活跃区的固件存储区域用于存储电子设备处于正常运行阶段时运行的固件。
综上所述,本实施例提供的固件刷新装置,通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提高固件刷新成功率的效果。
另外,通过电子设备对接入设备是否采用特定文件系统进行检测,当采用了特定文件系统时从预定存储位置获取更新固件,当未采用特定文件系统时,根据特定扇区中的信息携带的元信息获取更新固件,使得电子设备可以从不同的文件系统中读取更新固件,提高了固件刷新的成功率,扩大了固件刷新的使用范围。
另外,通过检测更新固件是否被正确写入置为非活跃区的固件存储区域中;若检测出更新固件已经被正确写入置为非活跃区的固件存储区域中,则将该固件存储区域置为活跃区,在检测到更新固件被正确写入时将该非活跃区设置为活跃区,保证了写入的更新固件的正常运行。
本公开一示例性实施例还提供了一种固件刷新装置,该固件刷新装置应用于基友固件刷新功能的电子设备中,包括:
处理器;
用于存储处理器的可执行指令的存储器;
其中,处理器被配置为:
在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为 免驱设备;
若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;
在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件。
可选的,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备,包括:获取在启动阶段之前与电子设备相连的接入设备的接口描述符信息;
当接口描述符信息指示接入设备为大容量存储设备时,获取接入设备的设备类型信息;
当设备类型信息指示接入设备的设备类型为免驱类型时,确定接入设备为所述免驱设备。
可选的,将接入设备中的更新固件写入所述电子设备中,包括:
从接入设备中获取更新固件的存储地址;
确定电子设备中的固件存储区域;
将存储地址中存储的更新固件写入固件存储区域中。
可选的,从接入设备中获取更新固件的存储地址,包括:
读取接入设备的特定扇区中的信息;
根据特定扇区中的信息判断接入设备是否采用了特定文件系统;
若判断出接入设备采用了特定文件系统,则将预定存储地址确定为更新固件的存储地址;
若判断出接入设备未采用特定文件系统,则根据特定扇区中的信息携带的元信息确定更新固件的存储地址,该元信息包括更新固件的起始地址和数据长度。
可选的,将存储地址中存储的更新固件写入固件存储区域中,包括:
当接入设备中包含一个固件存储区域时,将更新固件替换固件存储区域中存储的原始固件;
当接入设备中包含至少两个固件存储区域时,将更新固件写入其中置为非活跃区的固件存储区域中,该置为非活跃区的固件存储区域用于存储电子设备不运行的固件。
可选的,还包括:检测更新固件是否被正确写入置为非活跃区的固件存储区域中;若检测出更新固件已经被正确写入置为非活跃区的固件存储区域中,则将原来置为活跃区的固件存储区域置为非活跃区,将正确写入更新固件的固件存储区域置为活跃区,该置为活跃区的固件存储区域用于存储电子设备处于正常运行阶段时运行的固件。
综上所述,本实施例提供的固件刷新装置,通过在电子设备处于启动阶段时,检测在启动阶段之前与电子设备相连的接入设备是否为免驱设备;若检测出接入设备为免驱设备,则将接入设备中的更新固件写入电子设备中;在电子设备处于重启之后的正常运行阶段时,运行写入电子设备中的更新固件;使得电子设备中未安装相应驱动时,也可以通过免驱设备完成电子设备的固件刷新,解决了当电子设备中未安装相应的驱动程序时,将不能读取专业刷机工具中的固件,导致固件刷新失败的问题;达到了简化固件刷新过程,提 高固件刷新成功率的效果。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图5是根据一示例性实施例示出的一种固件刷新装置的结构示意图。例如,装置500可以是具有固件刷新功能的电子设备。
参照图5,装置500可以包括以下一个或多个组件:处理组件502,存储器504,电源组件506,多媒体组件508,音频组件510,输入/输出(I/O)的接口512,传感器组件514,以及通信组件516。
处理组件502通常控制装置500的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件502可以包括一个或多个处理器520来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件502可以包括一个或多个模块,便于处理组件502和其他组件之间的交互。例如,处理组件502可以包括多媒体模块,以方便多媒体组件508和处理组件502之间的交互。
存储器504被配置为存储各种类型的数据以支持在装置500的操作。这些数据的示例包括用于在装置500上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器504可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件506为装置500的各种组件提供电力。电源组件506可以包括电源管理系统,一个或多个电源,及其他与为装置500生成、管理和分配电力相关联的组件。
多媒体组件508包括在所述装置500和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件508包括一个前置摄像头和/或后置摄像头。当装置500处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件510被配置为输出和/或输入音频信号。例如,音频组件510包括一个麦克风(MIC),当装置500处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器504或经由通信组件516发送。在一些实施例中,音频组件510还包括一个扬声器,用于输出音频信号。
I/O接口512为处理组件502和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件514包括一个或多个传感器,用于为装置500提供各个方面的状态评估。例如,传感器组件514可以检测到装置500的打开/关闭状态,组件的相对定位,例如所述组件为装置500的显示器和小键盘,传感器组件514还可以检测装置500或装置500一个组件的位置改变,用户与装置500接触的存在或不存在,装置500方位或加速/减速和装置500的温度变化。传感器组件514可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件514还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件514还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件516被配置为便于装置500和其他设备之间有线或无线方式的通信。装置500可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件516经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件516还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置500可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器504,上述指令可由装置500的处理器520执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置500的处理器执行时,使得装置500能够执行应用于具有固件刷新功能的电子设备的固件刷新方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (13)

  1. 一种固件刷新方法,其特征在于,所述方法包括:
    在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备;
    若检测出所述接入设备为免驱设备,则将所述接入设备中的更新固件写入所述电子设备中;
    在所述电子设备处于重启之后的正常运行阶段时,运行写入所述电子设备中的所述更新固件。
  2. 根据权利要求1所述的方法,其特征在于,所述检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备,包括:
    获取在所述启动阶段之前与所述电子设备相连的所述接入设备的接口描述符信息;
    当所述接口描述符信息指示所述接入设备为大容量存储设备时,获取所述接入设备的设备类型信息;
    当所述设备类型信息指示所述接入设备的设备类型为免驱类型时,确定所述接入设备为所述免驱设备。
  3. 根据权利要求1所述的方法,其特征在于,所述将所述接入设备中的更新固件写入所述电子设备中,包括:
    从所述接入设备中获取所述更新固件的存储地址;
    确定所述电子设备中的固件存储区域;
    将所述存储地址中存储的所述更新固件写入所述固件存储区域中。
  4. 根据权利要求3所述的方法,其特征在于,所述从所述接入设备中获取所述更新固件的存储地址,包括:
    读取所述接入设备的特定扇区中的信息;
    根据所述特定扇区中的信息判断所述接入设备是否采用了特定文件系统;
    若判断出所述接入设备采用了特定文件系统,则将预定存储地址确定为所述更新固件的存储地址;
    若判断出所述接入设备未采用特定文件系统,则根据所述特定扇区中的信息携带的元信息确定所述更新固件的存储地址,所述元信息包括所述更新固件的起始地址和数据长度。
  5. 根据权利要求3所述的方法,其特征在于,所述将所述存储地址中存储的所述更新固件写入所述固件存储区域中,包括:
    当所述接入设备中包含一个所述固件存储区域时,将所述更新固件替换所述固件存储区域中存储的原始固件;
    当所述接入设备中包含至少两个所述固件存储区域时,将所述更新固件写入其中置为非活跃区的固件存储区域中,所述置为非活跃区的固件存储区域用于存储所述电子设备不运行的固件。
  6. 根据权利要求5所述的方法,其特征在于,所述方法,还包括:
    检测所述更新固件是否被正确写入所述置为非活跃区的固件存储区域中;
    若检测出所述更新固件已经被正确写入所述置为非活跃区的固件存储区域中,则将原来置为活跃区的固件存储区域置为非活跃区,将正确写入所述更新固件的所述固件存储区域置为活跃区,所述置为活跃区的固件存储区域用于存储所述电子设备处于正常运行阶段时运行的固件。
  7. 一种固件刷新装置,其特征在于,所述装置包括:
    设备检测模块,被配置为在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备;
    固件写入模块,被配置为当所述设备检测模块检测出所述接入设备为免驱设备时,将所述接入设备中的更新固件写入所述电子设备中;
    固件运行模块,被配置为在所述电子设备处于重启之后的正常运行阶段时,运行所述固件写入模块写入所述电子设备中的所述更新固件。
  8. 根据权利要求7所述的装置,其特征在于,所述设备检测模块,包括:
    第一信息获取子模块,被配置为获取在所述启动阶段之前与所述电子设备相连的所述接入设备的接口描述符信息;
    第二信息获取子模块,被配置为当所述第一信息获取子模块获取的所述接口描述符信息指示所述接入设备为大容量存储设备时,获取所述接入设备的设备类型信息;
    设备确定子模块,被配置为当所述第二信息获取子模块获取的所述设备类型信息指示所述接入设备的设备类型为免驱类型时,确定所述接入设备为所述免驱设备。
  9. 根据权利要求7所述的装置,其特征在于,所述固件写入模块,包括:
    地址获取子模块,被配置为从所述接入设备中获取所述更新固件的存储地址;
    区域确定子模块,被配置为确定所述电子设备中的固件存储区域;
    固件写入子模块,被配置为将所述地址获取子模块获取到的所述存储地址中存储的所述更新固件写入所述区域确定子模块确定的所述固件存储区域中。
  10. 根据权利要求9所述的装置,其特征在于,所述地址获取子模块,包括:
    扇区信息读取子模块,被配置为读取所述接入设备的特定扇区中的信息;
    系统判断子模块,被配置为根据所述扇区信息读取子模块获取的所述特定扇区中的信息判断所述接入设备是否采用了特定文件系统;
    第一确定子模块,被配置为当所述系统判断子模块判断出所述接入设备采用了特定文件系统时,将预定存储地址确定为所述更新固件的存储地址;
    第二确定子模块,被配置为当所述系统判断子模块判断出所述接入设备未采用特定文件系统时,根据所述特定扇区中的信息携带的元信息确定所述更新固件的存储地址,所述元信息包括所述更新固件的起始地址和数据长度。
  11. 根据权利要求9所述的装置,其特征在于,所述固件写入子模块,包括:
    第一写入子模块,被配置为当所述接入设备中包含一个所述固件存储区域时,将所述更新固件替换所述固件存储区域中存储的原始固件;
    第二写入子模块,被配置为当所述接入设备中包含至少两个所述固件存储区域时,将所述更新固件写入其中置为非活跃区的固件存储区域中,所述置为非活跃区的固件存储区域用于存储所述电子设备不运行的固件。
  12. 根据权利要求11所述的装置,其特征在于,所述装置,还包括:
    固件检测模块,被配置为检测所述更新固件是否被正确写入所述置为非活跃区的固件存储区域中;
    区域设置模块,被配置为当所述固件检测模块检测出所述更新固件已经被正确写入所述置为非活跃区的固件存储区域中时,将原来置为活跃区的固件存储区域置为非活跃区,将正确写入所述更新固件的所述固件存储区域置为活跃区,所述置为活跃区的固件存储区域用于存储所述电子设备处于正常运行阶段时运行的固件。
  13. 一种固件刷新装置,其特征在于,包括:
    处理器;
    用于存储所述处理器的可执行指令的存储器;
    其中,所述处理器被配置为:
    在电子设备处于启动阶段时,检测在所述启动阶段之前与所述电子设备相连的接入设备是否为免驱设备;
    若检测出所述接入设备为免驱设备,则将所述接入设备中的更新固件写入所述电子设备中;
    在所述电子设备处于重启之后的正常运行阶段时,运行写入所述电子设备中的所述更新固件。
PCT/CN2015/080806 2014-12-15 2015-06-04 固件刷新方法及装置 WO2016095452A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2016564376A JP6190978B2 (ja) 2014-12-15 2015-06-04 ファームウェアリフレッシュ方法、装置、プログラム及び記録媒体
RU2015129670A RU2630371C2 (ru) 2014-12-15 2015-06-04 Способ и устройство для обновления микропрограммного обеспечения
MX2015010388A MX369881B (es) 2014-12-15 2015-06-04 Metodo y dispositivo de actualizacion de firmware.
BR112015019779A BR112015019779A2 (pt) 2014-12-15 2015-06-04 método e dispositivo de renovação de firmware
KR1020157020627A KR20160086754A (ko) 2014-12-15 2015-06-04 펌웨어 리프레시 방법, 장치, 프로그램 및 기록매체
US15/082,617 US10613848B2 (en) 2014-12-15 2016-03-28 Firmware refreshing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410778909.XA CN104503786B (zh) 2014-12-15 2014-12-15 固件刷新方法及装置
CN201410778909.X 2014-12-15

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/082,617 Continuation US10613848B2 (en) 2014-12-15 2016-03-28 Firmware refreshing method and device

Publications (1)

Publication Number Publication Date
WO2016095452A1 true WO2016095452A1 (zh) 2016-06-23

Family

ID=52945187

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080806 WO2016095452A1 (zh) 2014-12-15 2015-06-04 固件刷新方法及装置

Country Status (10)

Country Link
US (1) US10613848B2 (zh)
EP (1) EP3040856B1 (zh)
JP (1) JP6190978B2 (zh)
KR (1) KR20160086754A (zh)
CN (1) CN104503786B (zh)
BR (1) BR112015019779A2 (zh)
ES (1) ES2770637T3 (zh)
MX (1) MX369881B (zh)
RU (1) RU2630371C2 (zh)
WO (1) WO2016095452A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003251A (zh) * 2021-12-30 2022-02-01 北京中科网威信息技术有限公司 Fpga加速卡探测方法、装置、设备及计算机存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503786B (zh) * 2014-12-15 2020-10-16 小米科技有限责任公司 固件刷新方法及装置
JP2017199246A (ja) * 2016-04-28 2017-11-02 京セラドキュメントソリューションズ株式会社 電子機器
US10777297B2 (en) * 2018-12-10 2020-09-15 Micron Technology, Inc. Age-based refresh of firmware
CN116136766A (zh) * 2021-11-17 2023-05-19 瑞昱半导体股份有限公司 嵌入式系统与韧体更新方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120317404A1 (en) * 2011-06-13 2012-12-13 Wei-Chen Chou Firmware Flashing Method and Related Computer System
CN102841801A (zh) * 2012-07-11 2012-12-26 中兴通讯股份有限公司 免驱终端的固件升级方法和装置
CN103380415A (zh) * 2011-12-23 2013-10-30 Lg电子株式会社 基于设备管理命令更新固件的方法和装置
CN103748569A (zh) * 2011-06-27 2014-04-23 施耐德电气It公司 Usb设备的无驱动操作的系统和方法
CN104503786A (zh) * 2014-12-15 2015-04-08 小米科技有限责任公司 固件刷新方法及装置

Family Cites Families (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040093597A1 (en) 2002-11-05 2004-05-13 Rao Bindu Rama Firmware update system for facilitating firmware update in mobile handset related applications
WO2004070571A2 (en) 2003-02-03 2004-08-19 Bitfone Corporation Update system for facilitating firmware/software update in a mobile handset
US20040230963A1 (en) 2003-05-12 2004-11-18 Rothman Michael A. Method for updating firmware in an operating system agnostic manner
JP2005242555A (ja) * 2004-02-25 2005-09-08 Hitachi Ltd 記憶制御システム及び記憶制御システムが有するディスク型記憶装置にファームウェアを搭載する方法
US7308570B2 (en) * 2004-10-20 2007-12-11 Digi International Inc. System and method for booting embedded systems using removable storage
JP2006202206A (ja) * 2005-01-24 2006-08-03 Matsushita Electric Ind Co Ltd 画像形成装置及びその制御プログラムの更新方法
US7516315B2 (en) 2005-03-18 2009-04-07 Research In Motion Ltd. Electronic device having an alterable configuration and methods of manufacturing and configuring the same
JP2007047993A (ja) * 2005-08-09 2007-02-22 Rohm Co Ltd 制御回路、それを用いた電子機器およびファームウェアの更新方法
JP2007172391A (ja) 2005-12-22 2007-07-05 Canon Inc 電子機器の制御方法、電子機器の制御プログラム、電子機器、および記録装置
CN100456246C (zh) * 2007-01-23 2009-01-28 北京映翰通网络技术有限公司 一种固件程序升级的方法与装置
CN100589078C (zh) * 2007-08-21 2010-02-10 中兴通讯股份有限公司 多核终端的固件升级方法
CN101470610B (zh) 2007-12-25 2011-07-20 英业达股份有限公司 测试用程序的更新方法
KR20090111558A (ko) * 2008-04-22 2009-10-27 삼성전자주식회사 방송수신장치 및 그의 펌웨어 업그레이드 방법
US20090293052A1 (en) * 2008-05-25 2009-11-26 Seung Pil Kim Apparatus and method for port adaptor for peripheral device software and data
CN101303674A (zh) 2008-06-27 2008-11-12 彭增金 包含自身设备驱动程序的usb设备
US9870220B2 (en) * 2008-12-05 2018-01-16 Advanced Micro Devices, Inc. Memory flash apparatus and method for providing device upgrades over a standard interface
TWI384367B (zh) * 2008-12-31 2013-02-01 Askey Computer Corp 韌體更新系統及方法
US20120079473A1 (en) * 2009-06-08 2012-03-29 Haruhito Watanabe Software updating system, displaying unit and software updating method
CN101944029A (zh) 2009-07-10 2011-01-12 环旭电子股份有限公司 磁盘固件更新装置及磁盘固件更新方法
US9652755B2 (en) * 2009-08-11 2017-05-16 Silver Spring Networks, Inc. Method and system for securely updating field upgradeable units
JP5611648B2 (ja) * 2010-04-21 2014-10-22 京セラ株式会社 電子機器及び電子システム
CN102279756A (zh) 2010-06-11 2011-12-14 英业达股份有限公司 Cpld固件更新方法
CN101957765B (zh) 2010-09-02 2016-01-20 北京中星微电子有限公司 一种实现设备固件更新的方法及系统、设备
CN102707960B (zh) 2011-03-28 2016-01-27 联想(北京)有限公司 固件更新方法、便携移动终端及便携设备
CN103853638B (zh) 2012-12-04 2017-07-21 联想(北京)有限公司 一种刷新固件的方法及电子设备
CN103220330B (zh) * 2013-03-11 2016-02-10 中兴通讯股份有限公司 数据终端升级装置及方法
JP6070360B2 (ja) * 2013-03-29 2017-02-01 沖電気工業株式会社 情報処理装置およびその処理方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120317404A1 (en) * 2011-06-13 2012-12-13 Wei-Chen Chou Firmware Flashing Method and Related Computer System
CN103748569A (zh) * 2011-06-27 2014-04-23 施耐德电气It公司 Usb设备的无驱动操作的系统和方法
CN103380415A (zh) * 2011-12-23 2013-10-30 Lg电子株式会社 基于设备管理命令更新固件的方法和装置
CN102841801A (zh) * 2012-07-11 2012-12-26 中兴通讯股份有限公司 免驱终端的固件升级方法和装置
CN104503786A (zh) * 2014-12-15 2015-04-08 小米科技有限责任公司 固件刷新方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003251A (zh) * 2021-12-30 2022-02-01 北京中科网威信息技术有限公司 Fpga加速卡探测方法、装置、设备及计算机存储介质
CN114003251B (zh) * 2021-12-30 2022-04-15 北京中科网威信息技术有限公司 Fpga加速卡探测方法、装置、设备及计算机存储介质

Also Published As

Publication number Publication date
EP3040856A1 (en) 2016-07-06
EP3040856B1 (en) 2019-11-06
ES2770637T3 (es) 2020-07-02
BR112015019779A2 (pt) 2017-07-18
RU2015129670A (ru) 2017-04-28
MX369881B (es) 2019-11-25
US10613848B2 (en) 2020-04-07
JP6190978B2 (ja) 2017-08-30
CN104503786B (zh) 2020-10-16
KR20160086754A (ko) 2016-07-20
US20160210140A1 (en) 2016-07-21
JP2017507441A (ja) 2017-03-16
CN104503786A (zh) 2015-04-08
MX2015010388A (es) 2016-08-26
RU2630371C2 (ru) 2017-09-07

Similar Documents

Publication Publication Date Title
WO2016090822A1 (zh) 对固件进行升级的方法及装置
CN107750466B (zh) 使用经同步的提示信号配对附近设备
CN107786794B (zh) 向应用提供由图像传感器获取的图像的电子装置和方法
RU2669063C2 (ru) Способ и устройство получения изображений
WO2016095452A1 (zh) 固件刷新方法及装置
WO2016011743A1 (zh) 节省存储空间的方法和装置
CN105491113A (zh) 迁移方法、装置及终端
WO2016101712A1 (zh) 固件恢复方法、装置和终端
WO2016188060A1 (zh) 应用程序安装包的处理方法及装置
WO2017035994A1 (zh) 外接设备的连接方法及装置
WO2016029648A1 (zh) 文件备份方法和装置
CN107113374B (zh) 相机启动和照度
KR102193704B1 (ko) 전자 장치의 락 스크린 디스플레이 방법 및 그 전자 장치
WO2017177596A1 (zh) 应用的状态信息显示方法及装置
WO2017080084A1 (zh) 字体添加方法及装置
WO2018219197A1 (zh) 光学防抖的控制方法、移动终端、计算机可读存储介质
WO2016150104A1 (zh) 应用主题的加载方法及装置
WO2016095453A1 (zh) 应用启动方法及装置
CN111966410A (zh) 启动处理方法、装置、电子设备及存储介质
KR101842453B1 (ko) 전자 장치에서 자동 초점 기능을 제어하기 위한 장치 및 방법
WO2019051836A1 (zh) 信息回复方法和装置
US10817702B2 (en) Method, terminal, and computer-readable storage medium for processing fingerprint
US10451838B2 (en) Electronic device and method for autofocusing
US10182133B2 (en) Method and device for starting application
CN105549935B (zh) 显示照片的方法及装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 20157020627

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2016564376

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: MX/A/2015/010388

Country of ref document: MX

ENP Entry into the national phase

Ref document number: 2015129670

Country of ref document: RU

Kind code of ref document: A

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112015019779

Country of ref document: BR

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

Ref document number: 15868964

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112015019779

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20150818

122 Ep: pct application non-entry in european phase

Ref document number: 15868964

Country of ref document: EP

Kind code of ref document: A1