Firmware update methods, electronic devices and storage media

By obtaining device information and receiving update commands from the firmware update file system, BGA SSDs can perform autonomous firmware updates, solving the cumbersome problem of returning them to the factory for repair. Users can update the firmware independently and retain their data.

CN120428992BActive Publication Date: 2026-03-06AXD (ANXINDA) MEMORY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510539980.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2026-03-06
Estimated Expiration
2045-04-27

AI Technical Summary

Technical Problem

Current BGA SSD firmware updates require factory repair, which relies on professional personnel and cannot be completed by users themselves, making the process cumbersome.

Method used

By obtaining storage device information from the firmware update file system and receiving firmware version update commands, the firmware update is automatically performed, while preserving storage data and serial numbers.

Benefits of technology

Users can complete firmware updates locally, reducing the difficulty of updates, preserving stored data, and facilitating subsequent repairs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120428992B_ABST
    Figure CN120428992B_ABST
Patent Text Reader

Abstract

This invention discloses a firmware update method, an electronic device, and a storage medium. The firmware update method includes obtaining a firmware update program; executing the firmware update program to enter a firmware update file system; and when device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, updating the firmware of the storage device to the target firmware version while retaining all storage data and serial number of the storage device. This application simplifies firmware updates by automatically updating the storage device's firmware to the target firmware version upon receiving a firmware version update command, while retaining all storage data and serial number. This allows users to update firmware locally without further intervention, reducing the complexity of firmware updates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chip technology, and more specifically to a firmware update method, an electronic device, and a storage medium. Background Technology

[0002] With the rapid development of storage device technology, solid-state drives (SSDs) have become widely used. When SSDs experience read / write errors, storage unit failures, or compatibility issues, it is often necessary to update the SSD's firmware to enable it to continue functioning normally.

[0003] BGA (Ball Grid Array) SSDs are solid-state drives that use ball grid array packaging technology. The flash memory and controller of a BGA SSD are usually packaged together, making repairs more expensive if a fault occurs. Currently, firmware updates for BGA SSDs generally involve returning them to the factory for repair. Specifically, users need to send the BGA SSD back to the manufacturer, where technicians use specialized debugging tools to connect to the controller chip and manually back up the original firmware, erase historical data, mark faulty storage cells, and load the new firmware. Sometimes, specific hardware interfaces or jumper settings are required to put the BGA SSD into debug mode.

[0004] However, the process of returning a BGA SSD to the factory for repair requires the user to send the BGA SSD back to the original manufacturer and is highly dependent on professional personnel, making it impossible for the user to complete the firmware update independently. The entire firmware update process is very troublesome. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this application provides a firmware update method, an electronic device, and a storage medium. By obtaining the device information of the storage device in the firmware update file system and receiving a firmware version update command, the firmware of the storage device is updated to the target firmware version, while retaining all storage data and serial number of the storage device. The firmware update operation can be automatically executed simply by receiving the firmware version update command, reducing the difficulty of firmware updates and enabling users to update the firmware independently locally.

[0006] To address the above problems, the present invention provides the following technical solution:

[0007] In a first aspect, embodiments of this application provide a firmware update method, including: obtaining a firmware update program;

[0008] Execute the firmware update program to enter the firmware update file system;

[0009] When the device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, the firmware of the storage device is updated to the target version of the firmware, and all storage data and serial number of the storage device are retained.

[0010] In some implementations, executing the firmware update program to enter the firmware update file system includes:

[0011] Obtain parameter configuration information, which includes at least one parameter among storage space allocation information, security verification information, and storage mode of the storage device;

[0012] The firmware update program is executed based on the parameter configuration information, generating and entering the firmware update file system.

[0013] In some embodiments, the method further includes:

[0014] A recommended firmware set is generated based on the storage data and device information of the storage device, the firmware set including at least one version of firmware;

[0015] In response to receiving a selection command, a target firmware version is determined based on the selection command, wherein the target firmware version is a firmware version from the firmware set.

[0016] In some implementations, generating a recommended firmware set based on the storage data and device information of the storage device includes:

[0017] Identify all file types in the stored data;

[0018] The performance requirements of the storage device are determined based on the number of file types in the stored data and the number of files included in each file type.

[0019] The current device status of the storage device is determined based on the device information, which includes the data error rate, storage capacity, and used capacity of the storage device.

[0020] A recommended firmware set is generated based on the performance requirements of the storage device, the current device status, and the compatibility and feature information of each firmware version.

[0021] In some implementations, determining the performance requirements of the storage device based on the number of file types in the stored data and the number of files of each file type includes:

[0022] Calculate the file type distribution entropy value based on the number of file types in the stored data and the number of files included in each file type;

[0023] The purpose of the storage device is determined based on the file type distribution entropy value and the proportion of the file size of each file type to the total size of stored data.

[0024] The performance requirements of the storage device are determined based on its intended use.

[0025] In some embodiments, the storage device is used for storing office documents, video files or image files, and model design files. Determining the performance requirements of the storage device based on its intended use includes:

[0026] When the storage device is used to store office documents, the performance requirement of the storage device is determined to be that the performance parameter of storage reliability needs to be greater than a first preset value.

[0027] When the storage device is used to store video files or image files, the performance requirement of the storage device is determined to be that it needs to have the maximum storage capacity and the write speed needs to be greater than the first preset speed.

[0028] When the purpose of the storage device is to store model design files, the performance requirements of the storage device are determined to be that the read speed needs to be greater than the second preset speed and the write speed needs to be greater than the third preset speed.

[0029] In some implementations, generating a recommended firmware set based on the performance requirements of the storage device, the current device status, and compatibility and feature information of each firmware version includes:

[0030] Read the firmware compatibility information matrix and functional feature information matrix from the firmware library. The firmware compatibility information matrix includes the compatibility score of each version of the firmware in multiple adaptation scenarios for each type of storage device. The functional feature information matrix includes multiple functional feature parameters of each version of the firmware. The functional feature parameters include the values ​​of the storage device's maximum write speed, maximum read speed, maximum storage capacity, and storage reliability when using the firmware.

[0031] The recommendation score for each firmware version is calculated based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional feature information matrix.

[0032] Generate a firmware set that includes all firmware versions with a recommendation score higher than the second preset value.

[0033] In some implementations, the calculation of a recommendation score for each firmware version based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the feature information matrix includes:

[0034] The performance requirements of the storage device, the current device status, and the firmware compatibility information matrix and functional feature information matrix are input into the firmware recommendation calculation model to obtain the recommendation score for each version of the firmware.

[0035] Secondly, embodiments of this application provide an electronic device, the electronic device comprising:

[0036] At least one processor; and,

[0037] A memory communicatively connected to the at least one processor; wherein,

[0038] The memory stores instructions that can be 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.

[0039] Thirdly, embodiments of this application provide a computer-readable storage medium storing an executable program, which is executed by a processor to implement the firmware update method as described in the first aspect.

[0040] This application provides a firmware update method, an electronic device, and a storage medium. This application updates the firmware of the storage device to the target version when the device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, while retaining all the storage data and serial number of the storage device. The firmware update operation can be automatically executed as soon as the firmware version update command is received, which reduces the difficulty of firmware update and allows users to update the firmware independently locally. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating the first embodiment of the firmware update method provided in this application.

[0042] Figure 2 This is a flowchart illustrating the second embodiment of the firmware update method provided in this application.

[0043] Figure 3 This is a schematic diagram of the firmware update device provided in the embodiments of this application.

[0044] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0045] Figure 5 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort 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 indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "multiple" means two or more, unless otherwise explicitly specified.

[0048] This application provides a firmware update method, an electronic device, and a storage medium. By obtaining the storage device's device information from the firmware update file system and receiving a firmware version update command, the storage device's firmware is updated to the target version while retaining all storage data and the serial number. The firmware update operation is automatically executed upon receiving the firmware version update command, reducing the difficulty of firmware updates and allowing users to update the firmware locally. Simultaneously, all storage data is retained so that users can continue to use the storage device. Furthermore, the storage device's serial number is retained so that the storage device can be verified during subsequent repairs.

[0049] The storage device involved in this application can be a hard disk drive (HDD), an SSD, an optical disc storage device, or a memory card, etc. The SSD can be a BGA SSD. A BGA SSD can include Flash memory chips, which can include NOR Flash and NAND Flash, etc. The following example uses a BGA SSD as the storage device, but this should not be considered a limitation of this application.

[0050] The firmware update method provided in this application will be described in detail below with reference to the accompanying drawings.

[0051] Please see Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the firmware update method provided in this application. Figure 1 As shown, the firmware update method includes steps S100 to S300.

[0052] Step S100: Obtain the firmware update program.

[0053] In some implementations, when a firmware update operation needs to be performed on the 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 access the target system. The firmware update toolkit includes multiple files for performing firmware update operations on the target system.

[0054] Optionally, the firmware update toolkit is a folder.

[0055] In some implementations, when a firmware update operation needs to be performed on the target system and the current operating system of the electronic device is the target system, the firmware update program only includes the firmware update toolkit.

[0056] Optionally, the target system can be a Linux system. Linux is an open-source operating system with high customizability and cross-platform compatibility. Therefore, firmware update toolkits developed based on Linux can adapt to various hardware platforms, thereby enabling the firmware update method of this application to be applied to storage devices on various hardware platforms.

[0057] Alternatively, the current operating system of the electronic device may be Windows.

[0058] Optionally, the firmware update toolkit includes a card activation tool and the target version of firmware. The card activation tool is used to generate an executable file for burning the target version of firmware into the storage device based on parameter configuration information. The card activation tool can also be used to generate the target version of firmware based on parameter configuration information.

[0059] Optionally, the firmware update toolkit may also include other files for performing firmware update operations.

[0060] Optionally, the Linux system kernel is the Kylin system kernel.

[0061] Step S200: Execute the firmware update program to enter the firmware update file system.

[0062] In some implementations, the firmware update file system is a folder containing multiple files. Opening the firmware update folder within the firmware update toolkit of the firmware update program leads to the firmware update file system. In this case, the firmware update toolkit or firmware update file system may not include the target firmware version. After obtaining the storage device's device information, the code file for the target firmware version can be determined based on the device information and added to the firmware update file system.

[0063] In some implementations, the firmware update toolkit includes the code files for the target version of the firmware. After generating an executable file for burning the target version of the firmware into a storage device using an activation tool program, a firmware update filesystem can be created and accessed.

[0064] In some implementations, after using an activation tool to generate an executable file for burning the target version of firmware into a storage device and generating the target version of firmware based on parameter configuration information, a firmware update file system can be generated and entered.

[0065] In some implementations, step S200 includes steps S210 to S220.

[0066] Step S210: Obtain parameter configuration information.

[0067] The parameter configuration information includes at least one parameter from the storage device's storage space allocation information, security verification information, and storage mode.

[0068] Optionally, the storage space allocation information is used to divide the storage space in the storage device. For example, the storage space allocation information is used to divide the storage space in the storage device into multiple sub-storage spaces and to set the size of each sub-storage space.

[0069] Optionally, the storage space allocation information may also include the name of each sub-storage space.

[0070] Optionally, a sub-storage space is a cache space within the storage device. The cache space can be an SLC cache space.

[0071] Optionally, the security verification information is used to determine whether to perform a security verification on the storage device before performing a firmware update operation and which verification method to use.

[0072] Optionally, the verification methods include TCG (Trusted Computing Group) security verification and deep verification. Deep verification includes verifying the firmware and serial number.

[0073] Optionally, storage modes include balanced write mode, concentrated write mode, and reliable storage mode. Balanced write mode writes data evenly to each storage cell or storage area of ​​the storage device to avoid premature wear or performance degradation caused by overwriting of certain specific areas.

[0074] Centralized write mode involves writing data centrally to a specific storage area on the storage device. When a storage device uses centralized write mode, frequently accessed data can be stored in a specific storage area, allowing for quick data location and retrieval.

[0075] In reliable storage mode, the risk of information loss is reduced by writing data to storage cells with a longer predicted lifespan, backing up data, controlling read and write speeds to control operating temperature, and providing fault warnings based on the device status of the storage device.

[0076] In some implementations, the parameter configuration information also includes test procedure information. Basic test information includes whether to perform bad block recovery and / or power management tests on the storage device before executing the card opening command.

[0077] In some implementations, the parameter configuration information also includes timeout settings, which include a preset time threshold. The timeout settings are used to determine card activation failure and automatically terminate the execution of the card activation command if the execution time exceeds the preset time threshold.

[0078] In some implementations, the parameter configuration information also includes serial number management information for the storage device.

[0079] Optionally, the serial number management information includes a start serial number, an end serial number, and a serial number mask rule. The serial number management information is used to determine the target serial number for each storage device when opening cards in batches.

[0080] In some implementations, users can set parameter configuration information according to their usage requirements for the storage device.

[0081] Step S220: Execute the firmware update program based on the parameter configuration information to generate and enter the firmware update file system.

[0082] In some implementations, after entering the target system based on the target version of the system kernel, all parameters in the parameter configuration information are input into the card activation tool program, generating multiple executable files for burning the target version of firmware into the storage device. All executable files are then stored in the target folder within the firmware update program, thus generating a firmware update file system. The firmware update file system includes all files used to perform firmware update operations.

[0083] In some implementations, the SIM card activation tool program is also used to generate the target version of firmware based on the parameter configuration information, and store the target version of firmware in the firmware folder of the firmware update program. Specifically, the SIM card activation tool program includes pre-built firmware code, which can be compiled and generated into an executable file of the target version of firmware based on all parameters in the parameter configuration information and the pre-built firmware code. The pre-built firmware code can be the code for one version of firmware, but the parameters therein can be ultimately determined based on the parameter configuration information.

[0084] Optionally, the target folder is located within the firmware update toolkit. After storing all executable files in the target folder within the firmware update toolkit, all files in the firmware update toolkit constitute the firmware update file system.

[0085] Optionally, the firmware update file system may include multiple subfolders, and each subfolder may include multiple files or folders.

[0086] Optionally, the generated executable files are also used to perform security verification on the storage device based on parameter configuration information when performing the card opening operation, and to configure the parameters of the storage device.

[0087] In some implementations, after inputting all parameters from the parameter configuration information into the card activation tool program, the card activation operation is performed within the card activation tool program to perform card activation testing on a test storage device of the same model as the storage device. Upon receiving a successful card activation message from the test storage device, a file generation operation is performed within the card activation tool program to generate multiple executable files for burning the target version of firmware into the storage device. This method ensures that the generated executable files can be used to perform the correct firmware burning operation.

[0088] In some implementations, the firmware update file system is stored on an external firmware update device.

[0089] Optionally, firmware update devices include USB flash drives and external hard drives. When the electronic device includes a USB interface, a USB flash drive can be used as an external firmware update device. When the electronic device includes other types of interfaces, a firmware update device with an interface compatible with the electronic device can be used.

[0090] In some implementations, prior to step S200, the method further includes setting the system boot order to preferentially boot from the firmware update device. Step S200 includes booting from the firmware update device at startup and entering the firmware update file system stored on the firmware update device.

[0091] In some implementations, the firmware update file system is stored within the firmware update device inside the electronic device. For example, the firmware update file system is stored on the system hard drive inside the electronic device. In this case, the system can boot from the system hard drive inside the electronic device according to the default system boot order and enter the firmware update file system.

[0092] In some implementations, the firmware update file system is accessed, including steps (220.1) through (220.3).

[0093] (220.1) Enter the initial interface of the firmware update file system.

[0094] In some implementations, the firmware update file system is a folder containing multiple files; opening this folder leads to the initial interface of the firmware update file system.

[0095] (220.2) In response to receiving the unlock command and obtaining the unlock password, unlock firmware update operation permission.

[0096] Optionally, the command identifier and unlock password for the unlock command are preset. When the command identifier for the unlock command is received, the password is obtained and it is verified whether the password is a preset unlock password. If the password is verified to be a preset unlock password, firmware update operation permissions are unlocked.

[0097] For example, the command identifier for the unlock command is "sudo su".

[0098] Optionally, if the password is a preset unlock password, root access is unlocked. Root access is the highest level of access, meaning the user has complete control over the system. After unlocking root access, firmware update permissions are also unlocked.

[0099] (220.3) In response to receiving a file execution command, execute the firmware update target executable file in the file system according to the file execution command and enter the operation interface.

[0100] In some implementations, the target executable file is executed based on the file identifier of the target executable file carried by the file execution command, and the operation interface is entered.

[0101] For example, the file identifier carried by the file execution command is . / NVMe Tool ARCH64, and the file name of the target executable file is NVMe ToolARCH64.

[0102] In some implementations, the user interface displays command identifiers for all executable commands and instructions for each executable command.

[0103] In some implementations, all executable commands include card activation commands and commands from additional functions.

[0104] In some implementations, the activation command includes a brand new activation command, a serial number-set activation command, and a serial number-preserving activation command. When an activation command is executed, all storage data and fault information on the storage device are cleared, faulty storage units are masked, and the storage device's firmware is updated to the target firmware version. When a brand new activation command is executed, the storage device's serial number is also set to a preset serial number. When a serial number-set activation command is executed, the storage device's serial number is also set to the target serial number carried in the serial number-set activation command. When a serial number-preserving activation command is executed, the storage device's serial number remains unchanged.

[0105] In some implementations, the commands in the additional functions include commands to view device information, to view SMART (Self-Monitoring, Analysis and Reporting Technology) information, to update firmware version, to view storage device operating information, to retrieve index data blocks, to dump WPRO (Write-Protect Register or other related) data, to dump debug information, to dump all data, and to retrieve relevant information about the storage device. The storage device operating information includes storage space utilization, I / O operation latency, etc. The index data block data is used to determine the data management method used by the storage device. The command to retrieve relevant information about the storage device is used to execute the commands to view SMART information, view storage device operating information, retrieve index data blocks, dump debug information, and dump WPRO data all at once.

[0106] In some implementations, when executing the firmware version update command, the firmware of the storage device is updated to the target firmware version, while the storage data and serial number of the storage device are retained.

[0107] Step S300: When the device information of the storage device is obtained in the firmware update file system and the firmware version update command is received, the firmware of the storage device is updated to the target version of the firmware, and all storage data and serial number of the storage device are retained.

[0108] In some implementations, the device information includes information such as the manufacturer information, model, serial number, and current firmware version identifier of the storage device.

[0109] In some implementations, the device information also includes operational information about the storage device. Optionally, the operational information includes information such as read / write speed, error rate, storage capacity, and used capacity.

[0110] When device information for the storage device is obtained, it means that the electronic device can recognize the connection to the storage device, and the storage device does not have any physical damage that would affect its normal operation. In this case, a firmware update can be performed to allow the storage device to continue operating normally. The ability to obtain device information for the storage device can be referred to as disk recognition.

[0111] In some implementations, when the storage device's device information is obtained from the firmware update file system, this device information is displayed on the user interface. For example, the user interface may display information such as the current firmware version identifier of the storage device.

[0112] In some implementations, when the firmware update command is executed, the version identifier and serial number of the updated firmware version are displayed in the user interface for the user to check.

[0113] In some implementations, when a command line including a command prefix and a command identifier is received, the command type is identified based on the command identifier.

[0114] For example, the command prefix is ​​. / NVMe Tool ARCH64-1ist, the command identifier corresponding to the new card activation command is initial, and the command line corresponding to the new card activation command is . / NVMe ToolARCH64-1istinitial.

[0115] For example, the command identifier corresponding to the serial number activation command is set to initial--sn= <newserialnumber>New SerialNumber represents the target serial number. For example, the command line corresponding to the serial number activation command is . / NVMe Tool ARCH64-1ist initial--sn=AXD12240001, where AXD12240001 is the target serial number.

[0116] In some implementations, the serial number activation command may not carry a serial number. When the serial number activation command is received, a target serial number is generated based on the current time, geographical coordinates, and storage device model using a serial number generation algorithm corresponding to the storage device model, and then stored in the blockchain. In this way, the target serial number can serve as maintenance evidence, and like the original serial number, it can be verified by the manufacturer, facilitating subsequent maintenance of the storage device.

[0117] In some implementations, when opening cards for storage devices in batches, a target serial number for each storage device is generated based on the serial number management information in the parameter configuration information, and a card opening command with the set serial number is executed for each storage device based on the target serial number of each storage device.

[0118] For example, the command identifier corresponding to the serial number activation command is initial keepsn, and the command line corresponding to the serial number activation command is . / NVMe ToolARCH64-1istinitial keepsn.

[0119] In some implementations, when no command is received, the device information of the storage device is obtained from the firmware update file system, and when the device information is obtained, the initial device information is displayed in the operation interface.

[0120] For example, the command identifier corresponding to the command for viewing SMART information is "smart," and the command line corresponding to the command for viewing SMART information is ". / NVMe Tool ARCH64-1ist smart." In some implementations, when the command to view SMART information is executed, fault information in the SMART information is identified, and it is determined whether the storage device has entered a write-protected state based on the fault information. If the storage device has entered a write-protected state, the write-protected state of the storage device is released through a card unlocking operation, so that data can be written to the storage device.

[0121] In some implementations, the fault information is a fault code. When the fault code is 0x00, it indicates that the storage device is in normal working condition. When the fault code is 0x08, it indicates that the storage device has entered write-protected state.

[0122] In some implementations, when the fault information indicates that the storage device has entered a write-protected state, an unlock command is automatically executed to release the write protection of the storage device. Optionally, the unlock command can be a completely new unlock command.

[0123] In some implementations, when the storage device is determined to be in normal working condition based on the fault information, and the current firmware version is determined not to be the target version based on the current firmware version identifier in the device information, a firmware version update command is automatically executed to update the storage device firmware to the target firmware version and retain all stored data.

[0124] In some implementations, the target version of firmware is a firmware generated based on parameter configuration information in the firmware update program, or it may be a firmware pre-stored in the firmware update file system.

[0125] In some implementations, the target version of firmware may be a firmware from a firmware library.

[0126] Optionally, the target firmware version adapted to the storage device is determined based on the storage device model and firmware library in the device information. The target firmware version can be the latest version of firmware adapted to the storage device. The firmware library pre-stores version identifiers, release dates, and code files of all firmware adapted to each model of storage device.

[0127] Optionally, the firmware library can be pre-stored in the firmware update file system.

[0128] Optionally, the firmware library can be stored on a server and updated in real time, and the firmware library on the server can be read online in the firmware update file system.

[0129] In some implementations, because storage devices have different usage characteristics, the latest firmware version may not be the most suitable firmware for the storage device. Therefore, a set of recommended firmware versions can be generated based on the usage characteristics of the storage device, and then the most suitable target firmware version for the storage device can be selected from this set.

[0130] The usage characteristics of a storage device can include its intended purpose. The stored data within the storage device reflects its primary use. Different purposes often have different performance requirements. For example, when a storage device is used to store video or image data, because the video or image files are large, a high write speed and maximum storage capacity are required; however, since the storage device is often used as a local backup disk in this case, frequent read and write operations are not necessary, so a very high read speed is not required. The firmware of a storage device can be used to configure the storage mode and storage space allocation method when the storage device is operating, thereby changing the performance parameters of the storage device. Performance parameters can include storage capacity, write speed, and read speed. Therefore, a recommended firmware set can be generated based on the storage data and device information of the storage device, and then the target firmware version can be determined based on the recommended firmware set to ensure that the performance parameters of the storage device meet the performance requirements.

[0131] Please see Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the firmware update method provided in this application. Figure 2 As shown, in some embodiments, the method further includes steps S400 to S500 before updating the firmware of the storage device to the target version of the firmware.

[0132] Step S400: Generate a set of recommended firmware versions based on the storage data and device information of the storage device.

[0133] The firmware set includes at least one version of firmware.

[0134] In some implementations, step S400 includes steps S410 to S440.

[0135] Step S410: Identify all file types in the stored data.

[0136] In some implementations, file types include video files, image files, document files, audio files, model design files, source code files, etc. Among these, model design files include static 3D model files and animated model files, which are file types used for design.

[0137] Step S420: Determine the performance requirements of the storage device based on the number of file types in the stored data and the number of files included in each file type.

[0138] In some implementations, step S420 includes steps S421 to S423.

[0139] Step S421: Calculate the file type distribution entropy value based on the number of file types in the stored data and the number of files included in each file type.

[0140] In some implementations, the probability of occurrence of each file type is calculated based on the number of files included in each file type and the total number of files, and then the file type distribution entropy value is calculated based on the probability of occurrence of each file type and the number of file types.

[0141] In some implementations, the formula for calculating the file type distribution entropy is:

[0142]

[0143] Where, p i Let n represent the probability of the i-th file type occurring. i h represents the number of files included in the i-th file type, N represents the total number of files, and h i This represents the entropy value of the file type distribution for storing data, where k represents the number of file types.

[0144] The file type distribution entropy value can be used to represent the degree of dispersion of file types in stored data. The larger the file type distribution entropy value, the closer the number of files of each file type is to being equal, and the more evenly the files of each file type are distributed in the stored data.

[0145] Step S422: Determine the purpose of the storage device based on the file type distribution entropy value and the proportion of the file size of each file type to the total stored data size.

[0146] When there are few files of a certain file type, the file size may be large, and the proportion of that file type's size to the total stored data size may also be large. The file type distribution entropy value is calculated based on the number of files. Therefore, combining the file type distribution entropy value with the proportion of each file type's size to the total stored data size can more accurately determine the purpose of the storage device.

[0147] In some implementations, when the file type distribution entropy value is not greater than the second preset value, and the largest ratio among all ratios is greater than the first preset ratio value, it indicates that the number and size of files of a certain file type corresponding to the first preset ratio value are both large. Therefore, it can be determined that the storage device is mainly used to store files of a certain file type corresponding to the first preset ratio value, and the purpose of the storage device can be determined based on the file type.

[0148] Optionally, the second preset value is 0.8, 0.85, or 0.9, etc. Optionally, the first preset ratio value is 0.5, 0.6, or 0.7, etc.

[0149] In some implementations, the storage device is used for storing office documents, video files or image files, and model design files. Office documents include document files, spreadsheet files, PowerPoint presentations, and source code files.

[0150] Alternatively, the storage device can also be used to store various files.

[0151] In some implementations, when the largest proportion among all proportions is not greater than a first preset proportion value, it indicates that the proportion of file sizes corresponding to the first preset proportion value for a particular file type is not very large. In this case, the purpose of the storage device is further determined based on the file type distribution entropy value and the probability of occurrence of the file type. When the file type distribution entropy value is not greater than a second preset value, and the probability of occurrence of a file type corresponding to the first preset proportion value is the highest, it indicates that the file types in the stored data are highly dispersed, and the number of files of the file type corresponding to the first preset proportion value is also large. Although the proportion of files of that file type is not very large, it can still be determined that the storage device is mainly used to store files of the file type corresponding to the first preset proportion value, and thus the purpose of the storage device can be determined based on that file type. When the file type distribution entropy value is greater than the second preset value, or when the file type distribution entropy value is not greater than the second preset value and the probability of occurrence of a file type corresponding to the first preset proportion value is not the highest probability, it can be determined that the purpose of the storage device is to store various files.

[0152] Step S423: Determine the performance requirements of the storage device based on its intended use.

[0153] In some implementations, when the storage device is used to store office documents, the performance requirement of the storage device is determined to be that the performance parameters for storage reliability need to be greater than a first preset value.

[0154] When a storage device is used to store office documents, the information in these documents is crucial, so the storage device needs to achieve high storage reliability to reduce the risk of data loss. This can be achieved by configuring the storage device's storage mode to a reliable storage mode via firmware settings.

[0155] In some implementations, when the storage device is used to store video files or image files, the performance requirements of the storage device are determined to be a maximum storage capacity and a write speed greater than a first preset speed.

[0156] When a storage device is used to store video or image files, because these files are large, the storage device needs to achieve its maximum storage capacity within the limitations of its hardware. Furthermore, because video or image files are large and take a long time to write, the storage device needs to achieve a high write speed.

[0157] In some implementations, when the storage device is used to store model design files, the performance requirements of the storage device are determined to be that the read speed needs to be greater than a second preset speed and the write speed needs to be greater than a third preset speed.

[0158] When the storage device is used to store model design files, users need to frequently modify the model design files stored on the storage device, so the storage device needs to achieve high read and write speeds.

[0159] Alternatively, since model design files are often large, the performance requirements of the storage device can also include achieving the maximum storage capacity while ensuring that the read speed is greater than the second preset speed and the write speed is greater than the third preset speed.

[0160] In some implementations, when the purpose of the storage device is to store various files, the performance requirements of the storage device are determined to be balanced performance requirements.

[0161] Step S430: Determine the current device status of the storage device based on the device information.

[0162] The device information includes the storage device's data error rate, storage capacity, and used capacity.

[0163] In some implementations, when the data error rate of the storage device exceeds a preset error rate, the current device state of the storage device is determined to be a state with a large number of faulty storage units. When the current device state of the storage device is a state with a large number of faulty storage units, it indicates that the storage reliability of the storage device is already low, and the storage reliability can be improved by changing the storage mode of the storage device through firmware updates.

[0164] In some implementations, when the proportion of used capacity to storage capacity exceeds a second preset proportion, the current device state of the storage device is determined to be a state of insufficient storage capacity. When the current device state of the storage device is a state of insufficient storage capacity, the available storage capacity of the storage device can be expanded by subsequently changing the storage mode and storage space allocation method of the storage device through firmware.

[0165] Optionally, the second preset ratio is 0.7, 0.8, or 0.85, etc.

[0166] In some implementations, the device information also includes historical operating temperature information of the storage device. When the average operating temperature of the storage device is determined to be greater than a preset temperature threshold based on the historical operating temperature information, the current device state of the storage device is determined to be a high-temperature operating state. When the current device state of the storage device is a high-temperature operating state, it can be determined that the storage reliability of the storage device is already too low or about to become too low, and the storage reliability can be improved by changing the storage mode of the storage device through firmware.

[0167] In some implementations, the steps of determining the current device state of the storage device described above can be performed in combination, and the determined current device state may include multiple states. For example, when the data error rate of the storage device is greater than a preset error rate, and the proportion of used capacity to storage capacity is greater than a second preset proportion, the current device state of the storage device is determined to be a state with a large number of faulty storage units and insufficient storage capacity.

[0168] Step S440: Generate a set of recommended firmware versions based on the performance requirements of the storage device, the current device status, and the compatibility and feature information of each firmware version.

[0169] In some implementations, step S440 includes steps S441 to S443.

[0170] Step S441: Read the firmware compatibility information matrix and feature information matrix from the firmware library.

[0171] The firmware compatibility information matrix includes the compatibility score of each firmware version under multiple adaptation scenarios for each type of storage device. The functional feature information matrix includes multiple functional feature parameters of each firmware version, including the values ​​of the storage device's maximum write speed, maximum read speed, maximum storage capacity, and storage reliability when the firmware is used.

[0172] Optionally, a row number in the firmware compatibility information matrix corresponds to a firmware version, a column number corresponds to a storage device model, and an element in the firmware compatibility information matrix is ​​the compatibility score of a firmware version when adapted to a corresponding storage device model.

[0173] Optionally, a row number in the functional feature information matrix corresponds to a firmware version, a column number corresponds to a functional feature parameter, and an element in the functional feature information matrix is ​​the value of a functional feature parameter corresponding to a firmware version.

[0174] In some implementations, a historical update record matrix is ​​also read from the firmware library. This historical update record matrix includes the historical update success rate for each storage device model when updating each firmware version.

[0175] Optionally, a row number in the historical update record matrix corresponds to a firmware version, a column number corresponds to a storage device model, and an element in the feature information matrix represents the historical update success rate of a storage device model when updating to the corresponding firmware version.

[0176] Step S442: Calculate the recommendation score for each firmware version based on the storage device's performance requirements, current device status, firmware compatibility information matrix, and feature information matrix.

[0177] In some implementations, the performance requirements of the storage device, the current device status, and the firmware compatibility information matrix and feature information matrix are input into the firmware recommendation calculation model to obtain a recommendation score for each firmware version.

[0178] Optionally, the firmware recommendation calculation model may include a preset firmware recommendation calculation formula or a pre-trained artificial intelligence model.

[0179] Optionally, the artificial intelligence model may include models such as neural network models, Transformer-based models, and generative adversarial network models.

[0180] When the firmware recommendation calculation model is an artificial intelligence model, the parameters can be continuously updated by training the firmware recommendation calculation model with new training data.

[0181] In some implementations, step S442 includes steps (442.1) to (442.4).

[0182] (442.1) Generate the first performance requirement matrix based on the performance requirements of the storage device.

[0183] In some implementations, the performance requirement parameters in the first performance requirement matrix include minimum values ​​for write speed, read speed, storage capacity, and storage reliability. When a minimum value for a performance parameter is not determined based on the intended use of the storage device, the minimum value for that performance parameter is set to the corresponding default value.

[0184] Optionally, one column of the first performance requirement matrix corresponds to the minimum value of a performance parameter.

[0185] For example, when the storage device is used to store office documents, the minimum value of storage reliability in the first performance requirement matrix of the storage device is determined to be a first preset value, and the minimum values ​​of other performance parameters are the corresponding default values.

[0186] (442.2) Generate a device state matrix based on the current device state of the storage device.

[0187] As described above, the current device status can include multiple states. In some implementations, one row of the device status matrix represents the current device status of the storage device, and each column represents a single state. A single state could be a state with a large number of faulty storage units, a state with insufficient storage capacity, or a state operating at high temperatures, etc.

[0188] Optionally, when the value of an element in a column is a first value, it indicates that the current device state includes the state corresponding to that column; when the value of an element in a column is a second value, it indicates that the current device state does not include the state corresponding to that column. The first and second values ​​are different.

[0189] For example, the first value is 1 and the second value is 0.

[0190] (442.3) Generate a second performance requirement matrix based on the first performance requirement matrix and the device state matrix.

[0191] In some implementations, the performance requirement parameters in the first performance requirement matrix are modified based on the device state matrix to obtain the second performance requirement matrix.

[0192] Specifically, the performance requirement parameters in the first performance requirement matrix are modified according to each individual state included in the current device state matrix. For example, when the device state matrix determines that the current device state includes a state with many faulty storage units or a high-temperature operating state, the minimum value of storage reliability in the first performance requirement matrix is ​​modified to a first preset value. When the device state matrix determines that the current device state includes a state with many faulty storage units, the minimum value of storage reliability in the first performance requirement matrix is ​​modified to the first preset value. When the current device state includes a state with insufficient storage capacity, the minimum value of storage capacity in the first performance requirement matrix is ​​modified to the theoretical storage capacity of the storage device multiplied by a third preset ratio.

[0193] (442.4) Input the second performance requirement matrix, firmware compatibility information matrix and functional feature information matrix into the firmware recommendation calculation model to obtain the recommendation score matrix for each version of firmware.

[0194] As described above, the feature information matrix includes multiple feature parameters for each firmware version. These feature parameters include values ​​for the storage device's maximum write speed, maximum read speed, maximum storage capacity, and storage reliability when the firmware is used. In some implementations, the feature information matrix is ​​an A×B matrix, where A represents the number of firmware versions and B represents the number of feature parameters. B can be 4.

[0195] As described above, the second performance requirement matrix includes minimum values ​​for storage capacity, storage reliability, read speed, and write speed. In some implementations, the second performance requirement matrix is ​​a C×1 matrix, where C represents the number of minimum values ​​for the performance parameters in the second performance requirement matrix. C can be equal to B; for example, C can be 4.

[0196] In some implementations, when the firmware recommendation calculation model includes a preset firmware recommendation calculation formula, step (442.4) includes steps (442.4.1) to (442.4.4).

[0197] (442.4.1) For each row vector in the functional characteristic information matrix, if the value of at least one functional characteristic parameter in the row vector is lower than the lowest value of the same performance parameter in the second performance requirement matrix, the row vector is deleted to obtain the updated functional characteristic information matrix.

[0198] (442.4.2) Generate a performance weight matrix based on the second performance requirement matrix.

[0199] In some implementations, the performance weight matrix includes weights for storage capacity, storage reliability, read speed, and write speed.

[0200] Optionally, the performance weight matrix is ​​a C×1 matrix. Optionally, the performance requirement parameters in the second performance requirement matrix are divided into two parameter sets: the first parameter set includes performance requirement parameters with corresponding default values, and the second parameter set includes performance requirement parameters with values ​​that are not corresponding default values.

[0201] In some implementations, the formula for calculating the weight of the performance requirement parameters in the first parameter set is: weight of performance requirement parameter = first preset weight × (1 / total number of performance requirement parameters in the first parameter set).

[0202] In some implementations, the formula for calculating the weight of the performance requirement parameters in the second parameter set is: weight of performance requirement parameter = second preset weight × (1 / total number of performance requirement parameters in the second parameter set).

[0203] Optionally, the second preset weight is greater than the first preset weight. For example, the second preset weight is 0.7, and the second preset weight is 0.3.

[0204] In some implementations, the formula for calculating the weight of the performance requirement parameter can also be: weight of performance requirement parameter = weight of the parameter set to which the performance requirement parameter belongs × weight of the performance requirement parameter itself.

[0205] (442.4.3) Select a first target column vector corresponding to the model in the firmware compatibility information matrix based on the model in the device information.

[0206] The first target column vector includes the compatibility score of each firmware version when adapted to the storage device model.

[0207] Optionally, the target column vector is an A×1 column vector.

[0208] (442.4.4) Multiply the updated functional feature information matrix by the performance weight matrix on the left, and then multiply it by the first target column vector to obtain the first recommendation score matrix.

[0209] The first recommendation rating matrix is ​​a D×1 matrix, which includes the recommendation ratings of all firmware versions that are compatible with the storage device model and whose functional characteristic parameters are all no lower than the lowest value of the same performance parameter in the second performance requirement matrix. D represents the number of firmware versions whose functional characteristic parameters are all no lower than the lowest value of the same performance parameter in the second performance requirement matrix.

[0210] In some implementations, operational behavior information from the storage device can also be read, and a recommendation score for each firmware version can be calculated based on the storage device's performance requirements, current device status, operational behavior information, firmware compatibility information matrix, and feature information matrix. Optionally, the operational behavior information can be a record of read and write data actions performed by the storage device within a second preset time period most recent to the current time. For example, the operational behavior information may include records of writing 5GB of data and reading 3GB of data.

[0211] Optionally, the second preset time period can be 6 hours, 10 hours, 12 hours, 24 hours, 48 ​​hours, 3 days, 5 days, 7 days, 15 days, or 30 days, etc.

[0212] In some implementations, after reading the operation behavior information in the storage device, step (442.4.4) includes: determining the user behavior factor matrix based on the operation behavior information, then multiplying the updated functional characteristic information matrix by the user behavior factor matrix, then left-crossing the performance weight matrix, and then multiplying the first target column vector to obtain the first recommendation score matrix.

[0213] In some implementations, determining the user behavior factor matrix based on operation behavior information includes: calculating the time decay coefficient and the corresponding data size ratio of each read data behavior and each write data behavior based on the operation behavior information; multiplying the time decay coefficient of each read data behavior by the corresponding data size ratio and then summing them all to obtain the initial behavior factor of the read data behavior; multiplying the time decay coefficient of each write data behavior by the corresponding data size ratio and then summing them all to obtain the initial behavior factor of the write data behavior; performing a nonlinear transformation on each initial behavior factor to obtain the final behavior factor; and determining the user behavior factor matrix based on all the final behavior factors.

[0214] Optionally, the number of columns in the user behavior factor matrix is ​​the same as the number of columns in the functional characteristic information matrix, so that the user behavior factor matrix can be multiplied by the functional characteristic information matrix. In the user behavior factor matrix, the final behavior factor of the write data behavior corresponds to the position of the maximum write speed value in the functional characteristic information matrix, and the final behavior factor of the read data behavior corresponds to the position of the maximum read speed value in the functional characteristic information matrix. Behavior factors that do not correspond to functional characteristic parameters in the functional characteristic information matrix are 1.

[0215] For example, when one row vector of the functional characteristic information matrix is ​​[maximum write speed, maximum read speed, maximum storage capacity, storage reliability], the user behavior factor matrix is ​​[behavioral factor of write data behavior, behavioral factor of read data behavior, 1, 1].

[0216] In some implementations, the time decay factor for reading or writing data is calculated using the formula: r n =e -λΔt , where r n Let represent the nth user action, which can be either a data read or data write action. Let e ​​represent the base of the natural logarithm, and λ represent a preset calculation parameter, where λ is a positive number. Let Δt represent the time difference between the nth user action and the current time, where Δt is a positive number.

[0217] The later a user's behavior occurs, the more representative it is of the user's recent operational bias. By employing the above method, the later the user's behavior occurs, the smaller the time decay coefficient, which increases the behavioral factor of that behavior, thus biasing the calculation towards satisfying the user's recent operational bias.

[0218] In some implementations, the proportion of the data size corresponding to the user behavior operation is obtained by dividing the data size of the operation corresponding to the user behavior operation by the sum of the data sizes of all written and read data in the operation behavior information.

[0219] In some implementations, a hyperbolic tangent function can be used to perform a nonlinear transformation calculation on each initial behavior factor, with the calculation formula being: U n =tanh(u n ), where U n The final behavior factor for the nth user action is represented by tanh(), which represents the hyperbolic tangent function. n Let represent the initial behavior factor for the nth user action. In this way, because the gradient of the hyperbolic tangent function is larger when the input value is small, using the hyperbolic tangent function can amplify the numerical differences of the behavior factors when the initial behavior factor values ​​are small, making the user's operational bias more apparent. Furthermore, the range of the hyperbolic tangent function is [-1, 1], which helps to limit the final behavior factors to a single range for subsequent calculations.

[0220] In some implementations, functions such as the Sigmoid function or the ReLU function can be used to perform a nonlinear transformation on each initial behavior factor.

[0221] (442.4.5) Normalize the recommendation scores in the first recommendation score matrix to a preset range to obtain the second recommendation score matrix.

[0222] Optionally, the preset numerical range is 1 to 100. The difference between each recommendation score in the first recommendation score matrix and the smallest recommendation score is divided by the difference between the largest and smallest recommendation scores. The result is then multiplied by 100 to obtain the normalized recommendation score, which in turn yields the second recommendation score matrix.

[0223] In some implementations, the historical update record matrix in the firmware library is also read. In this case, step (442.4) further includes step (442.4.6).

[0224] (442.4.6) Calculate the third recommendation score matrix based on the historical update record matrix and the second recommendation score matrix.

[0225] In some implementations, a second target column vector corresponding to the model in the historical update record matrix is ​​selected based on the model in the device information, and the second recommendation score matrix is ​​multiplied by the second target column vector to obtain a third recommendation score matrix. The second target column vector includes the historical update success rate of the storage device of that model when updating each firmware version.

[0226] In some implementations, when the firmware recommendation calculation model is a pre-trained artificial intelligence model, step (442.4) includes steps (442.4.7) to (442.4.8).

[0227] (442.4.7) The second performance requirement matrix, firmware compatibility information matrix and functional characteristic information matrix are concatenated to obtain the input tensor.

[0228] In some implementations, the second performance requirement matrix, firmware compatibility information matrix, functional characteristic information matrix, and historical update record matrix can be concatenated to obtain the input tensor.

[0229] (442.4.8) Input the input tensor into the input layer of the firmware recommendation calculation model to obtain the recommendation score of each version of the firmware output by the output layer of the firmware recommendation calculation model.

[0230] In some implementations, operational behavior information is also input into the input layer. The operational behavior information is then used to extract features in the firmware recommendation calculation model to obtain user operation preference information. Finally, the recommendation score for each version of the firmware is output based on the input tensor and the user operation preference information.

[0231] Step S443: Generate a firmware set that includes all firmware versions with a recommendation score higher than the second preset value.

[0232] Optionally, the second preset value is 80, 85, or 90, etc.

[0233] In some implementations, a firmware set may also be generated that includes a first preset number of firmware versions with the highest recommendation ratings.

[0234] Optionally, the first preset quantity is 1, 2, 3 or 5, etc.

[0235] In some implementations, the version identifier of each firmware in the firmware set and the storage address of the firmware's code file are recorded.

[0236] In some implementations, the user interface displays the version identifier of each firmware in the firmware set. Optionally, the user interface may also display the version identifier, performance parameters, and recommendation rating of each firmware version in the firmware set for user selection.

[0237] Step S500: In response to receiving the selection command, determine the target firmware version based on the selection command.

[0238] The target version of firmware is a version of firmware from the firmware set.

[0239] In some implementations, if no selection command is received within a first preset time period, the firmware version with the highest recommendation score in the firmware set is determined as the target firmware version.

[0240] In some implementations, the code file of the target version of firmware is obtained from the firmware library based on the storage address of the target version of firmware.

[0241] Understandably, because the firmware recommendation score isn't calculated solely based on performance requirements, but rather on the storage device's performance needs, current device status, firmware compatibility information matrix, and feature information matrix, the storage device's performance parameters may not strictly meet the performance requirements after updating to the target firmware version. However, the target firmware version is determined based on multiple factors, making it a more suitable approach compared to solely relying on performance requirements.

[0242] In some implementations, when the storage device is intended for storing various files, the storage mode of the storage device is set to balanced write mode by the firmware of the target version.

[0243] In some implementations, when the storage device is used to store office documents, the storage mode of the storage device is set to reliable storage mode by using the target firmware version. In reliable storage mode, the risk of information loss is reduced by writing data to storage cells with a longer predicted lifespan, backing up storage data, controlling operating temperature, and providing fault warnings based on the device's status.

[0244] Optionally, in reliable storage mode, the storage space is divided into multiple storage subspaces, and the same data is stored in at least two storage spaces with copies. When the proportion of faulty storage cells in the storage device is detected to be greater than a fourth preset proportion, write protection mode is entered and a fault warning is issued to enable users to transfer data as soon as possible.

[0245] In some implementations, when the storage device is used to store model design files, the storage mode of the storage device is set to centralized write mode via the target firmware version. In centralized write mode, frequently accessed data can be centrally stored in specific storage areas, enabling rapid data location and retrieval. Because model design files are frequently read and modified, this method improves the read and write speed of the storage device, making it more suitable for storing model design files.

[0246] Optionally, in centralized write mode, the storage space of the storage device is divided into multiple sub-storage spaces, and one of these sub-storage spaces is designated as a cache space. When writing data to the storage device, the data is first written to the cache space, and then the data in the cache space is written to the other sub-storage spaces when the device is idle.

[0247] Optionally, the cache space can be a simulated SLC storage space. SLC is a type of storage unit that allows for fast data writing. In a simulated SLC storage space, the storage units are written to as if they were SLC storage units, which can greatly improve the write speed.

[0248] In some implementations, the size of the cache space can be dynamically adjusted in a tiered manner during centralized write mode. When the amount of data read / written exceeds a first preset data amount, the cache space size is determined to be a first size. When the amount of data read / written is no greater than the first preset data amount but greater than a second preset data amount, the cache space size is determined to be a second size, and so on.

[0249] Optionally, the first size can be larger than the first preset data volume, and the second size can be larger than the second preset data volume. For example, the first preset data volume is 100GB, the second preset data volume is 50GB, the first size is 105GB, and the second size is 51GB.

[0250] In some implementations, a hierarchical writing approach is used in the centralized write mode. Specifically, the storage space of the storage device is divided into multiple sub-storage spaces. When writing data, the data is first written to the first sub-storage space. When the first sub-storage space is full, the data is then written to the second sub-storage space. When the second sub-storage space is full, the data is then written to the third sub-storage space, and so on.

[0251] In some implementations, in centralized write mode, the storage space of the storage device is divided into multiple sub-storage spaces. Data is written to a fixed sub-storage space until it is determined that the sub-storage space is about to fail. Then, new data is written to the next sub-storage space in the order of activation. Because data is always written to the same sub-storage space, this method reduces the time spent finding the write address, thereby improving write speed. Furthermore, centralized write mode facilitates fault recovery. When a sub-storage space is about to fail, the next sub-storage space can be activated directly without complex data migration operations.

[0252] In some implementations, when the storage device is intended for use with video or image files, the storage mode can be set to centralized write mode via the target firmware version. This is because when the storage device is used for video or image files, it may be applied to scenarios where sequential writes are the primary function, such as storing logs or video surveillance. In these sequential write-centric applications, centralized write mode allows the storage device to perform data retrieval and management more efficiently compared to balanced write mode.

[0253] In some implementations, when the storage device is intended for video or image files, the target firmware version sets the storage mode of the storage device to a mode that compresses data before storing it, disables reserved storage space, and uses the target file system to store the data. Optionally, the target file system can be an NTFS or exFAT file system. Compared to the general FAT32 file system, NTFS or exFAT file systems can support storing larger files and achieve higher storage efficiency.

[0254] Optionally, when the storage device is intended for video or image files, the storage space allocation method can be set to a sub-storage space through the target firmware version. Since each sub-storage space has some space for storing file system metadata, this method avoids dividing the storage device into too many sub-storage spaces, thus increasing the available storage capacity of the storage device.

[0255] In some implementations, when the storage device is intended for storing various files, the storage mode of the storage device is set to balanced write mode by the firmware of the target version.

[0256] In summary, the firmware update method provided in this application has the following advantages:

[0257] 1. By retrieving the storage device's device information from the firmware update file system and receiving a firmware version update command, the system updates the storage device's firmware to the target version while retaining all storage data and the serial number. This automatic firmware update process, requiring only the receipt of the update command, simplifies the process and allows users to update the firmware locally. Furthermore, it preserves all storage data, ensuring continued use of the storage device. Additionally, it retains the storage device's serial number for verification during future repairs.

[0258] 2. By calculating the recommendation score for each firmware version based on the storage device's performance requirements, current device status, firmware compatibility information matrix, and functional feature information matrix, the system can determine the most suitable firmware for the storage device based on its usage characteristics, current device status, and firmware performance, thereby making the storage device more suitable for specific application scenarios.

[0259] 3. By setting the storage mode of the storage device to centralized write mode through the target firmware version when the storage device is used to store model design files, the read and write speed of the storage device can be improved, making the storage device more suitable for storing model design files.

[0260] 4. By dividing the storage device's space into multiple sub-storage spaces in centralized write mode, and writing data to a fixed sub-storage space until a sub-storage space is determined to fail, new data is written to the next sub-storage space in the order it becomes available. This reduces the time spent searching for write addresses, thereby improving write speed. Furthermore, centralized write mode facilitates fault recovery. When a sub-storage space is about to fail, the next sub-storage space can be directly activated without complex data migration operations.

[0261] Please see Figure 3 , Figure 3 This is a schematic diagram of the firmware update device provided in an embodiment of this application. Figure 3 As shown, the firmware update device 300 includes an acquisition module 310 and an execution module 320.

[0262] In some implementations, the acquisition module 310 is used to acquire the firmware update program.

[0263] In some implementations, the execution module 320 is used to execute a firmware update program to enter the firmware update file system; when the device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, the firmware of the storage device is updated to the target version of the firmware, and all storage data and serial number of the storage device are retained.

[0264] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420. Figure 4 Take a processor 410 as an example.

[0265] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0266] In some implementations, the processor 410 is configured to obtain a firmware update program; execute the firmware update program to enter the firmware update file system; when the device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, update the firmware of the storage device to the target version of the firmware, and retain all storage data and serial number of the storage device.

[0267] In some embodiments, memory 420 serves as a non-volatile computer-readable storage medium, 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 this application. Processor 410 executes various functional applications and data processing of electronic device 400 by running the non-volatile software programs, instructions, and modules stored in memory 420, thereby implementing the firmware update method of the above-described method embodiments.

[0268] In some embodiments, memory 420 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of electronic device 400, etc. Furthermore, memory 420 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 420 may optionally include memory remotely located relative to processor 410, and this remote memory may be connected to the controller via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0269] In some implementations, one or more modules are stored in 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, performing the method described above. Figure 1 The method steps S100 to S300.

[0270] Please refer to Figure 5 , Figure 5 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 500 stores program code 510, which can be called by a processor to execute the firmware update method described in the above method embodiments.

[0271] The computer-readable storage medium 500 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium includes a non-volatile computer-readable medium. The computer-readable storage medium 500 has storage space for program code that performs any of the method steps of the firmware update method described above. This program code can be read from or written to one or more computer program products. The program code may, for example, be compressed in a suitable form.

[0272] In some implementations, the computer-readable storage medium 500 may be a removable computer-readable storage medium, such as a USB flash drive or a portable hard drive.

[0273] In some embodiments, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the firmware update method described above.

[0274] In summary, this application provides a firmware update method, an electronic device, and a storage medium. The firmware update method includes: obtaining a firmware update program; executing the firmware update program to enter the firmware update file system; and when device information of the storage device is obtained from the firmware update file system and a firmware version update command is received, updating the firmware of the storage device to the target firmware version while retaining all storage data and the serial number of the storage device. This application automatically performs the firmware update operation upon receiving a firmware version update command, reducing the difficulty of firmware updates and allowing users to update the firmware locally. Simultaneously, all storage data is retained so that users can continue to use the storage device. Furthermore, the serial number of the storage device is retained so that the storage device can be verified during subsequent maintenance.

[0275] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application.< / newserialnumber>

Claims

1. A firmware update method characterized by comprising: The method comprises: obtaining a firmware update program; executing the firmware update program to enter a firmware update file system; generating a recommended firmware set according to storage data and device information of a storage device, the firmware set comprising at least one version of firmware; the generating of the recommended firmware set according to the storage data and the device information of the storage device comprises: identifying all file types in the storage data; determining performance requirements of the storage device based on the number of file types in the storage data and the number of files included in each file type; determining a current device state of the storage device according to the device information, the device information comprising a data error rate, a storage capacity and a used capacity of the storage device; generating the recommended firmware set based on the performance requirements of the storage device, the current device state, and compatibility information and functional characteristic information of each version of firmware; in response to receiving a selection command, determining a target version of firmware according to the selection command, the target version of firmware being one version of firmware in the firmware set; when device information of the storage device is obtained in the firmware update file system and a firmware version update command is received, updating firmware of the storage device to the target version of firmware, and retaining all storage data and a serial number of the storage device.

2. The firmware update method according to claim 1, characterized by, the executing of the firmware update program to enter the firmware update file system comprises: obtaining parameter configuration information, the parameter configuration information comprising at least one parameter in storage space allocation information, security check information and a storage mode of the storage device; executing the firmware update program based on the parameter configuration information to generate and enter the firmware update file system.

3. The firmware update method according to claim 1, wherein the determining of the performance requirements of the storage device based on the number of file types in the storage data and the number of files of each file type comprises: calculating a file type distribution entropy value according to the number of file types in the storage data and the number of files of each file type; determining a use of the storage device based on the file type distribution entropy value and a proportion of file size of each file type in all storage data size; determining the performance requirements of the storage device based on the use of the storage device.

4. The firmware update method according to claim 3, characterized by, the use of the storage device comprises storing office files, storing video files or picture files and storing model design files, and the determining of the performance requirements of the storage device based on the use of the storage device comprises: when the use of the storage device is storing office files, determining that the performance requirements of the storage device are that a performance parameter of storage reliability needs to be greater than a first preset value; when the use of the storage device is storing video files or picture files, determining that the performance requirements of the storage device are that a storage capacity needs to be maximum and a writing speed needs to be greater than a first preset speed; when the use of the storage device is storing model design files, determining that the performance requirements of the storage device are that a reading speed needs to be greater than a second preset speed and a writing speed needs to be greater than a third preset speed.

5. The firmware update method according to claim 1, wherein The generating the recommended firmware set based on the performance requirement of the storage device, the current device state, and the compatibility information and the functional characteristic information of each version of firmware comprises: reading a firmware compatibility information matrix and a functional characteristic information matrix in a firmware library, wherein the firmware compatibility information matrix comprises compatibility scores of each version of firmware in a plurality of adaptation cases of adapting a plurality of models of storage devices, and the functional characteristic information matrix comprises a plurality of functional characteristic parameters of each version of firmware, the functional characteristic parameters comprising numerical values of maximum write speed, maximum read speed, maximum storage capacity and storage reliability of the storage device when the firmware is adopted; calculating a recommendation score of each version of firmware based on the performance requirement of the storage device, the current device state, the firmware compatibility information matrix and the functional characteristic information matrix; generating a firmware set comprising all versions of firmware whose recommendation scores are higher than a second preset value.

6. The firmware update method according to claim 5, wherein The calculating the recommendation score of each version of firmware based on the performance requirement of the storage device, the current device state, the firmware compatibility information matrix and the functional characteristic information matrix comprises: inputting the performance requirement of the storage device, the current device state, and the firmware compatibility information matrix and the functional characteristic information matrix into a firmware recommendation score calculation model to obtain the recommendation score of each version of firmware.

7. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable 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 updating method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores executable code for updating firmware, and the executable code is executed by the processor to implement the firmware updating method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multi-firmware upgrading method and device

    CN110119280A

  • Firmware set updating method

    CN119829098A