Firmware updating method, electronic equipment, firmware updating equipment and firmware updating system
By obtaining device information and judging status in the firmware update file system, the BGA SSD's independent firmware update is realized, which solves the cumbersome problem of factory repairs, and users can complete firmware updates independently.
Patent Information
- Application Number
- CN202510539982.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The existing BGA SSD firmware updates require factory repair and rely on professional personnel to complete, and users cannot complete them independently, and the process is cumbersome.
By obtaining storage device information in the firmware update file system, we judge whether the update conditions are met, and the device status is judged based on the fault information, and the firmware is automatically updated, and it supports updating when the update command is received or not.
Users can independently complete firmware updates locally, reducing the difficulty of updates and the need to rely on professionals.
Smart Images

Figure CN120428993A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a firmware updating method, electronic equipment, firmware updating equipment, and a firmware updating system. Background Art
[0002] With the rapid development of storage device technology, solid-state drives (SSDs) have become widely used. When an SSD experiences read / write anomalies, storage unit failures, or compatibility issues, it is often necessary to update the SSD's firmware to enable it to continue functioning properly.
[0003] A BGA (Ball Grid Array) SSD is a solid-state drive that uses ball grid array packaging technology. The flash memory and main controller of a BGA SSD are typically packaged together, making repair costs high in the event of a failure. Currently, firmware updates for BGA SSDs generally require returning the device to the manufacturer for repair. Specifically, users must ship the BGA SSD back to the manufacturer, where technicians will connect to the BGA SSD's main controller chip using a dedicated debugging tool to manually back up the original firmware, clear historical data, mark faulty storage cells, and load new firmware. Sometimes, specific hardware interfaces or jumper settings are required to put the BGA SSD into debug mode.
[0004] However, the factory repair method for BGA SSDs requires users to send the BGA SSD back to the original manufacturer and is highly dependent on professional personnel. This makes it impossible for users to complete firmware updates independently, and the entire firmware update process is very cumbersome. Summary of the Invention
[0005] In response to the deficiencies in the prior art, the present application provides a firmware update method, an electronic device, a firmware update device, and a firmware update system. When the device information of the storage device is obtained in the firmware update file system, whether the storage device meets the firmware update conditions is determined based on the device information. When it is determined that the storage device meets the firmware update conditions, whether the storage device is in a write-protected state or a normal working state is determined based on the fault information in the device information, and then the firmware is updated. The firmware of the storage device can be updated when an update command is received or not, which greatly reduces the difficulty of firmware updating and enables users to update the firmware locally and independently.
[0006] In order to solve the above problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a firmware update method, comprising: upon detecting a connection with a firmware update device, executing a firmware update program in the firmware update device and entering a firmware update file system;
[0008] When device information of a storage device is obtained in the firmware update file system, determining whether the storage device meets the firmware update condition according to the device information;
[0009] When it is determined that the storage device meets the firmware update condition, determining whether the storage device is in a write-protected state or a normal working state according to the fault information in the device information;
[0010] When it is determined that the storage device is in a write-protected state according to the fault information in the device information, determining a target version of firmware according to the received update command or the device information, clearing all stored data and fault information in the storage device, shielding the faulty storage unit of the storage device, and updating the firmware of the storage device to the target version of firmware;
[0011] When it is determined that the storage device is in normal working condition based on the fault information in the device information, the target version of the firmware is determined based on the received update command or the device information, and the firmware of the storage device is updated to the target version of the firmware and all storage data in the storage device is retained.
[0012] In some embodiments, before executing the firmware update program in the firmware update device and entering the firmware update file system upon detecting a connection with the firmware update device, the method further includes:
[0013] Setting the system boot sequence to prioritize booting from the firmware update device;
[0014] When detecting that the firmware update device is connected, executing the firmware update program in the firmware update device and entering the firmware update file system includes:
[0015] When the system is started and a connection with the firmware update device is detected, the system starts from the firmware update device, executes a firmware update program in the firmware update device, and enters the firmware update file system.
[0016] In some implementations, the device information includes a model of the storage device, and determining a target version of firmware based on the received update command or the device information includes:
[0017] Determine the version identifiers of all firmware that match the storage device according to the model and firmware library in the device information;
[0018] In response to receiving an update command, determining the target version of the firmware according to a version identifier in the update command, wherein the version identifier in the update command is one of all version identifiers of the firmware that matches the storage device;
[0019] When no update command is received within a preset time period, the target version of firmware is determined according to the device information.
[0020] In some embodiments, the firmware update device includes a display screen, and the method further includes:
[0021] In the firmware update file system, the firmware update device is controlled to display version identifiers of all firmwares matching the storage device on the display screen.
[0022] In some embodiments, the device information includes a version identifier of the current firmware of the storage device, and when no update command is received within a preset time period, determining the target version of the firmware based on the device information includes:
[0023] When no update command is received within a preset time period, determining whether the current firmware of the storage device is the most recommended firmware based on the version identifier of the current firmware in the device information, the model, and the firmware library;
[0024] When the current firmware version of the storage device is not the firmware with the highest recommendation degree, the firmware with the highest recommendation degree is determined as the target version of the firmware.
[0025] In some embodiments, when no update command is received within a preset time period, determining whether the current firmware of the storage device is the most highly recommended firmware based on the version identifier of the current firmware in the device information, the model, and the firmware library includes:
[0026] When no update command is received within a preset time period, determining a performance parameter of the storage device according to the model, the performance parameter including at least one of a storage capacity, a maximum read speed, and a maximum write speed of the storage device;
[0027] Determining a version identifier of the most recommended firmware corresponding to the storage device based on performance parameters of the storage device, compatibility information and functional characteristic information of each version of firmware in the firmware library;
[0028] It is determined whether the current firmware of the storage device is the firmware with the highest recommendation degree according to the version identifier of the current firmware in the device information and the version identifier of the firmware with the highest recommendation degree.
[0029] In some implementations, the firmware update device includes a status indication module, and the method further includes:
[0030] When the storage device meets the firmware update condition, the status indication module is controlled to be in a state indicating that the storage device can be updated; otherwise, the status indication module is controlled to be in a state indicating that the storage device cannot be updated;
[0031] When the firmware of the storage device is being updated, controlling the status indication module to be in a state indicating that the firmware is being updated;
[0032] When the firmware of the storage device has been updated to the target version of firmware, the status indication module is controlled to be in a state indicating that the update is completed.
[0033] In a second aspect, an embodiment of the present application provides an electronic device, comprising:
[0034] at least one processor; and,
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the firmware update method as described in the first aspect.
[0037] In a third aspect, an embodiment of the present application provides a firmware update device, wherein the firmware update device stores a firmware update program, and the firmware update program is executed by a processor to implement the firmware update method as described in the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a firmware update system, which includes the electronic device as described in the second aspect, the firmware update device as described in the third aspect, and a storage device.
[0039] The present application provides a firmware update method, electronic device, firmware update device and firmware update system. The present application determines whether the storage device meets the firmware update conditions based on the device information when the device information of the storage device is obtained in the firmware update file system. When it is determined that the storage device meets the firmware update conditions, the application determines whether the storage device is in a write-protected state or a normal working state based on the fault information in the device information, and then updates the firmware. The firmware of the storage device can be updated when an update command is received or not, which greatly reduces the difficulty of firmware update and enables users to update the firmware locally and independently. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flowchart of the first implementation of the firmware update method provided in an embodiment of the present application.
[0041] Figure 2 This is a flowchart of the second implementation method of the firmware update method provided in an embodiment of the present application.
[0042] Figure 3It is a structural diagram of the firmware update device provided in an embodiment of the present application.
[0043] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application.
[0044] Figure 5 This is a structural block diagram of a firmware update device provided in an embodiment of the present application.
[0045] Figure 6 It is a structural diagram of the firmware update system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0048] The present application provides a firmware update method, electronic device, firmware update device and firmware update system. When device information of a storage device is obtained in a firmware update file system, whether the storage device meets the firmware update conditions is determined based on the device information. When it is determined that the storage device meets the firmware update conditions, whether the storage device is in a write-protected state or a normal working state is determined based on fault information in the device information, and then the firmware is updated. The firmware of the storage device can be updated when an update command is received or not, which greatly reduces the difficulty of firmware update and enables users to independently update the firmware locally.
[0049] The storage device referred to in this application may be a mechanical hard disk, an SSD, an optical storage device, or a memory card. The SSD may be a BGA SSD. A BGA SSD may include a Flash memory chip, which may include NOR Flash and NAND Flash. The following example uses a BGA SSD as an example, but this should not be considered a limitation of this application.
[0050] The firmware update method provided by this application will be described in detail below with reference to the accompanying drawings.
[0051] See also Figure 1 , Figure 1 This is a flow chart of the first implementation of the firmware update method provided in the embodiment of the present application. Figure 1 As shown, the firmware updating method includes: steps S100 to S500.
[0052] Step S100: When a connection with a firmware update device is detected, a firmware update program in the firmware update device is executed to enter a firmware update file system.
[0053] In some embodiments, when a firmware update operation needs to be performed in a target system and the current operating system of the electronic device is not the target system, the firmware update program includes a target version of the system kernel and a firmware update toolkit. The target version of the system kernel is used to enter the target system. The firmware update toolkit includes multiple files for performing the firmware update operation in the target system.
[0054] Optionally, the firmware update kit is a folder.
[0055] In some implementations, when a firmware update operation needs to be performed in a target system and the current operating system of the electronic device is the target system, the firmware update program only includes a firmware update toolkit.
[0056] Optionally, the target system may be a Linux system. The Linux system is an open source operating system that is highly customizable and cross-platform. Therefore, a firmware update toolkit developed based on the Linux system can adapt to a variety of hardware platforms, thereby enabling the firmware update method of the present application to be applied to storage devices on a variety of hardware platforms.
[0057] Optionally, the Linux system kernel is a Kylin system kernel.
[0058] Optionally, the current operating system of the electronic device may be a Windows system.
[0059] In some implementations, when a connection with a firmware update device is detected, a firmware update program in the firmware update device is automatically executed to enter a firmware update file system.
[0060] In some implementations, a system kernel based on a target version in a firmware update program enters a target system, executes a target executable file in a firmware update toolkit, and enters a firmware update file system.
[0061] In some embodiments, the firmware update device is a storage device located external to the electronic device. Optionally, the firmware update device includes a USB flash drive, a removable hard drive, or the like. If the electronic device includes a USB port, a USB flash drive can be used as the external firmware update device. If the electronic device includes other types of ports, a firmware update device that matches the port of the electronic device can be used.
[0062] In some embodiments, before step S100, the method further includes: setting the system boot sequence to prioritize booting from the firmware update device. Step S100 includes: upon booting and detecting a connection with the firmware update device, booting from the firmware update device, executing a firmware update program in the firmware update device, and entering a firmware update file system.
[0063] In some embodiments, the firmware update device is a storage device located within the electronic device. For example, the firmware update device is a system hard disk within the electronic device. In this case, the system hard disk within the electronic device can be booted according to the default system boot sequence to execute the firmware update program and enter the firmware update file system.
[0064] In some implementations, the firmware update device includes a security verification module.
[0065] Optionally, the security verification module may be a display screen, a button, a touch key or a security chip for inputting a password.
[0066] In some embodiments, when a password is received by the firmware update device and the password is identified as a preset unlock password by executing a security verification program in the firmware update program, the firmware update operation permission is unlocked.
[0067] Exemplarily, the command identifier of the unlock command is “sudo su”.
[0068] Optionally, if the password is the preset unlock password, root permissions are unlocked. Root permissions are the highest level of permissions, granting complete control over the system. Unlocking root permissions also unlocks firmware update permissions.
[0069] Step S200: When device information of the storage device is obtained in the firmware update file system, it is determined whether the storage device meets the firmware update condition according to the device information.
[0070] In some implementations, the device information includes information such as the manufacturer, model, serial number, and current firmware version identifier of the storage device.
[0071] Optionally, the device information also includes SMART (Self-Monitoring, Analysis and Reporting Technology) information, and the SMART information includes fault information.
[0072] When the device information of the storage device is obtained, it indicates that the electronic device can recognize the connection to the storage device and that there is no physical damage to the storage device that would affect its normal operation. In this case, a firmware update can be performed to enable the storage device to continue to operate normally. The situation where the device information of the storage device can be obtained is called disk recognition.
[0073] In some embodiments, the firmware update condition includes the storage device passing a security check. When device information of the storage device is obtained from the firmware update file system, a security check is performed on the storage device based on the device information. If the security check passes, the storage device is determined to meet the firmware update condition; otherwise, the storage device is determined to not meet the firmware update condition.
[0074] In some embodiments, the storage device includes a security chip that stores key information. When performing a security verification using the TCG security verification method, a decryption key is obtained based on the storage device's model or manufacturer information. The decryption key is used to decrypt the key information in the security chip. If the decryption is successful, the security verification is determined to have passed, and the storage device is deemed eligible for a firmware update. Otherwise, the security verification is determined to have failed, and the storage device is deemed ineligible for a firmware update. This method allows firmware updates to be performed only on storage devices produced by legitimate manufacturers, avoiding firmware updates on OEM storage devices that could potentially damage the storage device.
[0075] In some embodiments, performing a security check on the storage device includes: reading the serial number and model number of the storage device, and querying online based on the serial number and model number of the storage device to determine whether a storage device with the model and serial number has been manufactured. If a storage device with the model and serial number has been manufactured, the storage device is determined to meet the firmware update requirements; otherwise, the storage device is determined to not meet the firmware update requirements.
[0076] Furthermore, the storage device's capacity information is read. When a storage device with the model and serial number is found, the capacity information of the storage device is checked to see if it is correct. If the capacity information of the storage device is correct, the storage device is determined to meet the firmware update conditions. Otherwise, the storage device is determined to not meet the firmware update conditions.
[0077] In some implementations, the firmware update file system stores the target version of firmware. In this case, the firmware update condition includes the target version of firmware passing verification.
[0078] In some embodiments, verifying the target version of the firmware includes calculating a check value of a preset data segment of the target version of the firmware, and determining that the target version of the firmware passes the data integrity check when the check value is the same as a standard check value.
[0079] Optionally, the preset data segment can be a data segment of a preset size starting from a preset position in the target version of the firmware. For example, the preset data segment can be the first 50MB of the target version of the firmware. In this way, data errors can be detected without verifying the entire data.
[0080] Optionally, the preset data segment may be all data of the target version of the firmware.
[0081] In some embodiments, verifying the target version of firmware further includes: determining whether the target version of firmware is compatible with the storage device based on the model of the storage device. Specifically, based on the model of the storage device, all versions of firmware compatible with the storage device are searched from the firmware library, and it is determined whether the target version is one of all versions of firmware compatible with the storage device. The firmware library pre-stores the version identifiers and release times of all firmware compatible with each model of storage device. If it is determined that the target version of firmware is compatible with the storage device, the storage device is determined to meet the firmware update conditions; otherwise, the storage device is determined to not meet the firmware update conditions.
[0082] In some embodiments, when the firmware update device includes a status indication module, the method further includes: when the storage device does not meet the firmware update condition, controlling the status indication module to be in a state indicating that the storage device cannot be updated.
[0083] Optionally, the status indication module includes at least one of a light component, a display screen component and an audio component.
[0084] Step S300: When it is determined that the storage device meets the firmware update conditions, it is determined whether the storage device is in a write-protected state or a normal working state according to the fault information in the device information.
[0085] In some embodiments, when the fault information includes a first fault indicator, the storage device is determined to be in a write-protected state. When the fault information includes a second fault indicator, the storage device is determined to be in a normal working state. The first fault indicator and the second fault indicator are different.
[0086] For example, the fault information includes a fault code. When the fault code is 0x08, it is determined that the storage device has entered a write protection state. When the fault code is 0x00, it is determined that the storage device is in a normal working state.
[0087] In some implementations, when it is determined that the storage device meets the firmware update conditions, the firmware update device is controlled to display command identifiers of all executable commands and operation instructions for each executable command on a display screen of the firmware update device.
[0088] In some implementations, all executable commands include card activation commands and commands for additional functions.
[0089] In some embodiments, the card activation command includes a new card activation command, a set serial number activation command, and a retain serial number activation command. When the card activation command is executed, all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, and the firmware of the storage device is updated to the target version.
[0090] In some embodiments, when a new card activation command is executed, all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, the firmware of the storage device is updated to the target version of the firmware, and the serial number of the storage device is set to a preset serial number.
[0091] In some implementations, before clearing all stored data and fault information in a storage device, all stored data is first read and backed up to another storage device.
[0092] In some embodiments, when the set serial number card activation command is executed, all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, the firmware of the storage device is updated to the target version of the firmware, and the serial number of the storage device is set to the target serial number carried by the set serial number card activation command.
[0093] In some implementations, the "Set Serial Number Card Activation" command may not include a serial number. Upon receiving the "Set Serial Number Card Activation" command, a target serial number is generated based on the current time, geographic location, and storage device model using a serial number generation algorithm specific to the storage device model. This target serial number is then stored in the blockchain. This target serial number can serve as maintenance evidence and, like the original serial number, can be verified by the manufacturer, facilitating subsequent repairs of the storage device.
[0094] In some embodiments, when activating storage devices in batches, a serial number generation algorithm corresponding to the model of each storage device is used to generate a target serial number, and a set serial number activation command is executed on each storage device according to the target serial number of each storage device.
[0095] In some embodiments, when the command to unlock the card with the serial number maintained is executed, all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, the firmware of the storage device is updated to the target version of the firmware, and the serial number of the storage device is kept unchanged.
[0096] In some embodiments, the commands in the additional functions include commands for viewing device information, viewing SMART (Self-Monitoring, Analysis and Reporting Technology) information, firmware version update commands, viewing the operating information of the storage device, obtaining the data of the index data block, transferring WPRO (Write-Protect Register or other related) data, transferring debugging information, transferring all data, and obtaining relevant information of the storage device. Among them, the operating information of the storage device includes the usage rate of the storage space, the delay time of the I / O operation, etc. The data of the index data block is used to determine the data management method adopted by the storage device. The command for obtaining relevant information of the storage device is used to execute the command for viewing SMART information, viewing the operating information of the storage device, obtaining the data of the index data block, transferring debugging information, and transferring WPRO data at one time.
[0097] In some implementations, when the firmware version update command is executed, the firmware of the storage device is updated to the target version of firmware, and the storage data in the storage device is retained.
[0098] Step S400: When it is determined that the storage device is in a write-protected state based on the fault information in the device information, the target version of the firmware is determined based on the received update command or device information, and all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, and the firmware of the storage device is updated to the target version of the firmware.
[0099] In some implementations, when the storage device is determined to be write-protected based on fault information in the device information, only the card-open command is executed. This is because only executing the card-open command can remove the write-protection status of the storage device, allowing data to be written to the storage device and allowing it to resume normal operation. As described above, card-open commands include a new card-open command, a set serial number card-open command, and a retain serial number card-open command.
[0100] In some implementations, when the received update command is not a card activation command, the firmware update device is controlled to display a command error message on a display screen and display identifiers of all card activation commands.
[0101] In some embodiments, when a storage device is determined to meet firmware update requirements and is write-protected based on fault information in the device information, the firmware update device is controlled to display only the identifiers for all unlock commands on the display screen of the firmware update device. In this way, the user can only select and execute unlock commands that can remove the write-protection status of the storage device.
[0102] In some implementations, determining the target version of firmware according to the received update command or device information includes steps S410 to S430.
[0103] Step S410: determining the version identifiers of all firmware that match the storage device according to the model and firmware library in the device information.
[0104] Step S420: In response to receiving the update command, determine the target version of the firmware according to the version identifier in the update command.
[0105] The version identifier in the update command is one of all the version identifiers of the firmware that matches the storage device.
[0106] In some embodiments, the firmware update device includes a display screen. The method further includes: controlling the firmware update device to display, in the firmware update file system, version identifiers of all firmware that match the storage device on the display screen. The display screen may be a display screen component in the status indication module.
[0107] Step S430: When no update command is received within a preset time period, a target version of firmware is determined according to the device information.
[0108] By determining the target version of the firmware based on device information when no update command is received within a preset time period, the user does not need to perform any operations during the entire firmware update process. The firmware of the storage device can be updated by simply connecting the firmware update device to the electronic device, which greatly simplifies the firmware update operation and further enables the user to update the firmware locally.
[0109] In some implementations, the target version of firmware may be a firmware in a firmware library.
[0110] Optionally, the firmware library may be pre-stored in a firmware update file system.
[0111] Optionally, the firmware library can be stored in a server and updated in real time, and the firmware library in the server can be read online in the firmware update file system.
[0112] In some implementations, the firmware library includes version identifiers, release times, and code files of all firmware adapted for each model of storage device.
[0113] In some implementations, the device information includes a version identifier of the current firmware of the storage device. Step S430 includes steps S431 to S432.
[0114] Step S431: When no update command is received within a preset time period, it is determined whether the current firmware of the storage device is the most highly recommended firmware according to the version identifier, model, and firmware library of the current firmware in the device information.
[0115] Optionally, the firmware with the highest recommendation degree is the latest version of firmware adapted to the storage device.
[0116] In some embodiments, the target version of firmware adapted to the storage device is determined based on the model and firmware library of the storage device in the device information. When the version identifier of the current firmware is different from the version identifier of the latest version of firmware adapted to the storage device, it is judged that the current firmware of the storage device is not the most highly recommended firmware; otherwise, it is judged that the current firmware of the storage device is the most highly recommended firmware.
[0117] In some implementations, the latest version of firmware is not necessarily the most suitable firmware for the storage device. Therefore, a firmware with the highest recommendation can be determined based on the model of the storage device and the compatibility features of each version of firmware.
[0118] In some embodiments, step S431 includes steps S4311 to S4313.
[0119] Step S4311: When no update command is received within a preset time period, performance parameters of the storage device are determined according to the model.
[0120] The performance parameter includes at least one of a storage capacity, a maximum read speed, and a maximum write speed of the storage device.
[0121] In some implementations, during production, storage devices of a certain model all have the same performance parameters, and the performance parameters of the storage device can be queried online based on the model.
[0122] Step S4312: Determine the version identifier of the firmware with the highest recommendation corresponding to the storage device based on the performance parameters of the storage device, the compatibility information and functional characteristic information of each version of the firmware in the firmware library.
[0123] In some embodiments, step S4312 includes steps (4312.1) to (4312.4).
[0124] (4312.1) Read the compatibility information of each version of firmware in the firmware library, select all firmware that are compatible with the storage device model according to the storage device model, and obtain a matching firmware set of the storage device and a compatibility score of each firmware in the matching firmware set.
[0125] The compatibility score of the storage device of the model corresponding to the compatibility information of each firmware in the matching firmware set is read.
[0126] (4312.2) Determine a stability score for the firmware based on the version identifier of each firmware in the set of matching firmwares.
[0127] In some implementations, the version identifier of the firmware includes at least the major version number among the major version number, the minor version number, and the revision number.
[0128] Generally, a major update is indicated when the major version number of the firmware changes between the previous and next versions. The minor version number indicates some functional improvements, and the revision number indicates bug fixes.
[0129] In some implementations, when it is identified that the version identifier only includes a major version number, or that both the minor version number and the revision number included are 0, the stability score of the firmware corresponding to the version identifier is determined to be a first preset value.
[0130] In some embodiments, when it is recognized that the version identifier includes only a major version number and a minor version number and the minor version number is not 0, or all values except the revision number are not 0, the stability score of the firmware corresponding to the version identifier is determined to be a second preset value.
[0131] In some implementations, when it is identified that the major version number, the minor version number, and the revision number included in the version identifier are all not 0, the stability score of the firmware corresponding to the version identifier is determined to be a third preset value.
[0132] Optionally, the first preset value is less than the second preset value, and the second preset value is less than the third preset value. Because when the version identifier only includes the major version number, or the minor version number and revision number included are both 0, the firmware corresponding to the version identifier is a newly released major version, and there may still be some problems. When the version identifier only includes the major version number and the minor version number and the minor version number is not 0, or all the numbers except the revision number are not 0, the firmware corresponding to the version identifier is based on the previous major version of the firmware and has been functionally improved. Some functions can be added or some problems can be fixed, thereby improving stability. When it is identified that the major version number, minor version number, and revision number included in the version identifier are not 0, the firmware corresponding to the version identifier is based on the previous version of the firmware with a security patch added, thereby further improving stability.
[0133] (4312.3) Determine a performance suitability score for each firmware in the matching firmware set based on the functional feature information of each firmware in the matching firmware set and the performance parameters of the storage device.
[0134] As described above, the performance parameter includes at least one of the storage capacity, the maximum read speed, and the maximum write speed of the storage device.
[0135] Optionally, the functional characteristic information includes at least one of the nominal optimal capacity, theoretical reading speed, and theoretical writing speed of the firmware.
[0136] In some embodiments, step (4312.3) includes steps (4312.3.1) to step (4312.3.3).
[0137] (4312.3.1) Calculate the capacity fit of the firmware based on the storage capacity of the storage device and the nominal optimal capacity of the firmware.
[0138] In some embodiments, when the storage capacity of the storage device is greater than or equal to the nominal optimal capacity of the firmware multiplied by a first preset ratio, it is determined that the firmware needs to operate at overcapacity, and the capacity adaptation of the firmware is determined to be a fourth preset value. When the storage capacity of the storage device is less than the nominal optimal capacity of the firmware multiplied by the first preset ratio and greater than the nominal optimal capacity multiplied by the second preset ratio, it is determined that the firmware can operate in the optimal capacity range, and the capacity adaptation of the firmware is determined to be a fifth preset value. When the storage capacity of the storage device is less than or equal to the nominal optimal capacity of the firmware multiplied by a third preset ratio and greater than the nominal optimal capacity multiplied by a fourth preset ratio, it is determined that the firmware can operate in the suboptimal capacity range, and the capacity adaptation of the firmware is determined to be a sixth preset value. When the storage capacity of the storage device is less than or equal to the nominal optimal capacity of the firmware multiplied by the fourth preset ratio, it is determined that the firmware will cause a waste of firmware performance, and the capacity adaptation of the firmware is determined to be a seventh preset value. The fifth preset value is greater than the fourth preset value, the sixth preset value, and the seventh preset value, and the sixth preset value is greater than the fourth preset value and the seventh preset value.
[0139] In some embodiments, the fourth preset value is smaller than the seventh preset value because when the firmware needs to run beyond its capacity, the performance of the storage device will be wasted, while when the firmware performance is wasted, the performance of the storage device will not be wasted.
[0140] Exemplarily, the fourth preset value is 60, the fifth preset value is 100, the sixth preset value is 85, and the seventh preset value is 70.
[0141] (4312.3.2) The read speed gain ratio is calculated based on the maximum read speed of the storage device and the theoretical read speed of the firmware. The write speed gain ratio is calculated based on the maximum write speed of the storage device and the theoretical write speed of the firmware. The overall read and write speed score is calculated based on the firmware's read speed gain ratio and write speed gain ratio.
[0142] In some embodiments, the calculation formula for the read speed gain ratio is: read performance gain ratio=min(maximum read speed / theoretical read speed, a first calculation parameter).
[0143] Among them, min represents the minimum value function.
[0144] Optionally, the first calculation parameter is 1, 1.2, or 1.5, etc.
[0145] In some embodiments, the calculation formula for the write speed gain ratio is: write performance gain ratio=min(maximum write speed / theoretical write speed, the second calculation parameter).
[0146] Optionally, the second calculation parameter is 1, 1.2, 1.3 or 1.5, etc.
[0147] In some embodiments, the calculation formula for the comprehensive read / write speed score is: comprehensive read / write speed score=(read speed gain ratio×third calculation parameter+read speed gain ratio×fourth calculation parameter)×100.
[0148] The sum of the third calculation parameter and the fourth calculation parameter is 1. Exemplarily, the third calculation parameter is 0.5, and the fourth calculation parameter is 0.5.
[0149] (4312.3.3) Calculate the performance fitness score for each firmware in the set of matching firmware based on its capacity fitness and combined read and write speed scores.
[0150] In some implementations, the capacity adaptability and the comprehensive read / write speed score of the firmware are weighted and added together to obtain the performance adaptability score of the firmware. The weights of the capacity adaptability and the comprehensive read / write speed score can be preset or determined by an artificial intelligence model.
[0151] (4312.4) Calculate the recommendation level of each firmware based on the compatibility score, stability score, and performance fit score of each firmware in the matching firmware set, and determine the firmware with the highest recommendation level.
[0152] In some embodiments, the formula for calculating the recommendation degree is: Recommendation degree = α × compatibility score + β × stability score + γ × performance fit score, where α is the weight of the compatibility score, β is the weight of the stability score, and γ is the weight of the performance fit score.
[0153] In some implementations, the weights in the calculation formula are updated using an artificial intelligence model to optimize the weight distribution. For example, the artificial intelligence model can be trained using the latest firmware update log data to increase the weight of the stability score when security vulnerabilities are frequent.
[0154] Step S4313: Determine whether the current firmware of the storage device is the most recommended firmware based on the version identifier of the current firmware and the version identifier of the most recommended firmware in the device information.
[0155] In some implementations, when the version identifier of the current firmware is not the same as the version identifier of the most highly recommended firmware, it is determined that the current firmware of the storage device is not the most highly recommended firmware; otherwise, it is determined that the current firmware of the storage device is the most highly recommended firmware.
[0156] Step S432: When the current firmware version of the storage device is not the firmware with the highest recommendation, the firmware with the highest recommendation is determined as the target version of the firmware.
[0157] In some implementations, when the current firmware version of the storage device is the most highly recommended firmware, the control state indication module is in a state indicating that there is no need to update the firmware.
[0158] Step S500: When it is determined that the storage device is in normal working state according to the fault information in the device information, the target version of the firmware is determined according to the received update command or device information, and the firmware of the storage device is updated to the target version of the firmware and all storage data in the storage device is retained.
[0159] In some implementations, when the storage device is in normal working order, a firmware update command is executed to update the storage device's firmware to the target version and preserve all stored data in the storage device. Because the storage device is in normal working order, there is no need to execute a card enable command to disable faulty storage units in the storage device. Executing the firmware update command preserves all stored data for subsequent use by the user.
[0160] In some implementations, “determining the target version of firmware according to the received update command or device information” in step S500 includes steps S410 to S430.
[0161] In some embodiments, the firmware update device includes a status indication module. Optionally, the status indication module includes at least one of a light component, a display component, and an audio component. Figure 2 , Figure 2 This is a flow chart of the second implementation of the firmware update method provided in the embodiment of the present application. Figure 2As shown, at this time, the method further includes steps S600 to S800.
[0162] Step S600: When the storage device meets the firmware update condition, the control state indication module is in a state indicating that the firmware can be updated; otherwise, the control state indication module is in a state indicating that the firmware cannot be updated.
[0163] Step S700: When the firmware of the storage device is being updated, the control state indication module is in a state indicating that the firmware is being updated.
[0164] Step S800: When the firmware of the storage device has been updated to the target version of the firmware, the control state indicating module is in a state indicating that the update is completed.
[0165] In some implementations, when the firmware update operation fails, the status indication module is further controlled to be in a state indicating update failure.
[0166] In some embodiments, when the status indication module includes a light assembly, the light assembly may include a plurality of lights, each light being used to indicate a status. Optionally, each light has a different color.
[0167] Optionally, a text label indicating the status may be pre-printed on the housing of the firmware updating device near each light.
[0168] For example, the light assembly may include three lights, the first light being red, the second light being blue, and the third light being green. When the first light is on, it indicates a non-updatable state, when the second light is on, it indicates an updating state, and when the third light is on, it indicates an updateable state.
[0169] In some embodiments, the status of the plurality of lights is coded, and the update status is indicated by the color and blinking frequency of the plurality of lights.
[0170] For example, when the first light is constantly on, it indicates that the firmware cannot be updated; when the second light is flashing, it indicates that the firmware is being updated; when the third light is flashing, it indicates that the firmware is updated successfully; and when the first light is flashing, it indicates that the firmware has failed. When the first, second, and third lights are all flashing, it indicates that no firmware update is required.
[0171] In some embodiments, the status indication module includes a display screen component that controls the display screen to display information indicating that the firmware can be updated when the storage device meets the firmware update conditions, and otherwise controls the display screen to display information indicating that the firmware cannot be updated.
[0172] In some embodiments, the status indication module includes an audio component that controls the audio component to play an audio signal indicating that the firmware can be updated when the storage device meets the firmware update condition, and otherwise controls the audio component to play an audio signal indicating that the firmware cannot be updated.
[0173] In summary, the firmware update method provided by the embodiment of the present application has the following advantages:
[0174] 1. When the device information of the storage device is obtained in the firmware update file system, whether the storage device meets the firmware update conditions is determined based on the device information. When it is determined that the storage device meets the firmware update conditions, whether the storage device is in a write-protected state or a normal working state is determined based on the fault information in the device information, and then the firmware is updated. The firmware of the storage device can be updated when an update command is received or not, which greatly reduces the difficulty of firmware update and enables users to update the firmware locally.
[0175] 2. By performing security verification on storage devices based on device information, firmware updates can be performed only on storage devices produced by legitimate manufacturers, avoiding firmware updates on OEM storage devices that may cause damage to the storage devices.
[0176] 3. By determining the target version of the firmware based on device information when no update command is received within a preset time period, the user does not need to perform any operation during the entire firmware update process. The firmware of the storage device can be updated by simply connecting the firmware update device to the electronic device, which greatly simplifies the firmware update operation and further enables the user to update the firmware locally.
[0177] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the firmware update device provided in the embodiment of the present application. Figure 3 As shown, the firmware updating apparatus 300 includes an execution module 310 .
[0178] In some embodiments, the execution module 310 is used to execute the firmware update program in the firmware update device and enter the firmware update file system when detecting a connection with a firmware update device; when the device information of the storage device is obtained in the firmware update file system, determine whether the storage device meets the firmware update conditions based on the device information; when it is determined that the storage device meets the firmware update conditions, determine whether the storage device is in a write-protected state or a normal working state based on the fault information in the device information; when it is determined that the storage device is in a write-protected state based on the fault information in the device information, determine the target version of the firmware based on the received update command or device information, clear all stored data and fault information in the storage device, shield the faulty storage unit of the storage device, and update the firmware of the storage device to the target version of the firmware; when it is determined that the storage device is in a normal working state based on the fault information in the device information, determine the target version of the firmware based on the received update command or device information, update the firmware of the storage device to the target version of the firmware and retain all stored data in the storage device.
[0179] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Figure 4 A processor 410 is taken as an example.
[0180] In some embodiments, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 4 The bus connection is taken as an example.
[0181] In some embodiments, the processor 410 is used to execute the firmware update program in the firmware update device and enter the firmware update file system when detecting a connection with a firmware update device; when device information of the storage device is obtained in the firmware update file system, determine whether the storage device meets the firmware update conditions based on the device information; when it is determined that the storage device meets the firmware update conditions, determine whether the storage device is in a write-protected state or a normal working state based on the fault information in the device information; when it is determined that the storage device is in a write-protected state based on the fault information in the device information, determine the target version of the firmware based on the received update command or device information, clear all stored data and fault information in the storage device, shield the faulty storage unit of the storage device, and update the firmware of the storage device to the target version of the firmware; when it is determined that the storage device is in a normal working state based on the fault information in the device information, determine the target version of the firmware based on the received update command or device information, update the firmware of the storage device to the target version of the firmware and retain all stored data in the storage device.
[0182] In some embodiments, memory 420 serves as a non-volatile firmware update device and can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as the program instructions / modules of the firmware update method in the embodiments of the present application. Processor 410 executes the non-volatile software programs, instructions, and modules stored in memory 420 to execute various functional applications and data processing of electronic device 400, thereby implementing the firmware update method of the above-mentioned method embodiment.
[0183] In some embodiments, the memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device 400, etc. In addition, the memory 420 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely located relative to the processor 410, and these remote memories may be connected to the controller via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0184] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, perform the firmware update method in any of the above method embodiments, for example, perform the above described Figure 1 Method steps S100 to S500.
[0185] Please refer to Figure 5 , Figure 5 The firmware update device 500 stores a firmware update program 510, which can be called by a processor to execute the firmware update method described in the above method embodiment.
[0186] The firmware update device 500 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Optionally, the firmware update device includes a non-volatile computer-readable medium. The firmware update device 500 has storage space for a firmware update program that performs any of the steps in the firmware update method described above. These firmware update programs can be read from or written to one or more computer program products. The firmware update programs can be compressed, for example, in a suitable format.
[0187] As described above, in some embodiments, the firmware update device includes a status indication module.
[0188] In some embodiments, the firmware update device includes a micro-supercapacitor. The micro-supercapacitor is used to temporarily power the firmware update device in the event of a power outage during a firmware update operation. This prevents the firmware update operation from being interrupted after an unexpected power outage, potentially leading to a storage device failure.
[0189] In some embodiments, the firmware update device includes a power supply detection module. When the firmware update device is connected to an electronic device via an interface, the power supply detection module is configured to detect whether the voltage at the interface is stable. If the voltage at the interface is stable after a preset period of time, the firmware update device controls the status indication module to indicate a stable power supply. Otherwise, the firmware update device controls the status indication module to indicate an unstable power supply. This reduces the risk of unexpected power outages during firmware updates.
[0190] In some implementations, the embodiments of the present application further provide a computer program product, including a computer program, which implements the above-mentioned firmware update method when executed by a processor.
[0191] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of the firmware update system provided by the embodiment of the present application. Figure 6 As shown, the present application further provides a firmware update system 600 , which includes the electronic device 400 , the firmware update device 500 , and the storage device 700 as described above.
[0192] In summary, the present application provides a firmware update method, an electronic device, a firmware update device and a firmware update system, the firmware update method including: when detecting a connection with a firmware update device, executing a firmware update program in the firmware update device and entering a firmware update file system; when obtaining device information of a storage device in the firmware update file system, judging whether the storage device meets the firmware update conditions based on the device information; when judging that the storage device meets the firmware update conditions, judging whether the storage device is in a write-protected state or a normal working state based on the fault information in the device information; when judging that the storage device is in a write-protected state based on the fault information in the device information, determining a target version of firmware based on a received update command or device information, clearing all stored data and fault information in the storage device, shielding a faulty storage unit of the storage device, and updating the firmware of the storage device to a target version of firmware; when judging that the storage device is in a normal working state based on the fault information in the device information, determining a target version of firmware based on a received update command or device information, updating the firmware of the storage device to a target version of firmware and retaining all stored data in the storage device. This application determines whether the storage device meets the firmware update conditions based on the device information when the device information of the storage device is obtained in the firmware update file system. When it is determined that the storage device meets the firmware update conditions, it determines whether the storage device is in a write-protected state or a normal working state based on the fault information in the device information, and then updates the firmware. The firmware of the storage device can be updated when an update command is received or not, which greatly reduces the difficulty of firmware updating and allows users to update the firmware locally and independently.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A firmware update method, characterized in that: include: When a connection with a firmware update device is detected, executing a firmware update program in the firmware update device and entering a firmware update file system; When device information of a storage device is obtained in the firmware update file system, determining whether the storage device meets the firmware update condition according to the device information; When it is determined that the storage device meets the firmware update condition, determining whether the storage device is in a write-protected state or a normal working state according to the fault information in the device information; When it is determined that the storage device is in a write-protected state according to the fault information in the device information, determining a target version of firmware according to the received update command or the device information, clearing all stored data and fault information in the storage device, shielding the faulty storage unit of the storage device, and updating the firmware of the storage device to the target version of firmware; When it is determined that the storage device is in normal working condition based on the fault information in the device information, the target version of the firmware is determined based on the received update command or the device information, and the firmware of the storage device is updated to the target version of the firmware and all storage data in the storage device is retained.
2. The firmware update method according to claim 1, wherein: Before executing the firmware update program in the firmware update device and entering the firmware update file system upon detecting the connection with the firmware update device, the method further includes: Setting the system boot sequence to prioritize booting from the firmware update device; When detecting that the firmware update device is connected, executing the firmware update program in the firmware update device and entering the firmware update file system includes: When the system is started and a connection with the firmware update device is detected, the system starts from the firmware update device, executes a firmware update program in the firmware update device, and enters the firmware update file system.
3. The firmware update method according to claim 1, wherein: The device information includes a model of the storage device, and determining a target version of firmware according to the received update command or the device information includes: Determine the version identifiers of all firmware that match the storage device according to the model and firmware library in the device information; In response to receiving an update command, determining the target version of the firmware according to a version identifier in the update command, wherein the version identifier in the update command is one of all version identifiers of the firmware that matches the storage device; When no update command is received within a preset time period, the target version of firmware is determined according to the device information.
4. The firmware update method according to claim 3, wherein: The firmware update device includes a display screen, and the method further includes: In the firmware update file system, the firmware update device is controlled to display version identifiers of all firmwares matching the storage device on the display screen.
5. The firmware update method according to claim 3, wherein: The device information includes a version identifier of the current firmware of the storage device, and when no update command is received within a preset time period, determining the target version of the firmware according to the device information includes: When no update command is received within a preset time period, determining whether the current firmware of the storage device is the most recommended firmware based on the version identifier of the current firmware in the device information, the model, and the firmware library; When the current firmware version of the storage device is not the firmware with the highest recommendation degree, the firmware with the highest recommendation degree is determined as the target version of the firmware.
6. The firmware update method according to claim 5, wherein: When no update command is received within a preset time period, determining whether the current firmware of the storage device is the most highly recommended firmware based on the version identifier of the current firmware in the device information, the model, and the firmware library includes: When no update command is received within a preset time period, determining a performance parameter of the storage device according to the model, the performance parameter including at least one of a storage capacity, a maximum read speed, and a maximum write speed of the storage device; Determining a version identifier of the most recommended firmware corresponding to the storage device based on performance parameters of the storage device, compatibility information and functional characteristic information of each version of firmware in the firmware library; It is determined whether the current firmware of the storage device is the firmware with the highest recommendation degree according to the version identifier of the current firmware in the device information and the version identifier of the firmware with the highest recommendation degree.
7. The firmware update method according to claim 1, wherein: The firmware update device includes a status indication module, and the method further includes: When the storage device meets the firmware update condition, the status indication module is controlled to be in a state indicating that the storage device can be updated; otherwise, the status indication module is controlled to be in a state indicating that the storage device cannot be updated; When the firmware of the storage device is being updated, controlling the status indication module to be in a state indicating that the firmware is being updated; When the firmware of the storage device has been updated to the target version of firmware, the status indication module is controlled to be in a state indicating that the update is completed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the firmware update method according to any one of claims 1 to 7.
9. A firmware update device, characterized in that: The firmware update device stores a firmware update program, and the firmware update program is executed by a processor to implement the firmware update method according to any one of claims 1 to 7.
10. A firmware update system, characterized in that: The firmware updating system includes the electronic device according to claim 8, the firmware updating device according to claim 9, and a storage device.
Citation Information
Patent Citations
SSD firmware upgrading protection method and device
CN108733517A
SSD multi-particle compatible starting and upgrading method and device
CN109582225A
Firmware recovery method and device, computer equipment and storage medium
CN112214353A
Method and device for firmware repair
CN115481403A
Failure hard disk recovery method and system
CN115904820A