WO2014194865A1 - 一种固件升级方法、装置及通信设备 - Google Patents

一种固件升级方法、装置及通信设备 Download PDF

Info

Publication number
WO2014194865A1
WO2014194865A1 PCT/CN2014/079440 CN2014079440W WO2014194865A1 WO 2014194865 A1 WO2014194865 A1 WO 2014194865A1 CN 2014079440 W CN2014079440 W CN 2014079440W WO 2014194865 A1 WO2014194865 A1 WO 2014194865A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
file
firmware
secure digital
communication device
Prior art date
Application number
PCT/CN2014/079440
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 US14/896,492 priority Critical patent/US9804832B2/en
Priority to EP14807951.0A priority patent/EP3007062A4/en
Publication of WO2014194865A1 publication Critical patent/WO2014194865A1/zh

Links

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
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • the present application relates to the field of device upgrade technologies, and in particular, to a firmware upgrade method, device, and communication device. Background technique
  • SD Secure Digital
  • the mobile terminal can support the SD card. Since the SD card has a small size, a large storage capacity, and a plug-and-play feature, the SD card usually stores data as an external storage device of the mobile terminal. And the mobile terminal can use the SD card for firmware upgrade.
  • the process of upgrading the firmware by using the SD card by the mobile terminal may be: After copying the firmware upgrade file to the SD card, insert the SD card into the SD interface, so that the SD card is connected to the mobile terminal.
  • the mobile terminal reads the firmware upgrade file in the SD card and upgrades the software of the mobile terminal itself.
  • the mobile terminal can also insert the communication device of the SD interface into the SD interface, and the communication device of the SD interface can support access to 2G (Second Generation, second generation mobile communication technology), 3G (Third Generation, third generation mobile communication technology). Or wireless network, so the mobile terminal can wirelessly access the Internet through the communication device of the SD interface.
  • 2G Second Generation, second generation mobile communication technology
  • 3G Third Generation, third generation mobile communication technology
  • wireless network so the mobile terminal can wirelessly access the Internet through the communication device of the SD interface.
  • the SD interface communication device can write the firmware upgrade file in the mobile terminal to its own SD memory, when the SD interface communication device reads After obtaining the upgrade start command in the mobile terminal, run the firmware upgrade file in the SD memory to complete the firmware upgrade.
  • SDIO Secure Digital Input and Output
  • the communication device of the SD interface cannot know whether the data read from the mobile terminal is an upgrade start command through the SD interface, and the communication device of the SD interface cannot start the firmware upgrade.
  • Summary of the invention The technical problem to be solved by the present application is to provide a firmware upgrade method for solving the problem that the communication device inserted into the SD interface of the SD interface cannot start the firmware upgrade when the SD interface does not support the SDIO function in the prior art.
  • the application also provides a communication device upgrading device and a communication device for ensuring the implementation and application of the above method in practice.
  • the present application provides a firmware upgrade method, which is applied to a communication device of a secure digital interface, wherein the communication device of the secure digital interface performs data communication with a mobile terminal through a secure digital interface, and the communication device of the secure digital interface a secure digital memory and a flash memory, wherein the secure digital memory stores a command exchange file, wherein the secure digital memory refers to a memory accessed by the mobile terminal through the secure digital interface, and the flash memory refers to the The communication device of the secure digital interface internally stores the memory of the firmware, and the method includes:
  • the upgrade data includes program code of firmware of a communication device for upgrading the secure digital interface
  • the firmware upgrade file is written to the flash memory.
  • the secure digital storage further stores a result exchange file
  • the method further comprising: in the process of writing the firmware upgrade file to the flash memory, the upgrade progress is Write to the result exchange file;
  • the upgrade result is written into the result exchange file.
  • the upgrade progress and upgrade results are written to the result exchange file via a small computer system interface command.
  • the method further includes:
  • the method further includes deleting the upgrade start command in the command upgrade file after the firmware upgrade file is all written to the flash memory.
  • the method further includes: obtaining the location After the upgrade start command, restarting the communication device of the secure digital interface, entering an upgrade mode of the communication device of the secure digital interface, and in the upgrade mode, reading the firmware storing the upgrade data from the secure digital storage a;
  • the communication device of the secure digital interface is restarted to enter a normal operation mode of the communication device of the secure digital interface.
  • the storage is read from the secure digital storage Before the firmware upgrade file of the upgrade data, the method further includes: verifying the firmware upgrade file; and after verifying that the firmware upgrade file is a legal file, reading a firmware upgrade that stores the upgrade data from the secure digital storage file.
  • the present application provides a firmware upgrade method, which is applied to a mobile terminal, where the mobile terminal performs data communication with a communication device of a secure digital interface through a secure digital interface, and the communication device of the secure digital interface includes a secure digital memory. And a flash memory, wherein the secure digital memory stores a command exchange file, wherein the secure digital memory refers to a memory accessed by the mobile terminal through the secure digital interface, and the flash memory refers to the secure digital interface.
  • the memory of the firmware is saved internally by the communication device, and the method includes:
  • the method further includes: writing an upgrade status query command in the mobile terminal to the command exchange file.
  • the secure digital memory further includes a result exchange file
  • the method further includes: receiving a result exchange file sent by the communication device of the secure digital interface, wherein the result exchange file is sent after the communication device of the secure digital interface acquires an upgrade status query command, and the upgrade is written in the result exchange file Progress and upgrade results;
  • the upgrade progress and the upgrade result are displayed on the mobile terminal.
  • the upgrade start command and the upgrade status query command are written to the command exchange file by a small computer system interface command in.
  • the present application further provides a firmware upgrading apparatus, which is applied to a communication device of a secure digital interface, wherein the communication device of the secure digital interface performs data communication with a mobile terminal through a secure digital interface, and the communication device of the secure digital interface a secure digital memory and a flash memory, wherein the secure digital memory stores a command exchange file, wherein the secure digital memory refers to a memory accessed by the mobile terminal through the secure digital interface, and the flash memory refers to the
  • the communication device of the secure digital interface internally stores the memory of the firmware, and the device comprises:
  • a first obtaining unit configured to acquire an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file;
  • a reading unit configured to read, from the secure digital storage, a firmware upgrade file storing upgrade data, after the obtaining the upgrade start command, wherein the firmware upgrade file is downloaded by the mobile terminal and is used by the mobile terminal Writing to the secure digital memory, the upgrade data including program code of firmware for upgrading a communication device of the secure digital interface;
  • the secure digital storage device further stores a result exchange file, the device further comprising: a second writing unit, configured to write the firmware upgrade file to the flash During the process of the memory, the upgrade progress is written into the result exchange file;
  • a third writing unit configured to write the upgrade result into the result exchange file after writing the firmware upgrade file to the flash memory.
  • the second write unit writes the upgrade progress to the result exchange via a small computer system interface command In the file;
  • the third write unit writes the upgrade result to the result exchange file via a small computer system interface command.
  • the device further includes:
  • a second obtaining unit configured to acquire an upgrade status query command in the command exchange file
  • a sending unit configured to send the result exchange file to the mobile terminal after acquiring the upgrade status query command, where The upgrade progress and the upgrade result are written in the result exchange file.
  • the apparatus further includes a deleting unit, configured to delete the upgrade in the command upgrade file after all the firmware upgrade files are written to the flash memory Start the command.
  • the device further includes: After acquiring the upgrade start command, restarting the communication device of the secure digital interface, entering an upgrade mode of the communication device of the secure digital interface, and for writing all the firmware upgrade files to the flash memory Afterwards, restarting the communication device of the secure digital interface, and entering a normal operation mode of the communication device of the secure digital interface;
  • the reading unit is specifically configured to read, in the upgrade mode, the firmware upgrade file storing the upgrade data from the secure digital storage.
  • the apparatus further includes: a verification unit, Used to verify the firmware upgrade file;
  • the reading unit is specifically configured to: after verifying that the firmware upgrade file is a legal file, read a firmware upgrade file that stores upgrade data from the secure digital storage.
  • the present application further provides a communication device of a secure digital interface
  • the communication device of the secure digital interface includes a secure digital memory, a flash memory, and the firmware upgrading device provided by the third aspect of the present application, wherein The firmware upgrading device respectively performs data communication with the secure digital storage and the flash memory, wherein the secure digital storage stores a command exchange file, and the secure digital storage refers to the mobile terminal accessing through the secure digital interface.
  • a memory which is a memory that stores firmware inside a communication device of the secure digital interface.
  • the application further provides a firmware upgrading apparatus, which is applied to a mobile terminal, where the mobile terminal performs data communication with a communication device of a secure digital interface through a secure digital interface, the security number
  • the communication device of the code interface includes a secure digital memory and a flash memory, wherein the secure digital memory stores a command exchange file, wherein the secure digital memory refers to a memory accessed by the mobile terminal through the secure digital interface, the flash
  • the memory refers to a memory that stores firmware inside the communication device of the secure digital interface, and the device includes:
  • a download unit for downloading a firmware upgrade file storing upgrade data
  • a fourth writing unit configured to write the firmware upgrade file into the secure digital storage
  • a fifth writing unit configured to: after the firmware upgrade file is all written to the secure digital storage, the mobile terminal The upgrade start command is written into the command exchange file, and the upgrade start command is acquired by the communication device of the secure digital interface to perform firmware upgrade.
  • the device further includes: a sixth writing unit, configured to write an upgrade status query command in the mobile terminal to the command exchange file.
  • the secure digital memory further includes a result exchange file
  • the device further includes: a receiving unit, configured to: a result exchange file sent by the communication device receiving the secure digital interface, wherein the result exchange file is sent after the communication device of the secure digital interface obtains an upgrade status query command, and the result exchange file is written The upgrade progress and upgrade results;
  • a display unit configured to display the upgrade progress and an upgrade result on the mobile terminal.
  • the fifth writing unit writes the upgrade start command to the Command exchange file
  • the sixth write unit writes the upgrade status query command to the command exchange file via a small computer system interface command.
  • the present application includes the following advantages:
  • the communication device of the mobile terminal and the SD interface can only read and write data in the secure digital storage in units of files.
  • the secure digital storage can define a special file for the upgrade start command.
  • the upgrade data is stored in different files, so that the communication device of the mobile terminal and the SD interface can know whether the data stored in the file is an upgrade start command or an upgrade data by recognizing the file name.
  • two special files a command exchange file and a firmware upgrade file
  • the command exchange file in the two special files stores the write of the mobile terminal.
  • the level start command, the upgrade data is stored in the firmware upgrade file, and the communication device of the SD interface can obtain the data required for the firmware upgrade process in the corresponding file by identifying the file name.
  • the communication device of the SD interface When the communication device of the SD interface obtains the upgrade start command in the command exchange file, indicating that the communication device of the SD interface starts to perform the firmware upgrade, the communication device of the SD interface further reads the firmware storing the upgrade data from the secure digital storage. Upgrade the file, and then write the firmware upgrade file to the flash memory to complete the firmware upgrade.
  • FIG. 3 is still another flowchart of a firmware upgrade method provided by the present application.
  • FIG. 5 is a schematic structural diagram of a firmware upgrading apparatus provided by the present application.
  • FIG. 6 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 7 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 8 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 9 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 10 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 11 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 12 is a schematic structural diagram of another firmware upgrading apparatus provided by the present application.
  • FIG. 13 is a schematic structural diagram of a communication device of an SD interface provided by the present application.
  • FIG. 14 is a schematic diagram of a communication device of an SD interface provided by the present application and a mobile terminal;
  • FIG. 15 is a schematic diagram of software integrated in a communication device of an SD interface provided by the present application;
  • FIG. 16 is a communication device of an SD interface provided by the present application. Schematic diagram of information interaction with software integrated within a mobile terminal. detailed description
  • This application can be used in a variety of general purpose or special purpose computing device environments or configurations.
  • a personal computer a server computer, a handheld or portable device, a tablet device, a multi-processor device, a distributed computing environment including any of the above devices or devices, and the like.
  • the technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
  • Embodiment 1 A firmware upgrade method provided in Embodiment 1 of the present application is applied to a communication device of an SD interface that performs data communication with a mobile terminal through an SD interface, and the communication device of the SD interface includes an SD memory and a Flash memory, and the SD memory There is stored a command exchange file, wherein the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the flash memory refers to a memory in which a communication device of the SD interface stores firmware.
  • Firmware refers to the program code written in EPROM (Erasable Programmable Read Only Memory) or EROM (Erasable Read Only Memory).
  • BIOS Basic Input Output System
  • the software of the basic input and output system is the program code that is solidified inside the integrated circuit and is responsible for controlling and coordinating the functions of the integrated circuit.
  • the mobile terminal cannot directly access the flash memory, so the mobile terminal cannot directly change the data in the flash memory.
  • the SD memory and the flash memory can be two different chips on the physical hardware, or one chip can be shared.
  • the SD interface in the embodiment of the present application does not support the SDIO function. When the SD interface does not support the SDIO function, the mobile terminal can only read and write data in the SD memory in units of files, so a special memory can be defined in the SD memory.
  • the file is used to store the upgrade start command and the upgrade data in different files, so that the communication device of the SD interface can know whether the data in the file is an upgrade start command or an upgrade data by identifying the file name.
  • the special files of the SD memory are two special files, a command exchange file and a firmware upgrade file, and the command exchanges in the two special files.
  • the file stores an upgrade start command written by the mobile terminal, and the firmware upgrade file stores upgrade data, and the communication device of the SD interface obtains data required for the firmware upgrade process in the corresponding file.
  • FIG. 1 is a flowchart of a firmware upgrade method provided by Embodiment 1 of the present application, which may include the following steps: Step 101 : Acquire an upgrade start command in the command exchange file.
  • the mobile terminal that performs data communication with the communication device of the SD interface detects whether the firmware program on the communication device of the SD interface is consistent with the version number of the firmware program of the communication device of the SD interface saved on the server, when detecting When the version numbers do not match, it is determined that the firmware program of the communication device of the SD interface needs to be upgraded, and the mobile terminal writes the upgrade start command to the command exchange file.
  • the format of the command exchange file can be arbitrarily customized, for example, the command exchange file is defined as a binary file.
  • the upgrade start command in the command exchange file can be written to the command exchange file by the mobile terminal through a SCSI (Small Computer System Interface) command.
  • the SCSI command writes the upgrade start command to the command exchange file and can be: REQ 1 u.
  • REQ indicates that the command is an upgrade start command
  • 1 is the command serial number
  • u indicates the start of the upgrade command.
  • multiple upgrade start commands can be written in the command exchange file.
  • the upgrade start command is identified by a different command sequence number.
  • REQ 1 u indicates the first upgrade start command
  • REQ 2 u indicates the second upgrade start command.
  • This embodiment only lists a method for writing an upgrade start command and a format for an upgrade start command. For other write modes and command formats, the scope of protection of this embodiment is also included. .
  • Step 102 After obtaining the upgrade start command, read, from the SD memory, a firmware upgrade file that stores upgrade data, where the firmware upgrade file is downloaded by the mobile terminal from the server and written by the mobile terminal. Enter into the SD memory.
  • the upgrade data contains the program code of the firmware of the communication device used to upgrade the SD interface.
  • the firmware upgrade file is a binary file, which may include a file header, firmware data. And check information.
  • the format of the firmware upgrade file is the same as that of the existing binary file, which is not described in this embodiment.
  • the mobile terminal After the firmware upgrade file is completely written, the mobile terminal writes the upgrade start command to the command exchange file of the SD memory to ensure that the firmware upgrade file of the SD interface is all written to the SD memory when the firmware upgrade is started. , to avoid the upgrade failure due to incomplete upgrade data in the file.
  • Step 103 Write the firmware upgrade file into the flash memory.
  • the firmware upgrade principle is to write the program code in the new firmware upgrade file into the flash memory, and overwrite the program code stored in the flash memory that is read when the communication device of the SD interface is started.
  • the communication device of the SD interface After obtaining the firmware upgrade file, the communication device of the SD interface further writes the firmware upgrade file to the flash memory to change the previously saved program code in the flash memory to the firmware upgrade file currently written in the flash memory.
  • the program code completes the firmware upgrade of the communication device of the SD interface.
  • different files have different data, so that the mobile terminal can write different data into the corresponding file by identifying the file name, and the communication device of the SD interface can be identified.
  • the file name knowing whether the data written by the mobile terminal is an upgrade start command or an upgrade data.
  • the communication device of the SD interface obtains the upgrade start command in the command exchange file, indicating that the communication device of the SD interface starts to perform the firmware upgrade
  • the communication device of the SD interface further reads the firmware storing the upgrade data from the secure digital storage. Upgrade the file, and then write the firmware upgrade file to the flash memory to complete the firmware upgrade.
  • Some SD interfaces can support the SDIO function.
  • the communication device of the SD interface can use the firmware provided in this embodiment. Upgrade method, you can also use SDIO-based Existing firmware upgrade method.
  • Embodiment 2 The firmware upgrade method described in Embodiment 1 solves the problem of firmware upgrade of the communication device of the SD interface when the SD interface does not support the SDIO function, but the communication device of the SD interface does not have human-computer interaction. Interface, so the firmware upgrade progress and status cannot be displayed in the communication device of the SD interface.
  • the firmware upgrade method provided in Embodiment 2 of the present application can display the firmware upgrade progress and status by the mobile terminal.
  • the firmware upgrade method provided in Embodiment 2 of the present application is applied to a communication device of an SD interface that performs data communication with a mobile terminal through an SD interface, and the communication device of the SD interface includes an SD memory and a Flash memory, where the SD memory is stored.
  • Step 201 Acquire an upgrade start command in the command exchange file, where The upgrade start command is written by the mobile terminal into the command exchange file.
  • Step 202 After obtaining the upgrade start command, read a firmware upgrade file that stores upgrade data from the SD memory, where the firmware upgrade file is downloaded by a mobile terminal and written by the mobile terminal In the secure digital memory.
  • Step 203 Write the firmware upgrade file into the flash memory.
  • the specific implementation process of step 201 to step 203 is the same as the specific implementation process of step 101 to step 103, and this embodiment will not be described again.
  • Step 204 Write the upgrade progress to the result exchange file in the process of writing the firmware upgrade file to the flash memory.
  • Step 205 After writing the firmware upgrade file to the flash memory, write the upgrade result into the result exchange file.
  • the upgrade progress indicates the progress of the current firmware upgrade file written to the flash memory, such as the percentage of the file size written to the flash memory as a percentage of the total size of the firmware upgrade file to indicate the progress of the upgrade.
  • the upgrade results indicate the end result of the upgrade, such as a successful upgrade and an upgrade failure.
  • the communication device of the SD interface may indicate that the upgrade is successful or the upgrade fails with different identifiers.
  • the upgrade progress and upgrade results can be written to the result exchange file by SCSI commands.
  • the SCSI command that writes the upgrade progress to the result exchange file can be: RSQ 1 m% , where 1 is the command sequence number, which corresponds to the command sequence number of the upgrade start command, and m% indicates the progress.
  • the communication device of the SD interface can periodically change the upgrade progress every time the firmware is upgraded.
  • the SCSI command for writing the upgrade result to the result exchange file can be: RSP ls, where 1 is the command sequence number, which corresponds to the command sequence number of the upgrade start command, s indicates that the upgrade is successful, and if the upgrade fails, return f Upgrade failed.
  • the result exchange file can be obtained from the SD memory.
  • the firmware upgrade method provided in Embodiment 2 of the present application can also display the firmware upgrade progress and status on the mobile terminal while implementing the firmware upgrade.
  • the specific process of the mobile terminal acquiring the result exchange file from the SD memory may be: after the communication device of the SD interface obtains the upgrade status query command in the command exchange file, the result exchange file is sent to the mobile terminal, where the upgrade status is The query is written by the mobile terminal to the command exchange file, which indicates that the mobile terminal needs to query the firmware upgrade process, and the communication device of the SD interface needs to send the result exchange file to the mobile terminal.
  • the upgrade status query command can also be written to the command exchange file via SCSI, such as REP 1 q.
  • REP indicates that the command is an upgrade status query command
  • 1 is a command sequence number
  • u indicates a start status query.
  • the format of the result exchange file can be arbitrarily customized.
  • the result exchange file can use the format of the existing binary file.
  • Multiple upgrade results can be written to the result exchange file.
  • the upgrade result identifies the upgrade result with different command serial numbers, and Cup.
  • REQ 1 u indicates the first upgrade start command
  • the corresponding upgrade result may be RSP 1 s bath
  • REQ 2 u indicates the second upgrade start command
  • the corresponding upgrade result may be RSP 2 s.
  • a format for writing an upgrade status query command and a format for an upgrade status query command are listed. For other write modes and command formats, the scope of protection of the present embodiment is also omitted.
  • Embodiment 3 Please refer to FIG. 3, which is a schematic structural diagram of a firmware upgrade method provided by Embodiment 3 of the present application, which is applied to a communication device of an SD interface that performs data communication with a mobile terminal through an SD interface, and the The communication device of the SD interface includes an SD memory and a flash memory, wherein the SD memory stores a command exchange file, wherein the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the flash memory refers to a The memory of the SD interface internally stores the memory of the firmware.
  • the firmware upgrade method shown in FIG. 3 above may include the following steps: Step 301: Acquire an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file.
  • Step 302 After obtaining the upgrade start command, reading, from the secure digital storage, a firmware upgrade file storing upgrade data, where the firmware upgrade file is downloaded by the mobile terminal and written by the mobile terminal In the secure digital memory.
  • Step 303 Write the firmware upgrade file into the flash memory.
  • the specific implementation process of step 301 to step 303 is the same as the specific implementation process of step 101 to step 103, which is not described in this embodiment.
  • Step 304 After the firmware upgrade file is all written to the flash memory, delete the upgrade start command in the command upgrade file.
  • the upgrade start command written in the command upgrade file is deleted.
  • the SD memory further stores a result exchange file, and the result exchange file may store an upgrade progress and an upgrade result, and the result exchange file It can also be sent to the mobile terminal, and the upgrade progress and the upgrade result are displayed on the mobile terminal.
  • the firmware upgrade method provided by all the foregoing method embodiments needs to be performed in the upgrade mode of the communication device of the SD interface, and the communication device of the SD interface runs in the normal operation mode after being powered on, so when the communication device of the SD interface acquires the upgrade After the command is started, the communication device of the secure digital interface needs to be restarted, enters the upgrade mode of the communication device of the secure digital interface, and then in the upgrade mode, the firmware upgrade storing the upgrade data is read from the secure digital storage. file. After all the firmware upgrade files are written to the flash memory, the communication device of the secure digital interface is restarted to enter a normal operation mode of the communication device of the secure digital interface.
  • the normal operation mode refers to an operation mode in which the operating system running on the communication device of the SD interface can provide various service functions for the user.
  • the upgrade mode means that the operating system running on the communication device of the SD interface can provide only the upgrade service function for the user.
  • Operating mode In all the foregoing method embodiments, the communication device of the SD interface writes the firmware upgrade file into the flash memory, and the method includes: writing the firmware upgrade file image to the flash memory, that is, the new program code in the firmware upgrade file overwrites the flash memory. There are saved program code. When the new program code is completely written to the flash memory, the firmware upgrade of the SD interface communication device is completed. When the communication device of the SD interface is running again, the new program code in the flash memory can be directly run.
  • the communication device of the SD interface needs to further verify the firmware upgrade file to determine whether the firmware upgrade file is a legal file, thereby preventing the illegal operation of the SD interface communication device caused by the illegal file being written in the flash memory, wherein the legal file indicates the firmware upgrade.
  • the file is usable and has not been removed Files changed by users other than the carrier.
  • the communication device of the SD interface can verify the firmware upgrade file by using the existing verification method, which is not described in this embodiment.
  • the firmware upgrade method provided by the embodiment of the present application is introduced from the mobile terminal side.
  • Embodiment 4 The firmware upgrade method provided in Embodiment 4 of the present application is applied to a mobile terminal, where the mobile terminal performs data communication with a communication device of an SD interface through an SD interface, where the communication device of the SD interface includes an SD memory and a Flash memory.
  • the SD memory stores a command exchange file, wherein the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the Flash memory refers to a memory in which a communication device of the SD interface stores firmware.
  • the firmware refers to the program written in the EPROM or EROM. In the embodiment of the present application, the mobile terminal cannot directly access the flash memory, so the mobile terminal cannot directly change the data in the flash memory.
  • the SD memory and the flash memory can be two different chips on the physical hardware, or one chip can be shared.
  • the SD interface in the embodiment of the present application does not support the SDIO function.
  • the mobile terminal can only read and write data in the SD memory in units of files, so a special memory can be defined in the SD memory.
  • the file is used to store the upgrade start command and the upgrade data into different files, so that the communication device of the SD interface can know whether the data stored in the file is an upgrade start command or an upgrade data.
  • the special files of the SD memory are respectively two special files, a command exchange file and a firmware upgrade file, and the mobile terminal can separately write the upgrade start command and the upgrade data to the two special files, and the communication device of the SD interface is corresponding. Get the data required for the firmware upgrade process in the file. Please refer to FIG.
  • Step 401 Download a firmware upgrade file that stores upgrade data.
  • the mobile terminal detects whether the firmware program on the communication device of the SD interface is consistent with the version number of the firmware program of the communication device of the SD interface saved on the server. When it is detected that the version numbers are inconsistent, the SD interface is determined.
  • the firmware program of the communication device needs to be upgraded, and the mobile terminal downloads the firmware upgrade file storing the upgrade data from the server.
  • the firmware upgrade file is a binary file that can include file headers, firmware data, and verification information.
  • the format of the firmware upgrade file is the same as that of the existing binary file, which is not described in this embodiment.
  • Step 402 Write the firmware upgrade file into the SD memory.
  • Step 403 After the firmware upgrade file is all written to the SD memory, the upgrade start command in the mobile terminal is written into the command exchange file, and the upgrade start command is obtained by the communication device of the SD interface.
  • Firmware upgrade After the firmware upgrade file is all written to the SD memory, the mobile terminal further writes an upgrade start command in the command exchange file.
  • the communication device of the SD interface knows that the upgrade command is stored in the command exchange file by identifying the file name, and the communication device of the SD interface polls the command upgrade file to obtain the information after the upgrade start command is written. Upgrade start command.
  • the polling command upgrade file refers to whether a complete upgrade start command has been written in the periodic query command upgrade file.
  • the communication device of the SD interface After the communication device of the SD interface obtains the upgrade start command, indicating that the communication device of the SD interface starts the firmware upgrade, the communication device of the SD interface further obtains the firmware upgrade file, and writes the firmware upgrade file to the flash memory to complete Firmware upgrade. It should be noted that the firmware upgrade file is written better than the upgrade start command write to ensure the integrity of the firmware upgrade file written to the SD memory, thereby avoiding the firmware upgrade file in the SD memory when the upgrade start command is executed. Incomplete, resulting in an upgrade failure.
  • the mobile terminal further writes an upgrade status query command to the command exchange file. When the communication device of the SD interface obtains the upgrade status query command, the result exchange file is sent to the mobile terminal.
  • the upgrade progress and the upgrade result are written in the result exchange file, so the mobile terminal can display the upgrade progress and the upgrade result on the mobile terminal in receiving the result exchange file.
  • the mobile terminal can periodically write the upgrade status query command to the command exchange file during each firmware upgrade process.
  • the communication device of the SD interface obtains the upgrade status query command, it will send the write upgrade progress.
  • the result is to exchange files to the mobile terminal so that the mobile terminal can monitor the progress of the upgrade in real time.
  • the communication device of the SD interface obtains the last upgrade status query command of the firmware upgrade process
  • the result exchange file with the final upgrade progress and the upgrade result may be sent to the mobile terminal, thereby displaying the final upgrade on the mobile terminal. result.
  • the upgrade start command and the upgrade status query command may be written by using a SCSI command
  • the SCSI command format may refer to the firmware upgrade method described on the communication device side of the SD interface. No longer introduced.
  • the format of the command exchange file and the result exchange file can be arbitrarily customized.
  • the command exchange file and the result exchange file can be in the format of the existing binary file.
  • this embodiment provides a firmware upgrading apparatus, where the firmware upgrading apparatus is applied to a communication device of an SD interface that performs data communication with a mobile terminal through an SD interface, and
  • the communication device of the SD interface includes an SD memory and a flash memory, wherein the SD memory stores a command exchange file, wherein the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the flash memory is Refers to a memory that stores firmware inside the communication device of the SD interface.
  • Firmware is the program code written to EPROM or EROM. It should be noted that the mobile terminal that performs data communication with the communication device of the SD interface cannot directly access the flash memory, so the mobile terminal cannot directly change the data in the flash memory.
  • the SD memory and the flash memory can be two different chips on the physical hardware, or one chip can be shared.
  • the SD interface does not support the SDIO function.
  • the mobile terminal can only read and write data in the SD memory in units of files, so a special file can be defined in the SD memory for
  • the upgrade start command and the upgrade data are stored in different files, so that the communication device of the SD interface can know that the data in the file is the upgrade start by identifying the file name.
  • the special files of the SD memory are respectively a special file of a command exchange file and a firmware upgrade file.
  • the command exchange file described in the two special files stores an upgrade start command written by the mobile terminal, and the firmware upgrade file stores To upgrade the data, the communication device of the SD interface obtains the data required for the firmware upgrade process in the corresponding file.
  • the first obtaining unit 11 is configured to acquire an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file.
  • the upgrade start command is written to the command exchange file.
  • the upgrade start command indicates that the firmware in the communication device of the SD interface needs to be upgraded.
  • the firmware upgrade is started.
  • the format of the command exchange file is arbitrarily customized, for example, the command exchange file is defined as a binary file.
  • the upgrade start command in the command exchange file can be written to the command exchange file by the mobile terminal through a SCSI (Small Computer System Interface) command.
  • SCSI Small Computer System Interface
  • the reading unit 12 is configured to read, from the SD memory, a firmware upgrade file in which the upgrade data is stored after the upgrade start command is acquired.
  • the firmware upgrade file is downloaded by the mobile terminal and written by the mobile terminal into the SD memory.
  • the upgrade data contains the program code of the firmware of the communication device used to upgrade the SD interface.
  • the firmware upgrade file is a binary file that can include file headers, firmware data, and checksum information.
  • the format of the firmware upgrade file is the same as that of the existing binary file, which is not described in this embodiment.
  • the mobile terminal After the firmware upgrade file is completely written, the mobile terminal writes the upgrade start command to the command exchange file of the SD memory to ensure that the firmware upgrade file of the SD interface is all written to the SD memory when the firmware upgrade is started. , to avoid the upgrade failure due to incomplete upgrade data in the file.
  • the first writing unit 13 is configured to write the firmware upgrade file into the flash memory.
  • the firmware upgrade principle is to write the program code in the new firmware upgrade file into the flash memory, and overwrite the program code stored in the flash memory that is read when the communication device of the SD interface is started.
  • the first write unit further writes the firmware upgrade file to the flash memory to change the previously saved program code in the flash memory to the current write to the flash memory.
  • the program code in the firmware upgrade file completes the firmware upgrade of the communication device of the SD interface.
  • the communication device of the SD interface and the mobile terminal perform data communication
  • different files have different data, so that the mobile terminal can write different data into the corresponding file by identifying the file name, and the communication device of the SD interface can be identified.
  • the file name knowing whether the data written by the mobile terminal is an upgrade start command or an upgrade data.
  • the communication device of the SD interface obtains the upgrade start command in the command exchange file, indicating that the communication device of the SD interface starts to perform the firmware upgrade
  • the communication device of the SD interface further reads the firmware storing the upgrade data from the secure digital storage. Upgrade the file, and then write the firmware upgrade file to the flash memory to complete the firmware upgrade.
  • Embodiment 6 Corresponding to the method embodiment shown in the foregoing Embodiment 2, the embodiment of the present application provides another firmware upgrading apparatus, which is shown in FIG. 6 and may include: The unit 12, the first writing unit 13, the second writing unit 14, and the third writing unit 15 are taken.
  • the first obtaining unit 11 is configured to obtain an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file.
  • the reading unit 12 is configured to read, from the SD memory, a firmware upgrade file in which the upgrade data is stored after the upgrade start command is acquired.
  • the firmware upgrade file is downloaded by the mobile terminal and written by the mobile terminal into the SD memory. Upgrade data included to upgrade SD The program code of the firmware of the communication device of the interface.
  • the first writing unit 13 is configured to write the firmware upgrade file into the flash memory.
  • the specific functions and implementations of the first obtaining unit 11, the reading unit 12, and the first writing unit 13 refer to the detailed description in the firmware upgrading apparatus shown in Embodiment 5, and this embodiment does not Then force p to elaborate.
  • the second writing unit 14 is configured to write an upgrade progress to the result exchange file during writing of the firmware upgrade file to the flash memory.
  • the third writing unit 15 is configured to write the upgrade result into the result exchange file after writing the firmware upgrade file to the flash memory.
  • the progress of the upgrade indicates the progress of the current firmware upgrade file written to the flash memory, such as the percentage of the file size written to the flash memory as a percentage of the total size of the firmware upgrade file to indicate the upgrade progress.
  • the upgrade results indicate the end result of the upgrade, such as a successful upgrade and an upgrade failure.
  • the communication device of the SD interface may indicate that the upgrade is successful or the upgrade fails with different identifiers.
  • the second writing unit 14 writes the upgrade progress to the result exchange file by a SCSI command.
  • the third writing unit 15 writes the upgrade result into the result exchange file by a SCSI command.
  • the second writing unit 14 can write the upgrade progress to the result exchange file
  • the third writing unit 15 can write the upgrade result into the result exchange file, so that the mobile terminal can identify the file name.
  • the result exchange file is obtained, the upgrade progress and the upgrade result are read from the result exchange file, and the firmware upgrade progress and status are displayed on the mobile terminal, thereby solving the problem that the communication device of the SD interface cannot display the firmware upgrade progress and status.
  • the specific process of the mobile terminal acquiring the result exchange file from the SD memory may be: after the communication device of the SD interface obtains the upgrade status query command in the command exchange file, the result exchange file is sent to the mobile terminal, where the upgrade status is The query is written by the mobile terminal to the command exchange file, which indicates that the mobile terminal needs to query the firmware upgrade status, and the communication device of the SD interface needs to send the result exchange file to the mobile terminal.
  • FIG. 7 another schematic structural diagram of the firmware upgrading apparatus provided in the embodiment 6 is shown on the basis of FIG. 6 , and further includes: a second acquiring unit 16 and a sending unit 17 .
  • the second obtaining unit 16 is configured to obtain an upgrade status query command in the command exchange file.
  • the sending unit 17 is configured to send the result exchange file to the mobile terminal after obtaining the upgrade status query command, where the upgrade progress and the upgrade result are written in the result exchange file.
  • the upgrade status query command is a command for the user to query the firmware upgrade process of the communication device of the SD interface.
  • the mobile terminal needs to query the firmware upgrade process, and the second obtaining unit 16 triggers the sending unit 17 to The resulting exchange file is sent to the mobile terminal.
  • the format of the upgrade status query command in this embodiment refer to the introduction in the firmware upgrade method shown in Embodiment 2, which will not be described again.
  • Embodiment 7 Corresponding to the method embodiment shown in the foregoing Embodiment 3, the embodiment of the present application provides another firmware upgrading apparatus, which is shown in FIG. 8 and may include: a first acquiring unit 11 and reading The unit 12, the first writing unit 13, and the deleting unit 18 are taken.
  • the first obtaining unit 11 is configured to acquire an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file.
  • the reading unit 12 is configured to read, from the SD memory, a firmware upgrade file in which the upgrade data is stored after the upgrade start command is acquired.
  • the firmware upgrade file is downloaded by the mobile terminal and written by the mobile terminal into the SD memory.
  • the upgrade data contains the program code of the firmware of the communication device used to upgrade the SD interface.
  • the first writing unit 13 is configured to write the firmware upgrade file into the flash memory.
  • the specific functions and implementations of the first obtaining unit 11, the reading unit 12, and the first writing unit 13 refer to the detailed description in the firmware upgrading apparatus shown in Embodiment 5, and this embodiment does not Then force P to elaborate.
  • a deleting unit 18, configured to write all the firmware upgrade files to the flash memory After that, the upgrade start command in the command upgrade file is deleted.
  • the firmware upgrading apparatus may further include: the second writing unit 14 and the third writing unit 15 in FIG. 6, and the second obtaining unit 16 and the transmitting unit 17 in FIG. 7, thereby upgrading the firmware.
  • the device can send the result exchange file to the mobile terminal.
  • the mobile terminal further reads the upgrade progress and the upgrade result from the result exchange file, and displays the firmware upgrade progress and status on the mobile terminal to solve the problem that the communication device of the SD interface cannot display the firmware upgrade progress and status.
  • Embodiment 8 Please refer to FIG. 9 , which is a schematic structural diagram of another firmware upgrading apparatus provided by an embodiment of the present application, which may include: a first acquiring unit 11, a reading unit 12, a first writing unit, and a starting unit. 19.
  • the first obtaining unit 11 is configured to obtain an upgrade start command in the command exchange file, where the upgrade start command is written by the mobile terminal into the command exchange file.
  • the startup unit 19 is configured to: after obtaining the upgrade start command, restart the communication device of the secure digital interface, enter an upgrade mode of the communication device of the secure digital interface, and be configured to write all the firmware upgrade files After the flash memory is restored, the communication device of the secure digital interface is restarted to enter a normal operation mode of the communication device of the secure digital interface.
  • the normal operation mode refers to an operation mode in which the operating system running on the communication device of the SD interface can provide various service functions for the user
  • the upgrade mode refers to the operation mode of the communication device running on the SD interface can be only for the user. Provides an operating mode for upgrading business functions.
  • the starting unit 19 can also be applied to the firmware upgrading apparatus shown in FIG. 5 to FIG. 8 above to control the working mode of the communication device of the SD interface, which is no longer used in this embodiment.
  • the schematic is described.
  • the reading unit 12 is specifically configured to read, from the secure digital storage, the firmware upgrade file storing the upgrade data in the upgrade mode.
  • the firmware upgrade file is downloaded by the mobile terminal and written by the mobile terminal into the SD memory.
  • the upgrade data contains the program code of the firmware of the communication device used to upgrade the SD interface.
  • the first writing unit 13 is configured to write the firmware upgrade file into the flash memory.
  • the specific functions and implementations of the first obtaining unit 11, the reading unit 12, and the first writing unit 13 refer to the detailed description in the firmware upgrading apparatus shown in Embodiment 5, and this embodiment does not Then force P to elaborate.
  • the first writing unit 13 is specifically configured to write the firmware upgrade file image into the flash memory, that is, the new program code in the firmware upgrade file overwrites the program code originally saved in the flash memory.
  • the firmware upgrade of the communication device of the SD interface is completed.
  • the firmware upgrading apparatus may further include: a verification unit, configured to verify the firmware upgrade file.
  • the reading unit 12 is specifically configured to read the firmware upgrade file storing the upgrade data from the SD memory after verifying that the firmware upgrade file is a legal file.
  • the verification unit verifies the firmware upgrade file to determine whether the firmware upgrade file is a legal file, so as to prevent the illegal operation of the SD interface communication device from being written in the flash memory, wherein the legal file indicates that the firmware upgrade file is usable. Files that have not been changed by users other than the carrier.
  • the verification unit can verify the firmware upgrade file by using the existing verification method, which is not described in this embodiment.
  • the firmware upgrading apparatus shown in any one of the above-mentioned structural diagrams of FIG. 5 to FIG.
  • the communication device of the SD interface includes an SD memory and a flash memory, wherein the firmware upgrading apparatus respectively
  • the SD memory and the flash memory perform data communication, wherein the SD memory stores a command exchange file, the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the flash memory refers to the SD interface
  • the memory of the firmware is stored inside the letter device.
  • Embodiment 9 Referring to FIG. 10, which is a schematic structural diagram of another firmware upgrading apparatus provided by an embodiment of the present application, the firmware upgrading apparatus is applied to a data communication mobile terminal through a SD interface and a communication device of an SD interface,
  • the communication device of the SD interface includes an SD memory and a flash memory, wherein the SD memory stores a command exchange file, wherein the SD memory refers to a memory accessed by the mobile terminal through the SD interface, and the flash memory refers to a
  • the memory of the SD interface internally stores the memory of the firmware.
  • the firmware upgrading apparatus may include: a download unit 21, a fourth writing unit 22, and a fifth writing unit 23.
  • the download unit 21 is configured to download a firmware upgrade file in which the upgrade data is stored.
  • the mobile terminal detects whether the firmware program on the communication device of the SD interface is consistent with the version number of the firmware program of the communication device of the SD interface saved on the server. When it is detected that the version numbers are inconsistent, the SD interface is determined.
  • the firmware program of the communication device needs to be upgraded, and the download unit 21 downloads the firmware upgrade file storing the upgrade data from the server.
  • the firmware upgrade file is a binary file that can include file headers, firmware data, and checksum information.
  • the format of the firmware upgrade file in this embodiment is the same as that of the existing binary file, which is not described in this embodiment.
  • the fourth writing unit 22 is configured to write the firmware upgrade file into the SD memory.
  • a fifth writing unit 23, configured to: after the firmware upgrade file is all written to the SD memory, write an upgrade start command in the mobile terminal to the command exchange file, and obtain the communication device of the SD interface The upgrade start command performs a firmware upgrade.
  • the fifth writing unit 23 further writes an upgrade start command in the command exchange file.
  • the communication device of the SD interface knows that the upgrade command is stored in the command exchange file by identifying the file name, and the communication device of the SD interface polls the command upgrade file to obtain the location after the upgrade start command is written.
  • the upgrade start command refers to whether a complete upgrade start command has been written in the periodic query command upgrade file.
  • the communication device of the SD interface obtains the upgrade start command, indicating that the communication device of the SD interface starts the firmware upgrade
  • the communication device of the SD interface further obtains the firmware upgrade file, and writes the firmware upgrade file to the flash memory to complete Firmware upgrade. How to perform the firmware upgrade of the communication device of the SD interface can be referred to the firmware upgrade method in the communication device applied to the SD interface, which will not be described in this embodiment.
  • Embodiment 10 Please refer to FIG. 11 , which is a schematic structural diagram of another firmware upgrading apparatus according to an embodiment of the present application.
  • the sixth writing unit 24 may be further configured to:
  • the upgrade status query command within is written to the command exchange file.
  • the upgrade status query command refers to the command to query the firmware upgrade process of the communication device of the SD interface.
  • the result exchange file with the upgrade progress and the upgrade result is sent to the mobile terminal, and the upgrade progress and the upgrade result are displayed on the mobile terminal to solve the SD interface.
  • the communication device does not include the problem that the firmware upgrade progress and status cannot be displayed due to the display.
  • the firmware upgrading apparatus shown in FIG. 12 may further include: a receiving unit 25 and a display unit 26 based on FIG.
  • a receiving unit 25 configured to receive a result exchange file sent by the communication device of the SD interface, where the result exchange file is sent after the communication device of the SD interface obtains an upgrade status query command, and the result exchange file is Write the upgrade progress and upgrade results;
  • the display unit 26 is configured to display the upgrade progress and the upgrade result on the mobile terminal.
  • the fifth writing unit 23 writes the upgrade start command into the command exchange file by a SCSI command.
  • the sixth writing unit 24 writes the upgrade status query command to the command exchange file by using a SCSI command.
  • the embodiment of the present application further provides a mobile terminal, where the mobile terminal includes: firmware upgrade
  • the firmware upgrading apparatus For a schematic diagram of the structure of the firmware upgrading apparatus, reference may be made to any structure diagram of FIG. 10 to FIG. 12, and the firmware upgrading apparatus is not described in detail in this embodiment.
  • the embodiment of the present application further provides a communication device of an SD interface, where only the SD interface 21 is provided on the communication device of the SD interface, including an SD memory 22, a flash memory 23, a processor 24, and an SD interface controller 25. See Figure 13 for a schematic diagram of its structure. among them:
  • the SD interface 21 connects the communication device and the mobile terminal of the SD interface through an SD bus, and data communication between the communication device of the SD interface and the mobile terminal is under the control of the SD interface controller 25 on the SD bus Transfer on.
  • the SD bus refers to a communication device of the SD interface conforming to the SD interface specification and a hardware bus of the mobile terminal.
  • the processor 24 is configured to obtain an upgrade start command from the command exchange file in the SD memory 22, and after obtaining the upgrade start command, read the firmware upgrade file from the SD memory 22, and the firmware is An upgrade file is written in the flash memory 23 to upgrade the firmware in the communication device of the SD interface.
  • an SD interface is also disposed on the mobile terminal connected to the communication device of the SD interface, and the SD interface is connected to the SD interface on the communication device of the SD interface through the SD bus, and the SD interface controller is in the mobile terminal. Data communication under control.
  • a schematic diagram of the connection between the communication device of the SD interface and the mobile terminal is shown in Fig. 14.
  • the structure of the partial structure of the mobile terminal and the communication device of the SD interface are shown in Fig. 14.
  • the SD bus connected to the SD interface between the mobile terminal and the communication device of the SD interface establishes a connection under the action of the internal SD interface controllers.
  • the mobile terminal writes the firmware upgrade file to the SD memory 22 via the SD bus connected to the SD interface.
  • the mobile terminal writes the upgrade start command to the command exchange file in the SD memory 22.
  • the processor 24 knows that the upgrade command is stored in the command exchange file by recognizing the file name, and the processor 24 polls the command exchange file to acquire the upgrade start command after the upgrade start command is written.
  • the firmware upgrade file is read from the SD memory 22, and the firmware upgrade file is written into the flash memory 23 to be upgraded.
  • Firmware in the communication device of the SD interface is read from the SD memory 22, and the firmware upgrade file is written into the flash memory 23 to be upgraded.
  • the processor 24 may further write the upgrade progress and the upgrade result to the result exchange file of the SD memory 22. And after the processor 24 reads the upgrade status query command in the command exchange file, the upgrade progress and the upgrade result are read from the result exchange file, and the upgrade progress and the upgrade result are sent to the mobile terminal.
  • the mobile terminal can display the upgrade progress and the upgrade result to realize human-computer interaction.
  • the upgrade status query command is written by the mobile terminal to the command exchange file of the SD memory 22.
  • the upgrade start command, the upgrade status query command, the upgrade progress, and the upgrade result can be written by using different SCSI commands. For details, refer to the related description in the method embodiment, which is not described in this embodiment.
  • the processor 24 is further configured to, after writing the firmware upgrade file to the flash memory, Delete the upgrade start command written in the command upgrade file.
  • the communication device of the SD interface needs to be performed in the upgrade mode during the actual upgrade process, and the communication device of the SD interface runs in the normal operation mode after being powered on, so the processor 24 is further configured to: after obtaining the upgrade start command Resetting the communication device of the SD interface, converting the communication device of the SD interface from the normal operation mode to the upgrade mode, and performing the firmware upgrade file from the SD memory 22 in the upgrade mode, and The firmware upgrade file is written in the flash memory 23.
  • the processor 24 is further configured to restart the communication device of the SD interface, so that the communication device of the SD interface is converted from the upgrade mode to the normal operation mode. To ensure that the mobile terminal can use the communication device of the SD interface normally.
  • the processor 24 is specifically configured to write the firmware upgrade file image into the flash memory, that is, the new firmware program in the firmware upgrade file overwrites the firmware program originally saved in the flash memory.
  • the firmware upgrade of the SD interface communication device is completed.
  • the communication device of the SD interface is running again, the new firmware program in the flash memory can be directly run.
  • the processor 24 After the firmware upgrade file is all written to the SD memory 22, the processor 24 further verifies the firmware upgrade file before obtaining the upgrade start command, and after verifying that the firmware upgrade file is a legal file, acquire the The upgrade start command is used to prevent the illegal file from being written in the flash memory, which causes the communication device of the SD interface to run incorrectly.
  • the legal file indicates that the firmware upgrade file is usable and has not been changed by users other than the operator. file. It should be noted that: after the firmware upgrade file is all written into the SD memory, the mobile terminal writes the upgrade start command to the command exchange file, that is, the firmware upgrade file is written better than the upgrade start command write to ensure the firmware.
  • the upgrade file can be completely written to the SD memory 22, thereby ensuring the integrity of the firmware upgrade file written in the SD memory 22, so as to avoid the firmware upgrade file in the SD memory 22 being incomplete and failing to upgrade when the upgrade start command is executed. The situation happened.
  • FIG. 15 The schematic diagram of the software integrated in the communication device of the SD interface shown in FIG. 13 is shown in FIG. 15, wherein the software integrated in the communication device of the SD interface includes an upgrade service program, a file system, an SD interface driver, and a Flash driver. program.
  • the SD interface driver is integrated in the SD interface controller 25, and the upgrade program, the file system and the Flash driver are integrated in the processor 24.
  • the upgrade service program completes the reading of the firmware upgrade file and the access and update of the command exchange file and the result exchange file through the file system.
  • the file system obtains the file information in the SD memory 22 through the SD interface driver, and completes the data access to the SD memory 22 through the SD interface driver.
  • the upgrade service program writes the firmware upgrade file to the flash memory 23 through the Flash driver to complete the firmware upgrade.
  • the software on the mobile terminal includes a firmware upgrade program and an SD interface driver, wherein the firmware upgrade program includes a firmware upgrade file, and is written into the SD memory 22 in the communication device of the SD interface through the SD interface driver, and the SD interface driver Supported by the operating system within the mobile terminal.
  • the specific process of information interaction between the communication device of the SD interface and the software of the mobile terminal in the process of upgrading the communication device of the SD interface is as follows:
  • the firmware upgrade program on the mobile terminal creates a command exchange file and a result exchange file on the SD memory 22 through the SCSI command, downloads the firmware upgrade file, and drives through the SD interface driver on the mobile terminal and the SD interface on the communication device of the SD interface.
  • the program writes the firmware upgrade file to the SD memory 22 in the communication device of the SD interface.
  • the firmware upgrade process is started, the firmware upgrade program writes the upgrade start command in the command exchange file through the SCSI command, and the upgrade service program on the communication device of the SD interface queries the command exchange.
  • the upgrade service program will check the legality of the firmware upgrade file saved in the SD memory 22. After checking that the firmware upgrade file is legal, the file system and the SD interface driver start to read the firmware upgrade file and pass the file. The flash driver is written in the flash memory 23. After the firmware upgrade program on the mobile terminal starts the firmware upgrade, it will periodically write the upgrade status query command to the command exchange file through the SCSI command. The upgrade service program on the SD interface communication device will write the upgrade progress and upgrade result through the SCSI command.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a storage medium such as a ROM/RAM, a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请提供了一种固件升级方法、装置、设备及移动终端。其中一种固件升级方法,包括:获取升级开始命令;在获取到升级开始命令后,从安全数码存储器中读取固件升级文件;将固件升级文件写入到Flash存储器中。当SD 接口不支持SDIO功能时,移动终端和SD接口的通信设备只能以文件为单位读写安全数码存储器中的数据。本申请中,安全数码存储器中定义特殊文件,用于将升级开始命令和升级数据存储至不同文件中,使移动终端和SD接口的通信设备可以通过识别文件名称,获知文件中所存储的数据是升级开始命令还是升级数据,从而SD接口的通信设备可以从命令交换文件中获取升级开始命令,在固件升级过程中获取固件升级文件进行升级。

Description

一种固件升级方法、 装置及通信设备
本申请要求于 2013 年 6 月 8 日提交中国专利局、 申请号为 201310228240.2、 发明名称为"一种固件升级方法、 装置及通信设备"的中国 专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本申请涉及设备升级技术领域,特别涉及一种固件升级方法、装置及通信 设备。 背景技术
目前, 很多移动终端都具有 SD ( Security Digital, 安全数码)接口, 使移 动终端可以支持 SD卡。 由于 SD卡具有体积小, 存储容量大以及即插即用的 特点, SD卡通常作为移动终端的外部存储设备存储数据。 并且移动终端可以 利用 SD卡进行固件升级。
其中移动终端利用 SD卡进行固件升级的过程可以是: 将固件升级文件拷 贝到 SD卡后, 将 SD卡插入到 SD接口中,使 SD卡连接移动终端。移动终端 读取 SD卡中的固件升级文件对移动终端自身的软件升级。
移动终端还可以将 SD接口的通信设备插入到 SD接口中, SD接口的通信 设备本身可以支持接入 2G ( Second Generation, 第二代移动通信技术), 3G ( Third Generation, 第三代移动通信技术)或无线网络, 因此移动终端可以通 过 SD接口的通信设备进行无线上网。
当 SD接口支持 SDIO ( Secure Digital Input and Output, 安全数码输入输 出)功能时, SD接口的通信设备可以将移动终端内的固件升级文件写入到自 身的 SD存储器中, 当 SD接口的通信设备读取到移动终端内的升级开始命令 后, 运行 SD存储器中的固件升级文件完成固件升级。
然而部分 SD接口不支持 SDIO功能, SD接口的通信设备无法通过 SD接 口获知自身从移动终端内读取的数据是否是升级开始命令, 进而 SD接口的通 信设备无法启动固件升级。 发明内容 本申请所要解决的技术问题是提供一种固件升级方法,用以解决现有技术 中当 SD接口不支持 SDIO功能时, 插入到 SD接口的 SD接口的通信设备无法启 动固件升级的问题。
本申请还提供了一种通信设备升级装置及通信设备,用以保证上述方法在 实际中的实现及应用。
第一方面, 本申请提供了一种固件升级方法,应用于安全数码接口的通信 设备,所述安全数码接口的通信设备通过安全数码接口与移动终端进行数据通 信, 所述安全数码接口的通信设备包括安全数码存储器和 Flash存储器, 所述 安全数码存储器中存储有命令交换文件 ,其中所述安全数码存储器是指所述移 动终端通过所述安全数码接口访问的存储器, 所述 Flash存储器是指所述安全 数码接口的通信设备内部保存固件的存储器, 所述方法包括:
获取所述命令交换文件中的升级开始命令,其中所述升级开始命令由所述 移动终端写入到所述命令交换文件中;
在获取到所述升级开始命令后 ,从所述安全数码存储器中读取存储有升级 数据的固件升级文件,其中所述固件升级文件由移动终端下载并由所述移动终 端写入到所述安全数码存储器中 ,所述升级数据包含有用于升级安全数码接口 的通信设备的固件的程序代码;
将所述固件升级文件写入到所述 Flash存储器中。
在第一方面的第一种可能实现中,所述安全数码存储器还存储有结果交换 文件, 所述方法还包括: 在将所述固件升级文件写入所述 Flash存储器的过程 中, 将升级进度写入到所述结果交换文件中;
在将所述固件升级文件写入所述 Flash存储器之后, 将所述升级结果写入 到所述结果交换文件中。
结合第一方面的第一种可能实现方式,在第一方面的第二种可能实现方式 中,通过小型计算机系统接口命令将所述升级进度和升级结果写入到所述结果 交换文件中。
结合第一方面的第一种可能实现方式,在第一方面的第三种可能实现方式 中, 所述方法还包括:
获取所述命令交换文件中的升级状态查询命令;
在获取到所述升级状态查询命令后,将所述结果交换文件发送至所述移动 终端, 其中所述结果交换文件中写入有所述升级进度和升级结果。
在第一方面的第四种可能实现中,还包括在将所述固件升级文件全部写入 到所述 Flash存储器后, 删除所述命令升级文件中的所述升级开始命令。
结合第一方面的第一种可能实现方式至第四种可能实现方式中的任意一 种可能实现方式, 在第一方面的第五种可能实现方式中, 所述方法还包括: 在 获取到所述升级开始命令后, 重启所述安全数码接口的通信设备, 进入安全数 码接口的通信设备的升级模式, 并在升级模式下,从所述安全数码存储器中读 取存储有升级数据的所述固件升级文件;
在将所述固件升级文件全部写入到所述 Flash存储器后, 重启所述安全数 码接口的通信设备, 进入所述安全数码接口的通信设备的普通运行模式。
结合第一方面的第一种可能实现方式至第四种可能实现方式中的任意一 种可能实现方式, 在第一方面的第六种可能实现方式中,从所述安全数码存储 器中读取存储有升级数据的固件升级文件前,还包括:校验所述固件升级文件; 在校验出所述固件升级文件为合法文件后 ,从所述安全数码存储器中读取 存储有升级数据的固件升级文件。
第二方面, 本申请提供了一种固件升级方法, 应用于移动终端, 所述移动 终端通过安全数码接口与安全数码接口的通信设备进行数据通信,所述安全数 码接口的通信设备包括安全数码存储器和 Flash存储器, 所述安全数码存储器 中存储有命令交换文件,其中所述安全数码存储器是指所述移动终端通过所述 安全数码接口访问的存储器, 所述 Flash存储器是指所述安全数码接口的通信 设备内部保存固件的存储器, 所述方法包括:
下载存储有升级数据的固件升级文件;
将所述固件升级文件写入到所述安全数码存储器中;
在固件升级文件全部写入到所述安全数码存储器后,将移动终端内的升级 开始命令写入到所述命令交换文件中,由所述安全数码接口的通信设备获取所 述升级开始命令进行固件升级。
在第二方面的第一种可能实现方式中, 所述方法还包括: 将移动终端内的 升级状态查询命令写入到所述命令交换文件中。
结合第二方面的第一种可能实现方式,在第二方面的第二种可能实现方式 中, 所述安全数码存储器中还存储有结果交换文件, 所述方法还包括: 接收所 述安全数码接口的通信设备发送的结果交换文件,其中所述结果交换文件在所 述安全数码接口的通信设备获取到升级状态查询命令后发送,并且所述结果交 换文件中写入有所述升级进度和升级结果;
在所述移动终端上显示所述升级进度和升级结果。
结合第二方面的第一种可能实现方式,在第二方面的第三种可能实现方式 中,通过小型计算机系统接口命令将所述升级开始命令和升级状态查询命令写 入到所述命令交换文件中。
第三方面, 本申请还提供一种固件升级装置,应用于安全数码接口的通信 设备,所述安全数码接口的通信设备通过安全数码接口与移动终端进行数据通 信, 所述安全数码接口的通信设备包括安全数码存储器和 Flash存储器, 所述 安全数码存储器中存储有命令交换文件 ,其中所述安全数码存储器是指所述移 动终端通过所述安全数码接口访问的存储器, 所述 Flash存储器是指所述安全 数码接口的通信设备内部保存固件的存储器, 所述装置包括:
第一获取单元,用于获取所述命令交换文件中的升级开始命令, 其中所述 升级开始命令由所述移动终端写入到所述命令交换文件中;
读取单元, 用于在获取到所述升级开始命令后,从所述安全数码存储器中 读取存储有升级数据的固件升级文件,其中所述固件升级文件由移动终端下载 并由所述移动终端写入到所述安全数码存储器中,所述升级数据包含有用于升 级安全数码接口的通信设备的固件的程序代码;
第一写入单元, 用于将所述固件升级文件写入到所述 Flash存储器中。 在第三方面的第一种可能实现中,所述安全数码存储器还存储有结果交换 文件, 所述装置还包括: 第二写入单元, 用于在将所述固件升级文件写入所述 Flash存储器的过程中, 将升级进度写入到所述结果交换文件中;
第三写入单元, 用于在将所述固件升级文件写入所述 Flash存储器之后, 将所述升级结果写入到所述结果交换文件中。
结合第三方面的第一种可能实现方式,在第三方面的第二种可能实现方式 中,所述第二写入单元通过小型计算机系统接口命令将所述升级进度写入到所 述结果交换文件中;
所述第三写入单元通过小型计算机系统接口命令将所述升级结果写入到 所述结果交换文件中。 结合第三方面的第一种可能实现方式,在第三方面的第三种可能实现方式 中, 所述装置还包括:
第二获取单元, 用于获取所述命令交换文件中的升级状态查询命令; 发送单元, 用于在获取到所述升级状态查询命令后,将所述结果交换文件 发送至所述移动终端,其中所述结果交换文件中写入有所述升级进度和升级结 果。
在第三方面的第四种可能实现中, 所述装置还包括删除单元, 用于在将所 述固件升级文件全部写入到所述 Flash存储器后, 删除所述命令升级文件中的 所述升级开始命令。
结合第三方面的第一种可能实现方式至第四种可能实现方式中的任意一 种可能实现方式, 在第三方面的第五种可能实现方式中, 所述装置还包括: 启 动单元, 用于在获取到所述升级开始命令后, 重启所述安全数码接口的通信设 备, 进入安全数码接口的通信设备的升级模式, 以及用于在将所述固件升级文 件全部写入到所述 Flash存储器后, 重启所述安全数码接口的通信设备, 进入 所述安全数码接口的通信设备的普通运行模式;
所述读取单元具体用于在升级模式下,从所述安全数码存储器中读取存储 有升级数据的所述固件升级文件。
结合第三方面的第一种可能实现方式至第四种可能实现方式中的任意一 种可能实现方式, 在第三方面的第六种可能实现方式中, 所述装置还包括: 校 验单元, 用于校验所述固件升级文件;
所述读取单元具体用于在校验出所述固件升级文件为合法文件后,从所述 安全数码存储器中读取存储有升级数据的固件升级文件。
第四方面, 本申请还提供一种安全数码接口的通信设备, 所述安全数码接 口的通信设备包括安全数码存储器、 Flash存储器和如第三方面本申请提供的 所述固件升级装置,其中所述固件升级装置分别与所述安全数码存储器和所述 Flash存储器进行数据通信, 所述安全数码存储器中存储有命令交换文件, 所 述安全数码存储器是指所述移动终端通过所述安全数码接口访问的存储器 ,所 述 Flash存储器是指所述安全数码接口的通信设备内部保存固件的存储器。
第五方面, 本申请还提供一种固件升级装置, 应用于移动终端, 所述移动 终端通过安全数码接口与安全数码接口的通信设备进行数据通信,所述安全数 码接口的通信设备包括安全数码存储器和 Flash存储器, 所述安全数码存储器 中存储有命令交换文件,其中所述安全数码存储器是指所述移动终端通过所述 安全数码接口访问的存储器, 所述 Flash存储器是指所述安全数码接口的通信 设备内部保存固件的存储器, 所述装置包括:
下载单元, 用于下载存储有升级数据的固件升级文件;
第四写入单元, 用于将所述固件升级文件写入到所述安全数码存储器中; 第五写入单元, 用于在固件升级文件全部写入到所述安全数码存储器后, 将移动终端内的升级开始命令写入到所述命令交换文件中,由所述安全数码接 口的通信设备获取所述升级开始命令进行固件升级。
在第五方面的第一种可能实现方式中, 所述装置还包括: 第六写入单元, 用于将移动终端内的升级状态查询命令写入到所述命令交换文件中。
结合第五方面的第一种可能实现方式中,在第五方面的第二种可能实现方 式中, 所述安全数码存储器中还存储有结果交换文件, 所述装置还包括: 接收 单元, 用于接收所述安全数码接口的通信设备发送的结果交换文件, 其中所述 结果交换文件在所述安全数码接口的通信设备获取到升级状态查询命令后发 送, 并且所述结果交换文件中写入有所述升级进度和升级结果;
显示单元, 用于在所述移动终端上显示所述升级进度和升级结果。
结合第五方面的第一种可能实现方式中,在第五方面的第三种可能实现方 式中,所述第五写入单元通过小型计算机系统接口命令将所述升级开始命令写 入到所述命令交换文件中;
所述第六写入单元通过小型计算机系统接口命令将所述升级状态查询命 令写入到所述命令交换文件中。
与现有技术相比, 本申请包括以下优点:
当 SD接口不支持 SDIO功能时,移动终端和 SD接口的通信设备只能以文件 为单位读写安全数码存储器中的数据, 本申请中, 安全数码存储器可以定义特 殊文件,用于将升级开始命令和升级数据存储至不同文件中,使移动终端和 SD 接口的通信设备可以通过识别文件名称,获知文件中所存储的数据是升级开始 命令还是升级数据。
在本申请中,安全数码存储器中存储有命令交换文件和固件升级文件这两 个特殊文件,这两个特殊文件中所述命令交换文件中存储有移动终端写入的升 级开始命令, 固件升级文件中存储有升级数据, SD接口的通信设备通过识别 文件名称可以在相应文件中获取固件升级过程所需数据。
当 SD接口的通信设备获取到命令交换文件中的升级开始命令时, 表明 SD 接口的通信设备开始执行固件升级, 则 SD接口的通信设备会进一步从安全数 码存储器中读取存储有升级数据的固件升级文件, 再将固件升级文件写入到 Flash存储器中, 完成固件升级。 附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所 需要使用的附图作简单地介绍,显而易见地, 下面描述中的附图仅仅是本申请 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提 下, 还可以根据这些附图获得其他的附图。
图 1是本申请提供的一种固件升级方法的一种流程图;
图 2是本申请提供的一种固件升级方法的另一种流程图;
图 3是本申请提供的一种固件升级方法的再一种流程图;
图 4是本申请提供的一种固件升级方法的再一种流程图;
图 5是本申请提供的一种固件升级装置的结构示意图;
图 6是本申请提供的另一种固件升级装置的结构示意图;
图 7是本申请提供的另一种固件升级装置的结构示意图;
图 8是本申请提供的另一种固件升级装置的结构示意图;
图 9是本申请提供的另一种固件升级装置的结构示意图;
图 10是本申请提供的另一种固件升级装置的结构示意图;
图 11是本申请提供的另一种固件升级装置的结构示意图;
图 12是本申请提供的另一种固件升级装置的结构示意图;
图 13是本申请提供的一种 SD接口的通信设备的结构示意图;
图 14是本申请提供的 SD接口的通信设备与移动终端连接的示意图; 图 15是本申请提供的 SD接口的通信设备内所集成软件的示意图; 图 16是本申请提供的 SD接口的通信设备与移动终端内所集成软件间信息 交互的示意图。 具体实施方式
本申请可用于众多通用或专用的计算装置环境或配置中。 例如: 个人计 算机、 服务器计算机、 手持设备或便携式设备、 平板型设备、 多处理器装 置、 包括以上任何装置或设备的分布式计算环境等等。 下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本申请一部分实施例, 而 不是全部的实施例。 基于本申请中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例, 都属于本申请保护的范围。
实施例 1 本申请实施例 1提供的固件升级方法应用于通过 SD接口与移动终端进行 数据通信的 SD接口的通信设备, 且所述 SD接口的通信设备包括 SD存储器 和 Flash存储器, 所述 SD存储器中存储有命令交换文件, 其中所述 SD存储 器是指所述移动终端通过所述 SD接口访问的存储器, 所述 Flash存储器是指 所述 SD 接口的通信设备内部保存固件的存储器。 固件是指写入 EPROM ( Erasable Programmable Read Only Memory, 可擦除可编程只读寄存器)或者 EROM ( Eraseable Read Only Memory,可擦只读存储器 ) 中的程序代码, 更简 单的说, 固件是 BIOS ( Basic Input Output System, 基本输入输出系统) 的软 件, 是固化在集成电路内部的程序代码, 负责控制和协调集成电路的功能。 在本申请实施例中, 移动终端不能直接访问 Flash存储器, 所以移动终端 不能直接更改 Flash存储器中的数据。 SD存储器和 Flash存储器在物理硬件上 可以是不同的两颗芯片, 也可以共用一颗芯片。 需要说明的是: 本申请实施例中的 SD接口不支持 SDIO功能, 当 SD接 口不支持 SDIO 功能时, 移动终端只能以文件为单位读写 SD存储器中的数 据, 因此 SD存储器中可以定义特殊文件, 用于将升级开始命令和升级数据存 储至不同文件中, 使 SD接口的通信设备可以通过识别文件名称, 获知文件中 的数据是升级开始命令还是升级数据。 其中 SD存储器的特殊文件分别是命令 交换文件和固件升级文件这两个特殊文件, 这两个特殊文件中所述命令交换 文件中存储有移动终端写入的升级开始命令, 固件升级文件中存储有升级数 据, SD接口的通信设备在相应文件中获取固件升级过程所需数据。 请参阅图 1 , 其示出了本申请实施例 1 提供的一种固件升级方法的流程 图, 可以包括以下步骤: 步骤 101 : 获取所述命令交换文件中的升级开始命令。 在本实施例中, 与 SD接口的通信设备进行数据通信的移动终端会检测 SD接口的通信设备上的固件程序与服务器上保存的 SD接口的通信设备的固 件程序的版本号是否一致, 当检测到版本号不一致时, 判定出 SD接口的通信 设备的固件程序需要升级, 移动终端将升级开始命令写入到命令交换文件 中。 命令交换文件的格式可以任意自定义, 例如将命令交换文件定义为二进 制文件。 命令交换文件中的升级开始命令可以由移动终端通过 SCSI ( Small Computer System Interface, 小型计算机系统接口)命令写入到命令交换文件 中。
SCSI命令将升级开始命令写入到命令交换文件中可以为: REQ 1 u。 其 中 REQ表示该命令是升级开始命令, 1是命令序号, u表示开始升级命令。 需要说明的是: 命令交换文件中可以写入多个升级开始命令。 为了区分 不同升级开始命令, 以不同命令序号标识升级开始命令。 如 REQ 1 u表示第 一次升级开始命令, REQ 2 u表示第二次升级开始命令。 本实施例仅列举了 一种写入升级开始命令的方式和一种升级开始命令的格式, 对于其他写入方 式和命令格式也属于本实施例保护范围, 对此本实施例不再——列举。 步骤 102: 在获取到所述升级开始命令后, 从所述 SD存储器中读取存储 有升级数据的固件升级文件, 其中所述固件升级文件由移动终端从服务器上下载并由所述移动终端写 入到所述 SD存储器中。 升级数据包含有用于升级 SD接口的通信设备的固件 的程序代码。
其中固件升级文件是一个二进制文件, 可以包括文件信息头, 固件数据 和校验信息。 在本实施例中固件升级文件的格式与现有二进制文件的格式相 同, 对此本实施例不再加以阐述。 当 SD接口的通信设备获取到升级开始命令后, 表明 SD接口的通信设备 开始进行固件升级, 则 SD接口的通信设备会从 SD存储器中获取固件升级文 件。 需要指出的是: 移动终端在检测到接口的通信设备上的固件程序与服务 器上保存的 SD接口的通信设备的固件程序的版本号不一致情况下, 首先下载 固件升级文件, 并将其写入到 SD存储器中。 移动终端在固件升级文件全部写 入后, 再将升级开始命令写入到 SD存储器的命令交换文件中, 以保证 SD接 口的通信设备在开始固件升级时, 固件升级文件已全部写入到 SD存储器, 避 免由于文件中升级数据不全导致升级失败。
步骤 103: 将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 固件升级原理是将新的固件升级文件中的程序代码写入 到 Flash存储器中, 覆盖 SD接口的通信设备之前启动时所读取的保存在 Flash 存储器中的程序代码, 因此 SD接口的通信设备在获取到固件升级文件后, 会 进一步将固件升级文件写入到 Flash存储器中, 以将 Flash存储器中之前保存 的程序代码更改为当前写入到 Flash存储器中固件升级文件中的程序代码, 完 成对 SD接口的通信设备的固件升级。 上述 SD接口的通信设备和移动终端在进行数据通信时, 不同文件中具有 不同数据, 从而移动终端可以通过识别文件名称, 将不同数据写入到对应的 文件中, SD接口的通信设备可以通过识别文件名称, 获知移动终端写入的数 据是升级开始命令还是升级数据。 当 SD接口的通信设备获取到命令交换文件 中的升级开始命令时, 表明 SD接口的通信设备开始执行固件升级, 则 SD接 口的通信设备会进一步从安全数码存储器中读取存储有升级数据的固件升级 文件, 再将固件升级文件写入到 Flash存储器中, 完成固件升级。 需要指出的是: 部分 SD接口可以支持 SDIO功能, 当移动终端和 SD接 口的通信设备之间用于数据通信的 SD接口支持 SDIO功能, 则 SD接口的通 信设备可以釆用本实施例提供的固件升级方法, 也可以釆用基于 SDIO功能的 现有固件升级方法。
实施例 2 上述实施例 1所阐述的固件升级方法解决了当 SD接口不支持 SDIO功能 时, SD接口的通信设备的固件升级问题, 但是由于 SD接口的通信设备上不 具有可用于人机交互的接口, 所以固件升级进度和状态无法在 SD接口的通信 设备中进行显示。 本申请实施例 2 提供的固件升级方法可以由移动终端显示 固件升级进度和状态。 本申请实施例 2所提供的固件升级方法应用于通过 SD接口与移动终端进 行数据通信的 SD接口的通信设备, 且所述 SD接口的通信设备包括 SD存储 器和 Flash存储器, 所述 SD存储器中存储有命令交换文件和结果交换文件, 其中所述 SD存储器是指所述移动终端通过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通信设备内部保存固件的存储器。 请参阅图 2 , 其示出了本申请实施例 2提供的一种固件升级方法的另一种 流程图, 可以包括以下步骤: 步骤 201 : 获取所述命令交换文件中的升级开始命令, 其中所述升级开 始命令由所述移动终端写入到所述命令交换文件中。 步骤 202: 在获取到所述升级开始命令后, 从所述 SD存储器中读取存储 有升级数据的固件升级文件, 其中所述固件升级文件由移动终端下载并由所 述移动终端写入到所述安全数码存储器中。 步骤 203: 将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 步骤 201至步骤 203的具体实施过程与步骤 101至步骤 103的具体实施过程相同, 对此本实施例不再加以阐述。 步骤 204: 在将所述固件升级文件写入所述 Flash存储器的过程中, 将升 级进度写入到所述结果交换文件中。 步骤 205: 在将所述固件升级文件写入所述 Flash存储器之后, 将所述升 级结果写入到所述结果交换文件中。 其中升级进度表明当前固件升级文件写入到 Flash存储器的进度, 如以写 入到 Flash存储器中文件大小占固件升级文件总大小的百分比来表明升级进 度。 升级结果表明升级的最终结果, 如升级成功和升级失败。 在本实施例 中, SD接口的通信设备可以以不同标识表明升级成功或升级失败。
在本实施例中, 升级进度和升级结果可以通过 SCSI命令写入到结果交换 文件中。 将升级进度写入到所述结果交换文件中的 SCSI命令可以为: RSQ 1 m% , 其中, 1 是命令序号, 与升级开始命令的命令序号对应, m%表示进 度。 SD接口的通信设备在每次进行固件升级时可以周期性更改升级进度。 将升级结果写入到所述结果交换文件中的 SCSI命令可以为: RSP l s, 其 中, 1是命令序号, 与升级开始命令的命令序号对应, s表示升级成功, 如果 升级失败, 则返回 f表示升级失败。 当移动终端查询固件升级状态时, 可以从 SD存储器中获取结果交换文 件。 当移动终端获取到结果交换文件后, 进而获取结果交换文件中的升级进 度和升级结果, 从而在移动终端上显示固件升级进度和状态, 以解决 SD接口 的通信设备不包括显示屏导致的无法显示固件升级进度和状态的问题。 从上 述可以看出, 本申请实施例 2 提供的固件升级方法在实现固件升级的同时, 还可以在移动终端上显示固件升级进度和状态。 移动终端从 SD存储器中获取结果交换文件的具体过程可以是: SD接口 的通信设备在获取到命令交换文件中升级状态查询命令后, 将所述结果交换 文件发送至所述移动终端, 其中升级状态查询由移动终端写入到命令交换文 件中, 其表明移动终端需要查询固件升级过程, 此时 SD接口的通信设备需要 发送结果交换文件至移动终端。
在本实施例中, 升级状态查询命令也可以通过 SCSI写入到命令交换文件 中, 如 REP 1 q。 其中 REP表示该命令是升级状态查询命令, 1是命令序号, u表示开始状态查询。 需要说明的是: 结果交换文件的格式可以任意自定义, 例如结果交换文 件可以釆用现有的二进制文件的格式。 结果交换文件中可以写入多个升级结 果。 为了区分不同升级结果, 升级结果以不同命令序号标识升级结果, 并且 杯 。 如 REQ 1 u表示 第一次升级开始命令, 其对应的升级结果可以为 RSP 1 s„ 而 REQ 2 u表示第 二次升级开始命令, 其对应的升级结果可以为 RSP 2 s。 本实施例仅列举了一 种写入升级状态查询命令的方式和一种升级状态查询命令的格式, 对于其他 写入方式和命令格式也属于本实施例保护范围, 对此本实施例不再——列 举。
实施例 3 请参阅图 3 , 其示出了本申请实施例 3提供的固件升级方法的再一种结构 示意图, 应用于通过 SD接口与移动终端进行数据通信的 SD接口的通信设 备, 且所述 SD接口的通信设备包括 SD存储器和 Flash存储器, 所述 SD存储 器中存储有命令交换文件, 其中所述 SD存储器是指所述移动终端通过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通信设备内部保 存固件的存储器。 上述图 3所示的固件升级方法可以包括以下步骤: 步骤 301 : 获取所述命令交换文件中的升级开始命令, 其中所述升级开 始命令由所述移动终端写入到所述命令交换文件中。 步骤 302: 在获取到所述升级开始命令后, 从所述安全数码存储器中读 取存储有升级数据的固件升级文件, 其中所述固件升级文件由移动终端下载 并由所述移动终端写入到所述安全数码存储器中。 步骤 303: 将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 步骤 301至步骤 303的具体实施过程与步骤 101至步骤 103的具体实施过程相同, 对此本实施例不再加以阐述。 步骤 304: 在将所述固件升级文件全部写入到所述 Flash存储器后, 删除 所述命令升级文件中的所述升级开始命令。
因为命令升级文件中可以写入多个升级开始命令, 所以为了避免下一次 升级时, 受上次升级后在命令交换文件中遗留的升级开始命令的干扰。 在将 所述固件升级文件全部写入到 Flash存储器后, 删除命令升级文件中写入的升 级开始命令。 当然, 应用上述图 3所示的固件升级方法的 SD接口的通信设备中, SD 存储器中还存储有结果交换文件, 所述结果交换文件中可以存储有升级进度 和升级结果, 并且该结果交换文件还可以发送到移动终端, 在移动终端上显 示升级进度和升级结果, 具体可以参阅图 2 所示的固件升级方法中的关于结 果交换文件的详细说明, 对此本实施例不再加以阐述。
上述所有方法实施例提供的固件升级方法需要在 SD接口的通信设备的升 级模式下进行, 而 SD接口的通信设备在开机后运行在普通运行模式下, 因此 当 SD接口的通信设备在获取到升级开始命令后, 需要重启所述安全数码接口 的通信设备, 进入安全数码接口的通信设备的升级模式, 然后在升级模式 下, 从所述安全数码存储器中读取存储有升级数据的所述固件升级文件。 在 将所述固件升级文件全部写入到所述 Flash存储器后, 重启所述安全数码接口 的通信设备, 进入所述安全数码接口的通信设备的普通运行模式。 其中普通运行模式是指 SD接口的通信设备所运行的操作系统可以为用户 提供各种业务功能的运行模式, 升级模式是指 SD接口的通信设备运行的操作 系统可以为用户仅提供升级业务功能的运行模式。 在上述所有方法实施例中, SD接口的通信设备在将固件升级文件写入 Flash存储器中可以包括: 将固件升级文件镜像写入 Flash存储器中, 即将固 件升级文件中新的程序代码覆盖 Flash存储器中原有保存的程序代码。 当新的 程序代码完整被写入到 Flash存储器中时, SD接口的通信设备的固件升级完 成。 当 SD接口的通信设备再次运行时, 则可以直接运行 Flash存储器中的新 的程序代码。
当然, 在上述所有实施例中, 固件升级文件全部写入到 SD存储器后,
SD接口的通信设备需要进一步校验固件升级文件, 以判断固件升级文件是否 为合法文件, 从而防止 Flash存储器中写入非法文件导致 SD接口的通信设备 运行出错现象的发生, 其中合法文件表明固件升级文件为可使用, 且未被除 运营商之外的其他用户更改的文件。 在本实施例中, SD接口的通信设备校验 固件升级文件时可以釆用现有校验方法进行校验, 对此本实施例不再加以阐 述。
上述所有方法实施例都是从 SD接口的通信设备一侧进行阐述, 下面从移 动终端侧介绍本申请实施例提供的固件升级方法。 实施例 4 本申请实施例 4 提供的固件升级方法, 应用于移动终端, 所述移动终端 通过 SD接口与 SD接口的通信设备进行数据通信, 所述 SD接口的通信设备 包括 SD存储器和 Flash存储器, 所述 SD存储器中存储有命令交换文件, 其 中所述 SD存储器是指所述移动终端通过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通信设备内部保存固件的存储器。 其中固件是指写入 EPROM或者 EROM中的程序。 在本申请实施例中 , 移动终端不能直接访问 Flash存储器, 所以移动终端不能直接更改 Flash存储 器中的数据。 SD 存储器和 Flash存储器在物理硬件上可以是不同的两颗芯 片, 也可以共用一颗芯片。
需要说明的是: 本申请实施例中的 SD接口不支持 SDIO功能, 当 SD接 口不支持 SDIO 功能时, 移动终端只能以文件为单位读写 SD存储器中的数 据, 因此 SD存储器中可以定义特殊文件, 用于将升级开始命令和升级数据存 储至不同文件中, 使 SD接口的通信设备可以获知文件中所存储的数据是升级 开始命令还是升级数据。 其中 SD存储器的特殊文件分别是命令交换文件和固 件升级文件这两个特殊文件, 移动终端可以将升级开始命令和升级数据分别 写入到这两个特殊文件中, 并且 SD接口的通信设备在相应文件中获取固件升 级过程所需数据。 请参阅图 4, 其示出了本申请实施例 4提供的一种固件升级方法的流程 图, 可以包括以下步骤: 步骤 401 : 下载存储有升级数据的固件升级文件。 在本实施例中, 移动终端会检测 SD接口的通信设备上的固件程序与服务 器上保存的 SD接口的通信设备的固件程序的版本号是否一致, 当检测到版本 号不一致时, 判定出 SD接口的通信设备的固件程序需要升级, 则移动终端从 服务器中下载存储有升级数据的固件升级文件。 其中固件升级文件是一个二进制文件, 可以包括文件信息头, 固件数据 和校验信息。 在本实施例中固件升级文件的格式与现有二进制文件的格式相 同, 对此本实施例不再加以阐述。 步骤 402: 将所述固件升级文件写入到所述 SD存储器中。 步骤 403: 在固件升级文件全部写入到所述 SD存储器后, 将移动终端内 的升级开始命令写入到所述命令交换文件中, 由所述 SD接口的通信设备获取 所述升级开始命令进行固件升级。 在固件升级文件全部写入到 SD存储器后, 移动终端进一步在命令交换文 件中写入升级开始命令。 SD接口的通信设备通过识别文件名称可知命令交换 文件中存储有升级开始命令, 则 SD接口的通信设备会轮询所述命令升级文 件, 以在所述升级开始命令写入完成后, 获取所述升级开始命令。 其中轮询 命令升级文件是指周期性查询命令升级文件中是否已经写入完整的升级开始 命令。
当 SD接口的通信设备获取到升级开始命令后, 表明 SD接口的通信设备 开始进行固件升级, 则 SD接口的通信设备会进一步获取固件升级文件, 并将 固件升级文件写入 Flash存储器中, 以完成固件升级。 需要说明的是, 固件升级文件的写入优于升级开始命令写入, 以保证写 入到 SD存储器中固件升级文件的完整性, 从而避免在升级开始命令执行时, SD存储器中的固件升级文件不完整而导致升级失败的情况发生。 此外, SD接口的通信设备在进行固件升级过程中, 移动终端还会进一步 将升级状态查询命令写入到所述命令交换文件中。 当 SD接口的通信设备获取 到升级状态查询命令时, 会将结果交换文件发送到移动终端上。 所述结果交 换文件中写入有所述升级进度和升级结果, 因此移动终端在接收到结果交换 文件中, 可以在移动终端上显示升级进度和升级结果。 其中移动终端可以在每个固件升级过程中, 周期性将升级状态查询命令 写入到命令交换文件中, 当 SD接口的通信设备每获取到升级状态查询命令 时, 都会发送写入有升级进度的结果交换文件至移动终端, 从而移动终端可 以实时监测升级进度。 当 SD接口的通信设备获取到一次固件升级过程的最后 一次升级状态查询命令时, 即可以发送写入有最终升级进度和升级结果的结 果交换文件至移动终端, 从而在移动终端上显示最终的升级结果。 需要说明的是: 在本实施例中升级开始命令和升级状态查询命令可以通 过 SCSI命令写入, 其 SCSI命令格式可以参阅从 SD接口的通信设备侧所阐述 的固件升级方法, 对此本实施例不再加以介绍。 命令交换文件和结果交换文 件的格式可以任意自定义, 例如命令交换文件和结果交换文件可以釆用现有 的二进制文件的格式。
实施例 5 与上述实施例 1 所示的方法实施例, 本实施例提供了一种固件升级装 置, 所述固件升级装置应用于通过 SD接口与移动终端进行数据通信的 SD接 口的通信设备, 且所述 SD接口的通信设备包括 SD存储器和 Flash存储器, 所述 SD存储器中存储有命令交换文件, 其中所述 SD存储器是指所述移动终 端通过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通 信设备内部保存固件的存储器。 固件是指写入 EPROM或者 EROM中的程序 代码。 需要说明的是: 与 SD接口的通信设备进行数据通信的移动终端不能直接 访问 Flash存储器, 所以移动终端不能直接更改 Flash存储器中的数据。 SD存 储器和 Flash存储器在物理硬件上可以是不同的两颗芯片, 也可以共用一颗芯 片。
在本实施例中, SD接口不支持 SDIO功能, 当 SD接口不支持 SDIO功能 时, 移动终端只能以文件为单位读写 SD存储器中的数据, 因此 SD存储器中 可以定义特殊文件, 用于将升级开始命令和升级数据存储至不同文件中, 使 SD接口的通信设备可以通过识别文件名称, 获知文件中的数据是升级开始命 令还是升级数据。 其中 SD存储器的特殊文件分别是命令交换文件和固件升级 文件这两个特殊文件, 这两个特殊文件中所述命令交换文件中存储有移动终 端写入的升级开始命令, 固件升级文件中存储有升级数据, SD接口的通信 设备在相应文件中获取固件升级过程所需数据。 请参阅图 5 , 其示出了本申请实施例提供的一种固件升级装置的一种结 构示意图, 可以包括: 第一获取单元 11、 读取单元 12和第一写入单元 13。 第一获取单元 11 , 用于获取所述命令交换文件中的升级开始命令, 其中 所述升级开始命令由所述移动终端写入到所述命令交换文件中。 当移动终端检测到接口的通信设备上的固件程序与服务器上保存的 SD接 口的通信设备的固件程序的版本号不一致时, 判定出 SD接口的通信设备的固 件程序需要升级, 移动终端则会将升级开始命令写入到命令交换文件中。 其 中升级开始命令表明 SD接口的通信设备中固件需要升级, 当第一获取单元 11获取到该升级开始命令, 开启固件升级。 命令交换文件的格式任意自定义, 例如将命令交换文件定义为二进制文 件。 命令交换文件中的升级开始命令可以由移动终端通过 SCSI ( Small Computer System Interface, 小型计算机系统接口)命令写入到命令交换文件 中, 具体格式可以参阅实施例 1中所列举的命令格式。 读取单元 12, 用于在获取到所述升级开始命令后, 从所述 SD存储器中 读取存储有升级数据的固件升级文件。 其中所述固件升级文件由移动终端下载并由所述移动终端写入到所述 SD 存储器中。 升级数据包含有用于升级 SD接口的通信设备的固件的程序代码。 固件升级文件是一个二进制文件, 可以包括文件信息头, 固件数据和校验信 息。 在本实施例中固件升级文件的格式与现有二进制文件的格式相同, 对此 本实施例不再加以阐述。 当读取单元 12获取到升级开始命令后, 表明 SD接口的通信设备开始进 行固件升级, 则 SD接口的通信设备会从 SD存储器中获取固件升级文件。 需要指出的是: 移动终端在检测到接口的通信设备上的固件程序与服务 器上保存的 SD接口的通信设备的固件程序的版本号不一致情况下, 首先下载 固件升级文件, 并将其写入到 SD存储器中。 移动终端在固件升级文件全部写 入后, 再将升级开始命令写入到 SD存储器的命令交换文件中, 以保证 SD接 口的通信设备在开始固件升级时, 固件升级文件已全部写入到 SD存储器, 避 免由于文件中升级数据不全导致升级失败。
第一写入单元 13 , 用于将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 固件升级原理是将新的固件升级文件中的程序代码写入 到 Flash存储器中, 覆盖 SD接口的通信设备之前启动时所读取的保存在 Flash 存储器中的程序代码, 因此读取单元 12在获取到固件升级文件后, 会由第一 写入单元进一步将固件升级文件写入到 Flash存储器中, 以将 Flash存储器中 之前保存的程序代码更改为当前写入到 Flash存储器中固件升级文件中的程序 代码, 完成对 SD接口的通信设备的固件升级。
上述 SD接口的通信设备和移动终端在进行数据通信时, 不同文件中具有 不同数据, 从而移动终端可以通过识别文件名称, 将不同数据写入到对应的 文件中, SD接口的通信设备可以通过识别文件名称, 获知移动终端写入的数 据是升级开始命令还是升级数据。 当 SD接口的通信设备获取到命令交换文件 中的升级开始命令时, 表明 SD接口的通信设备开始执行固件升级, 则 SD接 口的通信设备会进一步从安全数码存储器中读取存储有升级数据的固件升级 文件, 再将固件升级文件写入到 Flash存储器中, 完成固件升级。
实施例 6 与上述实施例 2 所示的方法实施例相对应, 本申请实施例提供了另一种 固件升级装置, 其结构示意图请参阅图 6 所示, 可以包括: 第一获取单元 11、 读取单元 12、 第一写入单元 13、 第二写入单元 14和第三写入单元 15。 第一获取单元 11 , 用于获取所述命令交换文件中的升级开始命令, 其中 所述升级开始命令由所述移动终端写入到所述命令交换文件中。
读取单元 12, 用于在获取到所述升级开始命令后, 从所述 SD存储器中 读取存储有升级数据的固件升级文件。 其中所述固件升级文件由移动终端下 载并由所述移动终端写入到所述 SD存储器中。 升级数据包含有用于升级 SD 接口的通信设备的固件的程序代码。
第一写入单元 13 , 用于将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 第一获取单元 11、 读取单元 12和第一写入单元 13的具 体功能和实现请参阅实施例 5 所示的固件升级装置中的详细说明, 对此本实 施例不再力 p以阐述。
第二写入单元 14, 用于在将所述固件升级文件写入所述 Flash存储器的过 程中, 将升级进度写入到所述结果交换文件中。 第三写入单元 15 , 用于在将所述固件升级文件写入所述 Flash存储器之 后, 将所述升级结果写入到所述结果交换文件中。
其中升级进度表明当前固件升级文件写入到 Flash存储器的进度, 如以写 入到 Flash存储器中文件大小占固件升级文件总大小的百分比来表明升级进 度。 升级结果表明升级的最终结果, 如升级成功和升级失败。 在本实施例 中, SD接口的通信设备可以以不同标识表明升级成功或升级失败。 在本实施例中, 所述第二写入单元 14通过 SCSI命令将所述升级进度写入 到所述结果交换文件中。 所述第三写入单元 15通过 SCSI命令将所述升级结果 写入到所述结果交换文件中。 第二写入单元 14和第三写入单元 15具体执行过 程请参阅实施例 2 所示固件升级方法中的详细说明, 对此本实施例不再加以 介绍。
在本实施例中, 第二写入单元 14 可以将升级进度写入到结果交换文件 中, 第三写入单元 15可以将升级结果写入到结果交换文件中, 进而移动终端 可以通过识别文件名称获取到结果交换文件, 从结果交换文件中读取到升级 进度和升级结果, 并在移动终端上显示固件升级进度和状态, 从而解决了 SD 接口的通信设备无法显示固件升级进度和状态的问题。 移动终端从 SD存储器中获取结果交换文件的具体过程可以是: SD接口 的通信设备在获取到命令交换文件中升级状态查询命令后, 将所述结果交换 文件发送至所述移动终端, 其中升级状态查询由移动终端写入到命令交换文 件中, 其表明移动终端需要查询固件升级状态, 此时 SD接口的通信设备需要 发送结果交换文件至移动终端。 请参阅图 7 , 其以图 6为基础示出了本实施例 6提供的固件升级装置的再 一种结构示意图, 还可以包括: 第二获取单元 16和发送单元 17。 第二获取单元 16, 用于获取所述命令交换文件中的升级状态查询命令。 发送单元 17 , 用于在获取到所述升级状态查询命令后, 将所述结果交换 文件发送至所述移动终端, 其中所述结果交换文件中写入有所述升级进度和 升级结果。 其中升级状态查询命令是用户查询 SD接口的通信设备的固件升级过程的 命令, 当获取到该升级状态查询命令时, 表明移动终端需要查询固件升级过 程, 第二获取单元 16 触发发送单元 17 , 将结果交换文件发送至所述移动终 端。 在本实施例中升级状态查询命令的格式请参阅实施例 2 所示的固件升级 方法中的介绍, 对此不再阐述。
实施例 7 与上述实施例 3 所示的方法实施例相对应, 本申请实施例提供了另一种 固件升级装置, 其结构示意图请参阅图 8 所示, 可以包括: 第一获取单元 11、 读取单元 12、 第一写入单元 13和删除单元 18。 第一获取单元 11 , 用于获取所述命令交换文件中的升级开始命令, 其中 所述升级开始命令由所述移动终端写入到所述命令交换文件中。 读取单元 12, 用于在获取到所述升级开始命令后, 从所述 SD存储器中 读取存储有升级数据的固件升级文件。 其中所述固件升级文件由移动终端下 载并由所述移动终端写入到所述 SD存储器中。 升级数据包含有用于升级 SD 接口的通信设备的固件的程序代码。 第一写入单元 13 , 用于将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 第一获取单元 11、 读取单元 12和第一写入单元 13的具 体功能和实现请参阅实施例 5 所示的固件升级装置中的详细说明, 对此本实 施例不再力 P以阐述。 删除单元 18, 用于在将所述固件升级文件全部写入到所述 Flash存储器 后, 删除所述命令升级文件中的所述升级开始命令。
因为命令升级文件中可以写入多个升级开始命令, 所以为了避免下一次 升级时, 受上次升级后在命令交换文件中遗留的升级开始命令的干扰。 在将 所述固件升级文件全部写入到 Flash存储器后, 删除命令升级文件中写入的升 级开始命令。 当然, 本实施例提供的固件升级装置还可以包括: 图 6 中的第二写入单 元 14和第三写入单元 15、 以及图 7中的第二获取单元 16和发送单元 17, 从 而固件升级装置可以将结果交换文件发送至移动终端。 移动终端进一步从结 果交换文件中读取到升级进度和升级结果, 并在移动终端上显示固件升级进 度和状态, 以解决了 SD接口的通信设备无法显示固件升级进度和状态的问 题。
实施例 8 请参阅图 9, 其示出了本申请实施例提供的另一种固件升级装置的结构 示意图, 可以包括: 第一获取单元 11、 读取单元 12、 第一写入单元和启动单 元 19。 第一获取单元 11 , 用于获取所述命令交换文件中的升级开始命令, 其中 所述升级开始命令由所述移动终端写入到所述命令交换文件中。 启动单元 19, 用于在获取到所述升级开始命令后, 重启所述安全数码接 口的通信设备, 进入安全数码接口的通信设备的升级模式, 以及用于在将所 述固件升级文件全部写入到所述 Flash存储器后, 重启所述安全数码接口的通 信设备, 进入所述安全数码接口的通信设备的普通运行模式。 在本实施例中, 普通运行模式是指 SD接口的通信设备所运行的操作系统 可以为用户提供各种业务功能的运行模式, 升级模式是指 SD接口的通信设备 运行的操作系统可以为用户仅提供升级业务功能的运行模式。
当然, 启动单元 19也可以应用到上述图 5 至图 8所示的固件升级装置 中, 以控制 SD接口的通信设备的工作模式, 对此本实施例不再——结合结构 示意图进行描述。 读取单元 12具体用于在升级模式下, 从所述安全数码存储器中读取存储 有升级数据的所述固件升级文件。 其中所述固件升级文件由移动终端下载并 由所述移动终端写入到所述 SD存储器中。 升级数据包含有用于升级 SD接口 的通信设备的固件的程序代码。 第一写入单元 13 , 用于将所述固件升级文件写入到所述 Flash存储器中。 在本实施例中, 第一获取单元 11、 读取单元 12和第一写入单元 13的具 体功能和实现请参阅实施例 5 所示的固件升级装置中的详细说明, 对此本实 施例不再力 P以阐述。
上述所有装置实施例中, 第一写入单元 13具体用于将固件升级文件镜像 写入 Flash存储器中, 即将固件升级文件中新的程序代码覆盖 Flash存储器中 原有保存的程序代码。 当新的程序代码完整被写入到 Flash存储器中, 则完成 SD接口的通信设备的固件升级。 当 SD接口的通信设备再次运行时, 则可以 直接运行 Flash存储器中的新的程序代码。 当然, 上述所有装置实施例中, 固件升级装置还可以包括: 校验单元, 用于校验所述固件升级文件。 读取单元 12具体用于在校验出所述固件升级文 件为合法文件后, 从所述 SD存储器中读取存储有升级数据的固件升级文件。 校验单元校验固件升级文件可以确定固件升级文件是否为合法文件, 以 防止 Flash存储器中写入非法文件导致 SD接口的通信设备运行出错现象的发 生, 其中合法文件表明固件升级文件为可使用, 且未被除运营商之外的其他 用户更改的文件。 在本实施例中, 校验单元校验固件升级文件时可以釆用现 有校验方法进行校验, 对此本实施例不再加以阐述。 上述图 5至图 9任意一种结构示意图所示的固件升级装置可以包括在 SD 接口的通信设备中, 所述 SD接口的通信设备包括 SD存储器和 Flash存储器, 其中所述固件升级装置分别与所述 SD存储器和所述 Flash存储器进行数据通 信, 所述 SD存储器中存储有命令交换文件, 所述 SD存储器是指所述移动终 端通过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通 信设备内部保存固件的存储器。
实施例 9 请参阅图 10, 其示出了本申请实施例提供的另一种固件升级装置的结构 示意图, 所述固件升级装置应用于通过 SD接口与 SD接口的通信设备进行数 据通信移动终端, SD接口的通信设备包括 SD存储器和 Flash存储器, 所述 SD存储器中存储有命令交换文件, 其中所述 SD存储器是指所述移动终端通 过所述 SD接口访问的存储器, 所述 Flash存储器是指所述 SD接口的通信设 备内部保存固件的存储器。
在本实施例中, 固件升级装置可以包括: 下载单元 21、 第四写入单元 22 和第五写入单元 23。 下载单元 21 , 用于下载存储有升级数据的固件升级文件。
在本实施例中, 移动终端会检测 SD接口的通信设备上的固件程序与服务 器上保存的 SD接口的通信设备的固件程序的版本号是否一致, 当检测到版本 号不一致时, 判定出 SD接口的通信设备的固件程序需要升级, 则下载单元 21从服务器中下载存储有升级数据的固件升级文件。
其中固件升级文件是一个二进制文件, 可以包括文件信息头, 固件数据 和校验信息。 在本实施例中固件升级文件的格式与现有二进制文件的格式相 同, 对此本实施例不再加以阐述。 第四写入单元 22, 用于将所述固件升级文件写入到所述 SD存储器中。 第五写入单元 23 , 用于在固件升级文件全部写入到所述 SD存储器后, 将移动终端内的升级开始命令写入到所述命令交换文件中, 由所述 SD接口的 通信设备获取所述升级开始命令进行固件升级。
在第四写入单元 22将固件升级文件全部写入到 SD存储器后, 第五写入 单元 23 进一步在命令交换文件中写入升级开始命令。 SD接口的通信设备通 过识别文件名称可知命令交换文件中存储有升级开始命令, 则 SD接口的通信 设备会轮询所述命令升级文件, 以在所述升级开始命令写入完成后, 获取所 述升级开始命令。 其中轮询命令升级文件是指周期性查询命令升级文件中是 否已经写入完整的升级开始命令。 当 SD接口的通信设备获取到升级开始命令后, 表明 SD接口的通信设备 开始进行固件升级, 则 SD接口的通信设备会进一步获取固件升级文件, 并将 固件升级文件写入 Flash存储器中, 以完成固件升级。 SD接口的通信设备如 何进行固件升级可以参阅应用于 SD接口的通信设备中的固件升级方法, 对此 本实施例不再加以阐述。
实施例 10 请参阅图 11 , 其示出了本申请实施例提供的另一种固件升级装置的结构 示意图, 在图 10基础上, 还可以包括: 第六写入单元 24, 用于将移动终端内 的升级状态查询命令写入到所述命令交换文件中。 升级状态查询命令是指查询 SD接口的通信设备的固件升级过程的命令。 当 SD接口的通信设备获取到该升级状态查询命令后, 将写入有升级进度和升 级结果的结果交换文件发送到移动终端中, 在移动终端上显示升级进度和升 级结果, 以解决 SD接口的通信设备不包括显示屏导致的无法显示固件升级进 度和状态的问题, 具体请参阅图 12所示的固件升级装置。
图 12所示的固件升级装置, 在图 11基础上还可以包括: 接收单元 25和 显示单元 26。
接收单元 25, 用于接收所述 SD接口的通信设备发送的结果交换文件, 其中所述结果交换文件在所述 SD接口的通信设备获取到升级状态查询命令后 发送, 并且所述结果交换文件中写入有所述升级进度和升级结果;
显示单元 26, 用于在所述移动终端上显示所述升级进度和升级结果。 在本实施例中, 第五写入单元 23通过 SCSI命令将所述升级开始命令写入 到所述命令交换文件中。 第六写入单元 24通过 SCSI命令将所述升级状态查询 命令写入到所述命令交换文件中, 具体请参阅相应的方法实施例。 本申请实施例还提供了一种移动终端, 所述移动终端包括: 固件升级装 置, 该固件升级装置的结构示意图可以参阅图 10至图 12任意一种结构示意 图, 对此本实施例不再对固件升级装置进行详细描述。
此外, 本申请实施例还提供一种 SD接口的通信设备, 所述 SD接口的通 信设备上仅设置有 SD接口 21 , 包括 SD存储器 22、 Flash存储器 23、 处理器 24和 SD接口控制器 25 , 其结构示意图请参阅图 13所示。 其中:
SD接口 21通过 SD总线连接所述 SD接口的通信设备和移动终端, 并且 所述 SD接口的通信设备和移动终端之间的数据通信在所述 SD接口控制器 25 的控制下在所述 SD总线上传输。 在本实施例中, SD总线是指遵循 SD接口规 范的 SD接口的通信设备和移动终端的硬件总线。
处理器 24用于从 SD存储器 22中的命令交换文件中获取升级开始命令, 在获取到所述升级开始命令后, 从所述 SD存储器 22中读取所述固件升级文 件, 并将所述固件升级文件写入所述 Flash存储器 23中, 以升级所述 SD接口 的通信设备中的固件。
在本实施例中, 与 SD接口的通信设备连接的移动终端上也设置有 SD接 口, 该 SD接口通过 SD总线连接 SD接口的通信设备上的 SD接口, 并且在移 动终端中 SD接口控制器的控制下进行数据通信。 SD接口的通信设备和移动 终端之间的连接示意图请参阅图 14所示, 在图 14中示出了移动终端的部分结 构和 SD接口的通信设备的结构。
其中, SD接口的通信设备在进行升级过程时, 移动终端和 SD接口的通 信设备之间连接 SD接口的 SD总线在两者内部 SD接口控制器的作用下建立 连接。 当开始进行升级时, 移动终端将固件升级文件通过连接 SD接口的 SD 总线写入到 SD存储器 22中。 在固件升级文件全部写入到 SD存储器后, 移动 终端在将升级开始命令写入到 SD存储器 22中的命令交换文件中。 处理器 24 通过识别文件名称可知命令交换文件中存储有升级开始命令, 则处理器 24轮 询命令交换文件, 以在所述升级开始命令写入完成后, 获取升级开始命令。
处理器 24获取到所述升级开始命令后, 从所述 SD存储器 22中读取所述 固件升级文件, 并将所述固件升级文件写入所述 Flash存储器 23 中, 以升级 所述 SD接口的通信设备中的固件。
在固件升级文件写入到 Flash存储器 23的过程中, 处理器 24可以进一步 将升级进度和升级结果写入到 SD存储器 22的结果交换文件中。 并且处理器 24 在读取到命令交换文件中的升级状态查询命令后, 从所述结果交换文件中 读取所述升级进度和升级结果, 将所述升级进度和升级结果发送至所述移动 终端, 由移动终端可以显示升级进度和升级结果, 实现人机交互。 其中, 升 级状态查询命令由移动终端写入到 SD存储器 22的命令交换文件中 在本实施例中, 升级开始命令、 升级状态查询命令、 升级进度和升级结 果的写入可以通过不同的 SCSI命令写入, 具体请参阅方法实施例中相关说 明, 对此本实施例不再加以阐述。 此外, 为避免下一次升级时, 受上次升级后在命令交换文件中遗留的升 级开始命令的干扰, 处理器 24进一步用于在将所述固件升级文件全部写入到 所述 Flash存储器后, 删除所述命令升级文件中写入的升级开始命令。 SD接口的通信设备在实际升级过程中, 需要在升级模式下进行, 而 SD 接口的通信设备在开机后运行在普通运行模式下, 因此处理器 24进一步用于 在获取到所述升级开始命令后, 重启所述 SD接口的通信设备, 使所述 SD接 口的通信设备由普通运行模式转换为升级模式, 并在升级模式下, 执行从所 述 SD存储器 22中获取所述固件升级文件, 并将所述固件升级文件写入所述 Flash存储器 23 中。 在将所述固件升级文件全部写入到所述 Flash存储器 23 后, 处理器 24则进一步用于重启所述 SD接口的通信设备, 使所述 SD接口的 通信设备由升级模式转换为普通运行模式, 以保证移动终端可以正常使用 SD 接口的通信设备。 在本实施例中, 处理器 24 具体用于将所述固件升级文件镜像写入所述 Flash存储器中, 即将固件升级文件中新的固件程序覆盖 Flash存储器中原有 保存的固件程序。 当新的固件程序完整被写入到 Flash存储器中, SD接口的 通信设备的固件升级完成。 当 SD接口的通信设备再次运行时, 则可以直接运 行 Flash存储器中的新的固件程序。 当固件升级文件全部写入到 SD存储器 22后, 处理器 24进一步在获取所 述升级开始命令前, 校验所述固件升级文件, 在校验出所述固件升级文件为 合法文件后, 获取所述升级开始命令, 以防止 Flash存储器中写入非法文件导 致 SD接口的通信设备运行出错现象的发生, 其中合法文件表明固件升级文件 为可使用, 且未被除运营商之外的其他用户更改的文件。 需要说明的是: 移动终端在固件升级文件全部写入到 SD存储器中之后, 将升级开始命令写入到命令交换文件中, 即固件升级文件的写入优于升级开 始命令写入, 以保证固件升级文件可以全部写入到 SD存储器 22 , 从而保证 写入到 SD存储器 22中固件升级文件的完整性, 以避免在升级开始命令执行 时, SD存储器 22中的固件升级文件不完整而导致升级失败的情况发生。
上述图 13所示的 SD接口的通信设备内所集成软件的示意图请参阅图 15 所示, 其中集成在 SD接口的通信设备中的软件包括升级服务程序, 文件系 统, SD接口驱动程序和 Flash驱动程序。 其中 SD接口驱动程序集成在 SD接 口控制器 25中, 升级 ^良务程序, 文件系统和 Flash驱动程序集成在处理器 24 中。
升级服务程序通过文件系统完成对固件升级文件的读取, 对命令交换文 件和结果交换文件的访问和更新。 文件系统通过 SD接口驱动程序获取 SD存 储器 22中的文件信息, 并通过 SD接口驱动程序完成对 SD存储器 22的数据 访问。 升级服务程序通过 Flash驱动程序将固件升级文件写入 Flash存储器 23 中, 完成固件升级。
本实施例中 SD接口的通信设备上的软件与移动终端上软件的信息交互过 程请参阅图 16所示。 其中移动终端上软件包括固件升级程序和 SD接口驱动 程序, 其中固件升级程序中包括固件升级文件, 并通过 SD接口驱动程序写入 到 SD接口的通信设备中的 SD存储器 22中, SD接口驱动程序由移动终端内 的操作系统支持。
SD接口的通信设备和移动终端内软件在 SD接口的通信设备升级过程中 信息交互具体过程如下: 移动终端上的固件升级程序通过 SCSI命令在 SD存储器 22上创建命令交 换文件和结果交换文件, 下载固件升级文件, 并通过移动终端上的 SD接口驱 动程序以及 SD接口的通信设备上的 SD接口驱动程序, 将固件升级文件写入 到 SD接口的通信设备中的 SD存储器 22中。 在固件升级文件全部写入到 SD存储器 22中后, 固件升级流程启动, 固 件升级程序通过 SCSI命令在命令交换文件中写入升级开始命令, SD接口的 通信设备上的升级服务程序查询到命令交换文件中的升级开始命令后, 重新 启动 SD接口的通信设备, SD接口的通信设备进入升级模式。 在升级模式下, 升级服务程序将检查 SD存储器 22中保存的固件升级文 件的合法性, 在检查得出固件升级文件合法后, 通过文件系统和 SD接口驱动 程序开始读取固件升级文件, 并通过 Flash驱动程序写入 Flash存储器 23中。 移动终端上的固件升级程序在开始固件升级后, 将定时把升级状态查询 命令通过 SCSI命令写入命令交换文件, SD接口的通信设备上的升级服务程 序将通过 SCSI命令把升级进度和升级结果写入结果交换文件, 这样移动终端 上的固件升级程序可以获得升级进度和升级结果, 由固件升级程序实现 UI ( User's Interface , 用户界面)显示。 需要说明的是, 本说明书中的各个实施例均釆用递进的方式描述, 每个 实施例重点说明的都是与其他实施例的不同之处, 各个实施例之间相同相似 的部分互相参见即可。 对于装置类实施例而言, 由于其与方法实施例基本相 似, 所以描述的比较简单, 相关之处参见方法实施例的部分说明即可。 最后, 还需要说明的是, 在本文中, 诸如第一和第二等之类的关系术语 仅仅用来将一个实体或者操作与另一个实体或操作区分开来, 而不一定要求 或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。 而且, 术 语 "包括" 、 "包含" 或者其任何其他变体意在涵盖非排他性的包含, 从而 使得包括一系列要素的过程、 方法、 物品或者设备不仅包括那些要素, 而且 还包括没有明确列出的其他要素, 或者是还包括为这种过程、 方法、 物品或 者设备所固有的要素。 在没有更多限制的情况下, 由语句 "包括一个 ... ... " 限定的要素, 并不排除在包括所述要素的过程、 方法、 物品或者设备中还存 在另外的相同要素。 为了描述的方便, 描述以上装置时以功能分为各种单元分别描述。 当 然, 在实施本申请时可以把各单元的功能在同一个或多个软件和 /或硬件中实 现。
通过以上的实施方式的描述可知, 本领域的技术人员可以清楚地了解到 本申请可借助软件加必需的通用硬件平台的方式来实现。 基于这样的理解, 本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品 的形式体现出来, 该计算机软件产品可以存储在存储介质中, 如 ROM/RAM, 磁碟、 光盘等, 包括若干指令用以使得一台计算机设备(可以是 个人计算机, 服务器, 或者网络设备等)执行本申请各个实施例或者实施例的 某些部分所述的方法。
以上对本申请所提供的一种固件升级方法、 装置及通信设备进行了详细 介绍, 本文中应用了具体个例对本申请的原理及实施方式进行了阐述, 以上 实施例的说明只是用于帮助理解本申请的方法及其核心思想; 同时, 对于本 领域的一般技术人员, 依据本申请的思想, 在具体实施方式及应用范围上均 会有改变之处, 综上所述, 本说明书内容不应理解为对本申请的限制。

Claims

权 利 要 求
1、 一种固件升级方法, 应用于安全数码接口的通信设备, 所述安全数码 接口的通信设备通过安全数码接口与移动终端进行数据通信, 其特征在于, 所 述安全数码接口的通信设备包括安全数码存储器和 Flash存储器, 所述安全数 码存储器中存储有命令交换文件 ,其中所述安全数码存储器是指所述移动终端 通过所述安全数码接口访问的存储器, 所述 Flash存储器是指所述安全数码接 口的通信设备内部保存固件的存储器, 所述方法包括:
获取所述命令交换文件中的升级开始命令,其中所述升级开始命令由所述 移动终端写入到所述命令交换文件中;
在获取到所述升级开始命令后 ,从所述安全数码存储器中读取存储有升级 数据的固件升级文件 ,其中所述固件升级文件由移动终端下载并由所述移动终 端写入到所述安全数码存储器中 ,所述升级数据包含有用于升级安全数码接口 的通信设备的固件的程序代码;
将所述固件升级文件写入到所述 Flash存储器中。
2、 根据权利要求 1所述的固件升级方法, 其特征在于, 所述安全数码存储 器还存储有结果交换文件, 所述方法还包括: 在将所述固件升级文件写入所述 Flash存储器的过程中, 将升级进度写入到所述结果交换文件中;
在将所述固件升级文件写入所述 Flash存储器之后, 将所述升级结果写入 到所述结果交换文件中。
3、 根据权利要求 2所述的固件升级方法, 其特征在于, 通过小型计算机系 统接口命令将所述升级进度和升级结果写入到所述结果交换文件中。
4、 根据权利要求 2所述的固件升级方法, 其特征在于, 还包括: 获取所述命令交换文件中的升级状态查询命令;
在获取到所述升级状态查询命令后 ,将所述结果交换文件发送至所述移动 终端, 其中所述结果交换文件中写入有所述升级进度和升级结果。
5、 根据权利要求 1所述的固件升级方法, 其特征在于, 还包括在将所述固 件升级文件全部写入到所述 Flash存储器后, 删除所述命令升级文件中的所述 升级开始命令。
6、 根据权利要求 1至 5任意一项所述的固件升级方法, 其特征在于, 还包 括: 在获取到所述升级开始命令后, 重启所述安全数码接口的通信设备, 进入 安全数码接口的通信设备的升级模式, 并在升级模式下,从所述安全数码存储 器中读取存储有升级数据的所述固件升级文件;
在将所述固件升级文件全部写入到所述 Flash存储器后, 重启所述安全数 码接口的通信设备, 进入所述安全数码接口的通信设备的普通运行模式。
7、 根据权利要求 1至 5任意一项所述的固件升级方法, 其特征在于, 从所 述安全数码存储器中读取存储有升级数据的固件升级文件前,还包括: 校验所 述固件升级文件;
在校验出所述固件升级文件为合法文件后 ,从所述安全数码存储器中读取 存储有升级数据的固件升级文件。
8、 一种固件升级方法, 应用于移动终端, 所述移动终端通过安全数码接 口与安全数码接口的通信设备进行数据通信, 其特征在于, 所述安全数码接口 的通信设备包括安全数码存储器和 Flash存储器, 所述安全数码存储器中存储 有命令交换文件,其中所述安全数码存储器是指所述移动终端通过所述安全数 码接口访问的存储器, 所述 Flash存储器是指所述安全数码接口的通信设备内 部保存固件的存储器, 所述方法包括:
下载存储有升级数据的固件升级文件;
将所述固件升级文件写入到所述安全数码存储器中;
在固件升级文件全部写入到所述安全数码存储器后,将移动终端内的升级 开始命令写入到所述命令交换文件中,由所述安全数码接口的通信设备获取所 述升级开始命令进行固件升级。
9、 根据权利要求 8所述的固件升级方法, 其特征在于, 还包括: 将移动终 端内的升级状态查询命令写入到所述命令交换文件中。
10、 根据权利要求 9所述的固件升级方法, 其特征在于, 所述安全数码存 储器中还存储有结果交换文件, 所述方法还包括: 接收所述安全数码接口的通 信设备发送的结果交换文件,其中所述结果交换文件在所述安全数码接口的通 信设备获取到升级状态查询命令后发送,并且所述结果交换文件中写入有所述 升级进度和升级结果;
在所述移动终端上显示所述升级进度和升级结果。
11、 根据权利要求 9所述的固件升级方法, 其特征在于, 通过小型计算机 系统接口命令将所述升级开始命令和升级状态查询命令写入到所述命令交换 文件中。
12、 一种固件升级装置, 应用于安全数码接口的通信设备, 所述安全数码 接口的通信设备通过安全数码接口与移动终端进行数据通信, 其特征在于, 所 述安全数码接口的通信设备包括安全数码存储器和 Flash存储器, 所述安全数 码存储器中存储有命令交换文件 ,其中所述安全数码存储器是指所述移动终端 通过所述安全数码接口访问的存储器, 所述 Flash存储器是指所述安全数码接 口的通信设备内部保存固件的存储器, 所述装置包括:
第一获取单元,用于获取所述命令交换文件中的升级开始命令, 其中所述 升级开始命令由所述移动终端写入到所述命令交换文件中;
读取单元, 用于在获取到所述升级开始命令后,从所述安全数码存储器中 读取存储有升级数据的固件升级文件,其中所述固件升级文件由移动终端下载 并由所述移动终端写入到所述安全数码存储器中,所述升级数据包含有用于升 级安全数码接口的通信设备的固件的程序代码;
第一写入单元, 用于将所述固件升级文件写入到所述 Flash存储器中。
13、 根据权利要求 12所述的固件升级装置, 其特征在于, 所述安全数码存 储器还存储有结果交换文件, 所述装置还包括: 第二写入单元, 用于在将所述 固件升级文件写入所述 Flash存储器的过程中, 将升级进度写入到所述结果交 换文件中;
第三写入单元, 用于在将所述固件升级文件写入所述 Flash存储器之后, 将所述升级结果写入到所述结果交换文件中。
14、 根据权利要求 13所述的固件升级装置, 其特征在于, 所述第二写入单 元通过小型计算机系统接口命令将所述升级进度写入到所述结果交换文件中; 所述第三写入单元通过小型计算机系统接口命令将所述升级结果写入到 所述结果交换文件中。
15、 根据权利要求 13所述的固件升级装置, 其特征在于, 还包括: 第二获取单元, 用于获取所述命令交换文件中的升级状态查询命令; 发送单元, 用于在获取到所述升级状态查询命令后,将所述结果交换文件 发送至所述移动终端 ,其中所述结果交换文件中写入有所述升级进度和升级结 果。
16、根据权利要求 12所述的固件升级装置,其特征在于,还包括删除单元, 用于在将所述固件升级文件全部写入到所述 Flash存储器后, 删除所述命令升 级文件中的所述升级开始命令。
17、 根据权利要求 12至 16任意一项所述的固件升级装置, 其特征在于, 还 包括: 启动单元, 用于在获取到所述升级开始命令后, 重启所述安全数码接口 的通信设备, 进入安全数码接口的通信设备的升级模式, 以及用于在将所述固 件升级文件全部写入到所述 Flash存储器后, 重启所述安全数码接口的通信设 备, 进入所述安全数码接口的通信设备的普通运行模式;
所述读取单元具体用于在升级模式下,从所述安全数码存储器中读取存储 有升级数据的所述固件升级文件。
18、 根据权利要求 12至 16任意一项所述的固件升级装置, 其特征在于, 还 包括: 校验单元, 用于校验所述固件升级文件;
所述读取单元具体用于在校验出所述固件升级文件为合法文件后,从所述 安全数码存储器中读取存储有升级数据的固件升级文件。
19、 一种安全数码接口的通信设备, 其特征在于, 所述安全数码接口的通 信设备包括安全数码存储器、 Flash存储器和如权利要求 12至 18任意一项所述 的固件升级装置, 其中所述固件升级装置分别与所述安全数码存储器和所述 Flash存储器进行数据通信, 所述安全数码存储器中存储有命令交换文件, 所 述安全数码存储器是指所述移动终端通过所述安全数码接口访问的存储器 ,所 述 Flash存储器是指所述安全数码接口的通信设备内部保存固件的存储器。
20、 一种固件升级装置, 应用于移动终端, 所述移动终端通过安全数码接 口与安全数码接口的通信设备进行数据通信, 其特征在于, 所述安全数码接口 的通信设备包括安全数码存储器和 Flash存储器, 所述安全数码存储器中存储 有命令交换文件,其中所述安全数码存储器是指所述移动终端通过所述安全数 码接口访问的存储器, 所述 Flash存储器是指所述安全数码接口的通信设备内 部保存固件的存储器, 所述装置包括:
下载单元, 用于下载存储有升级数据的固件升级文件;
第四写入单元, 用于将所述固件升级文件写入到所述安全数码存储器中; 第五写入单元, 用于在固件升级文件全部写入到所述安全数码存储器后, 将移动终端内的升级开始命令写入到所述命令交换文件中,由所述安全数码接 口的通信设备获取所述升级开始命令进行固件升级。
21、 根据权利要求 20所述的固件升级装置, 其特征在于, 还包括: 第六写 入单元, 用于将移动终端内的升级状态查询命令写入到所述命令交换文件中。
22、 根据权利要求 21所述的固件升级装置, 其特征在于, 所述安全数码存 储器中还存储有结果交换文件, 所述装置还包括: 接收单元, 用于接收所述安 全数码接口的通信设备发送的结果交换文件,其中所述结果交换文件在所述安 全数码接口的通信设备获取到升级状态查询命令后发送,并且所述结果交换文 件中写入有所述升级进度和升级结果;
显示单元, 用于在所述移动终端上显示所述升级进度和升级结果。
23、 根据权利要求 21所述的固件升级装置, 其特征在于, 所述第五写入单 元通过小型计算机系统接口命令将所述升级开始命令写入到所述命令交换文 件中;
所述第六写入单元通过小型计算机系统接口命令将所述升级状态查询命 令写入到所述命令交换文件中。
PCT/CN2014/079440 2013-06-08 2014-06-09 一种固件升级方法、装置及通信设备 WO2014194865A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US14/896,492 US9804832B2 (en) 2013-06-08 2014-06-09 Method, apparatus, and communication device for updating firmware
EP14807951.0A EP3007062A4 (en) 2013-06-08 2014-06-09 FIRMWARE UPGRADE PROCESS AND DEVICE AND COMMUNICATION DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310228240.2A CN103309709B (zh) 2013-06-08 2013-06-08 一种固件升级方法、装置及通信设备
CN201310228240.2 2013-06-08

Publications (1)

Publication Number Publication Date
WO2014194865A1 true WO2014194865A1 (zh) 2014-12-11

Family

ID=49134969

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/079440 WO2014194865A1 (zh) 2013-06-08 2014-06-09 一种固件升级方法、装置及通信设备

Country Status (5)

Country Link
US (1) US9804832B2 (zh)
EP (1) EP3007062A4 (zh)
JP (1) JP5838527B2 (zh)
CN (1) CN103309709B (zh)
WO (1) WO2014194865A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446772A (zh) * 2015-11-16 2016-03-30 青岛海信移动通信技术股份有限公司 一种系统升级的方法和装置

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309709B (zh) 2013-06-08 2018-10-09 华为终端有限公司 一种固件升级方法、装置及通信设备
JP6305069B2 (ja) * 2014-01-10 2018-04-04 キヤノン株式会社 画像形成装置及びその制御方法、並びにプログラム
CN105700903A (zh) * 2014-11-28 2016-06-22 中兴通讯股份有限公司 一种用户终端的升级方法和用户终端
CN105988828A (zh) * 2015-01-30 2016-10-05 深圳市硅格半导体有限公司 固件更新系统及方法
CN105488153A (zh) * 2015-11-27 2016-04-13 北京北信源软件股份有限公司 基于二进制流追加镜像的方法和装置
US20170286090A1 (en) * 2016-03-31 2017-10-05 Microsoft Technology Licensing, Llc High performance mobile device flashing
CN106130751B (zh) * 2016-05-27 2019-05-17 努比亚技术有限公司 一种升级状态数据管理装置、系统和方法
CN106168906A (zh) * 2016-06-23 2016-11-30 广州信位通讯科技有限公司 一种网络摄像机的固件升级方法
CN107783769A (zh) * 2016-08-24 2018-03-09 青岛歌尔声学科技有限公司 一种通过usb升级电子设备的方法、装置及电子设备
CN106647517A (zh) * 2016-12-29 2017-05-10 金卡高科技股份有限公司 一种物联网计量仪表远程固件升级方法及计量仪表系统
CN107861746B (zh) * 2017-12-06 2020-11-27 北京经纬恒润科技有限公司 一种车辆电子控制单元的刷新方法及系统
KR20190074857A (ko) * 2017-12-20 2019-06-28 삼성전자주식회사 펌웨어를 업데이트하는 인터페이스 장치, 모바일 장치 및 펌웨어 업데이트 방법
CN111309353B (zh) * 2020-01-20 2023-05-23 超越科技股份有限公司 一种基于服务器控制板更新运算板fpga固件的方法及设备
US11409681B2 (en) * 2020-09-04 2022-08-09 Paypal, Inc. Computer system communication via sideband processor
CN115729601A (zh) * 2022-11-25 2023-03-03 中机试验装备股份有限公司 一种固件更新方法、装置、设备及计算机可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040225875A1 (en) * 2003-05-09 2004-11-11 Chung-Ching Huang System and method of device information management
CN1991761A (zh) * 2005-12-30 2007-07-04 北京华旗资讯数码科技有限公司 一种固件程序在线升级的方法及硬件设备
CN101447035A (zh) * 2008-12-29 2009-06-03 普天信息技术研究院有限公司 一种智能存储卡及提高智能存储卡传输速率的方法
US20100199078A1 (en) * 2009-02-04 2010-08-05 Novatek Microelectronics Corp. Method of safe and recoverable firmware update and device using the same
CN102004657A (zh) * 2010-12-15 2011-04-06 周佳 一种电子设备及其升级方法
CN103309709A (zh) * 2013-06-08 2013-09-18 华为终端有限公司 一种固件升级方法、装置及通信设备

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7299463B2 (en) * 2001-09-28 2007-11-20 Intel Corporation Method for atomically updating a plurality of files
US7320126B2 (en) * 2001-11-06 2008-01-15 Sandisk Corporation Implementation of in system programming to update firmware on memory cards
TW200421172A (en) * 2003-04-04 2004-10-16 Incomm Technologies Co Ltd Drive codes upgrading method of portable memory device and device thereof
TWI345175B (en) * 2005-06-08 2011-07-11 Winbond Electronics Corp Method for updating firmware of memory card
JP2007047993A (ja) * 2005-08-09 2007-02-22 Rohm Co Ltd 制御回路、それを用いた電子機器およびファームウェアの更新方法
US8707290B2 (en) * 2006-02-22 2014-04-22 Dell Products L.P. Firmware update in an information handling system employing redundant management modules
EP2535830B1 (en) * 2007-05-30 2018-11-21 Ascensia Diabetes Care Holdings AG Method and system for managing health data
EP2229625B1 (en) * 2007-12-13 2011-08-31 Telefonaktiebolaget LM Ericsson (publ) Updating firmware of an electronic device
CN101344854B (zh) 2008-08-22 2011-01-19 四川长虹电器股份有限公司 通过SD卡对嵌入式Linux设备进行升级的方法
CN101799881A (zh) 2008-10-24 2010-08-11 上海吉芯电子有限公司 一种sd卡接口的td-scdma通讯卡
CN201781586U (zh) 2010-01-27 2011-03-30 福建新大陆通信科技股份有限公司 一种基于sd卡技术实现自动升级的机顶盒
US8745304B2 (en) * 2010-02-01 2014-06-03 Standard Microsystems Corporation USB to SD bridge
US9396329B2 (en) * 2011-10-17 2016-07-19 Intel Corporation Methods and apparatus for a safe and secure software update solution against attacks from malicious or unauthorized programs to update protected secondary storage
US8972966B2 (en) * 2012-01-05 2015-03-03 Lenovo (Singapore) Pte. Ltd. Updating firmware in a hybrid computing environment
JP5821640B2 (ja) * 2012-01-06 2015-11-24 株式会社リコー 情報処理装置
US8631239B2 (en) * 2012-01-12 2014-01-14 Facebook, Inc. Multiple system images for over-the-air updates

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040225875A1 (en) * 2003-05-09 2004-11-11 Chung-Ching Huang System and method of device information management
CN1991761A (zh) * 2005-12-30 2007-07-04 北京华旗资讯数码科技有限公司 一种固件程序在线升级的方法及硬件设备
CN101447035A (zh) * 2008-12-29 2009-06-03 普天信息技术研究院有限公司 一种智能存储卡及提高智能存储卡传输速率的方法
US20100199078A1 (en) * 2009-02-04 2010-08-05 Novatek Microelectronics Corp. Method of safe and recoverable firmware update and device using the same
CN102004657A (zh) * 2010-12-15 2011-04-06 周佳 一种电子设备及其升级方法
CN103309709A (zh) * 2013-06-08 2013-09-18 华为终端有限公司 一种固件升级方法、装置及通信设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446772A (zh) * 2015-11-16 2016-03-30 青岛海信移动通信技术股份有限公司 一种系统升级的方法和装置
CN105446772B (zh) * 2015-11-16 2019-01-04 青岛海信移动通信技术股份有限公司 一种系统升级的方法和装置

Also Published As

Publication number Publication date
JP2014238838A (ja) 2014-12-18
JP5838527B2 (ja) 2016-01-06
US9804832B2 (en) 2017-10-31
EP3007062A1 (en) 2016-04-13
CN103309709B (zh) 2018-10-09
US20160132315A1 (en) 2016-05-12
EP3007062A4 (en) 2016-05-11
CN103309709A (zh) 2013-09-18

Similar Documents

Publication Publication Date Title
WO2014194865A1 (zh) 一种固件升级方法、装置及通信设备
CN107179909B (zh) 软件升级方法、装置及计算机可读存储介质
WO2014146256A1 (zh) 一种升级方法、智能终端及升级系统
WO2017067448A1 (zh) 一种无线固件升级方法、系统及计算机存储介质
WO2014089734A1 (zh) 终端和应用程序恢复方法
US20150220326A1 (en) Mobile Terminal and Software Upgrade Method Thereof
WO2011127845A2 (zh) 一种移动通信终端间进行系统升级的方法、系统及终端
WO2018090290A1 (zh) 镜像文件转换方法及装置
JP7346606B2 (ja) 画面共有処理方法、装置、機器及び記憶媒体
WO2019062635A1 (zh) 升级方法和装置
WO2008154862A1 (fr) Procédé de gestion pour un système de terminal intelligent et terminal intelligent
US20140059536A1 (en) Mobile terminal, information processing apparatus, and information processing method
CN108509215B (zh) 一种系统软件的更换方法、装置、终端设备及存储介质
WO2018040746A1 (zh) 一种驱动程序的安装方法及装置、电子设备
US20160170735A1 (en) Operating system updating method by using a checklist
EP2958017A1 (en) Computerized systems and methods for installing upgraded software on electronic devices
CN111813428A (zh) 终端固件的升级方法、装置、电子设备及存储介质
WO2011088701A1 (zh) 一种跨平台版本在线升级的方法及装置
WO2015127730A1 (zh) 版本文件的运行方法及装置
CN104220981A (zh) 用于修改有效固件的固件包
WO2016082450A1 (zh) 一种用户终端的升级方法和用户终端
WO2013167010A2 (zh) 一种移动终端及其开机方法
WO2017173924A1 (zh) 切换文件系统的方法及装置
WO2023198056A1 (zh) 嵌入式设备固件更新方法以及嵌入式设备
US20150134944A1 (en) Data terminal running mode switching method, device, and data terminal

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: 14807951

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14896492

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2014807951

Country of ref document: EP