Firmware updating method, electronic equipment and storage medium
By automatically updating the firmware of BGA SSD in the firmware update file system, the problem of users being unable to update independently is solved, and local independent update and data retention are achieved.
Patent Information
- Application Number
- CN202510539980.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The existing BGA SSD firmware update requires factory repair and relies on professional operations, and users cannot complete it independently, and the process is cumbersome.
By obtaining storage device information in the firmware update file system and receiving firmware version update commands, the firmware of the storage device is automatically updated to the target version and retaining the storage data and serial number.
Users can independently complete firmware updates locally, reducing the difficulty of updates, and retaining stored data for continued use, simplifying the repair process.
Smart Images

Figure CN120428992A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a firmware updating method, electronic equipment, and storage medium. Background Art
[0002] With the rapid development of storage device technology, solid-state drives (SSDs) have become widely used. When an SSD experiences read / write anomalies, storage unit failures, or compatibility issues, it is often necessary to update the SSD's firmware to enable it to continue functioning properly.
[0003] A BGA (Ball Grid Array) SSD is a solid-state drive that uses ball grid array packaging technology. The flash memory and controller of a BGA SSD are typically packaged together, making repair costs high in the event of a failure. Currently, firmware updates for BGA SSDs generally require returning the drive to the manufacturer for repair. Specifically, users must ship the BGA SSD back to the manufacturer, where technicians will connect to the BGA SSD's controller chip using a dedicated debugging tool to manually back up the original firmware, clear historical data, mark faulty storage cells, and load new firmware. Sometimes, specific hardware interfaces or jumper settings are required to put the BGA SSD into debug mode.
[0004] However, the factory repair method for BGA SSDs requires users to send the BGA SSD back to the original manufacturer and is highly dependent on professional personnel. This makes it impossible for users to complete firmware updates independently, and the entire firmware update process is very cumbersome. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present application provides a firmware update method, electronic device and storage medium. 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. The firmware update operation can be automatically executed by simply receiving the firmware version update command, which reduces the difficulty of firmware update and enables users to update the firmware locally.
[0006] In order to solve the above problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a firmware update method, comprising: obtaining a firmware update program;
[0008] Executing 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 firmware, and all storage data and serial numbers of the storage device are retained.
[0010] In some implementations, executing the firmware update program to enter a firmware update file system includes:
[0011] Acquire parameter configuration information, where the parameter configuration information includes storage space allocation information, security verification information, and at least one parameter of a storage mode of the storage device;
[0012] The firmware update program is executed based on the parameter configuration information, and the firmware update file system is generated and entered.
[0013] In some embodiments, the method further comprises:
[0014] generating a recommended version of a firmware set according to 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 version of firmware is determined according to the selection command, where the target version of firmware is a version of firmware in the firmware set.
[0016] In some implementations, generating a recommended version of a 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] determining a performance requirement 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;
[0019] determining a current device status of the storage device according to the device information, wherein the device information includes a data error rate, storage capacity, and used capacity of the storage device;
[0020] A recommended version of the firmware set is generated based on the performance requirements of the storage device, the current device status, and the compatibility information and functional characteristic information of each version of the firmware.
[0021] In some implementations, determining the performance requirement of the storage device based on the number of file types and the number of files of each file type in the stored data includes:
[0022] Calculating a file type distribution entropy value according to the number of file types in the stored data and the number of files included in each file type;
[0023] Determining a purpose of the storage device based on the file type distribution entropy value and the ratio of the file size of each file type to the total storage data size;
[0024] A performance requirement of the storage device is determined based on a usage of the storage device.
[0025] In some embodiments, the purpose of the storage device includes storing office files, storing video files or picture files, and storing model design files, and determining the performance requirements of the storage device based on the purpose of the storage device includes:
[0026] When the storage device is used to store office files, determining that the performance requirement of the storage device is that a 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 picture files, determining that the performance requirements of the storage device are that a maximum storage capacity is required and a write speed is required to be greater than a first preset speed;
[0028] When the storage device is used to store model design files, the performance requirements of the storage device are determined to be that the reading speed needs to be greater than the second preset speed and the writing speed needs to be greater than the third preset speed.
[0029] In some implementations, generating a recommended version of the firmware set based on the performance requirements of the storage device, the current device status, and the compatibility information and functional feature information of each version of the firmware includes:
[0030] Reading a firmware compatibility information matrix and a functional characteristic information matrix from a firmware library, wherein the firmware compatibility information matrix includes a compatibility score of each version of the firmware under multiple adaptation scenarios for each type of storage device, and the functional characteristic information matrix includes multiple functional characteristic parameters of each version of the firmware, wherein the functional characteristic parameters include values of a maximum write speed, a maximum read speed, a maximum storage capacity, and storage reliability of the storage device when the firmware is used;
[0031] Calculating a recommendation score for each version of the firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional characteristics information matrix;
[0032] A firmware set including all versions of firmware having a recommendation score higher than a second preset value is generated.
[0033] In some embodiments, the calculating the recommendation score of each version of firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional characteristics information matrix includes:
[0034] The performance requirements of the storage device, the current device status, and the firmware compatibility information matrix and the functional characteristic information matrix are input into a firmware recommendation calculation model to obtain a recommendation score for each version of the firmware.
[0035] In a second aspect, an embodiment of the present application provides an 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the firmware update method as described in the first aspect.
[0039] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the firmware update method as described in the first aspect.
[0040] The present application provides a firmware update method, an electronic device, and a storage medium. The present application updates the firmware of the storage device to a target version of the firmware when the device information of the storage device is obtained in a firmware update file system and a firmware version update command is received, and retains all storage data and serial numbers of the storage device. The firmware update operation can be automatically performed by simply receiving the firmware version update command, thereby reducing the difficulty of firmware update and allowing users to independently update the firmware locally. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flowchart of the first implementation of the firmware update method provided in an embodiment of the present application.
[0042] Figure 2 This is a flowchart of the second implementation method of the firmware update method provided in an embodiment of the present application.
[0043] Figure 3 It is a structural diagram of the firmware update device provided in an embodiment of the present application.
[0044] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application.
[0045] Figure 5 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0048] The present application provides a firmware update method, electronic device, and storage medium. 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 the storage data and serial number of the storage device are retained. The firmware update operation can be automatically performed by simply receiving the firmware version update command, which reduces the difficulty of firmware update and allows users to independently update the firmware locally. At the same time, all stored data can be retained so that users can continue to use the storage device. In addition, the serial number of the storage device can be retained so that the storage device can pass verification when the storage device is subsequently repaired.
[0049] The storage device referred to in this application may be a mechanical hard disk, an SSD, an optical storage device, or a memory card. The SSD may be a BGA SSD. A BGA SSD may include a Flash memory chip, which may include NOR Flash and NAND Flash. The following example uses a BGA SSD as an example, but this should not be considered a limitation of this application.
[0050] The firmware update method provided by this application will be described in detail below with reference to the accompanying drawings.
[0051] See also Figure 1 , Figure 1 This is a flow chart of the first implementation of the firmware update method provided in the embodiment of the present application. Figure 1 As shown, the firmware updating method includes: steps S100 to S300.
[0052] Step S100: Obtain a firmware update program.
[0053] In some embodiments, when a firmware update operation needs to be performed in a target system and the current operating system of the electronic device is not the target system, the firmware update program includes a target version of the system kernel and a firmware update toolkit. The target version of the system kernel is used to enter the target system. The firmware update toolkit includes multiple files for performing the firmware update operation in the target system.
[0054] Optionally, the firmware update kit is a folder.
[0055] In some implementations, when a firmware update operation needs to be performed in a target system and the current operating system of the electronic device is the target system, the firmware update program only includes a firmware update toolkit.
[0056] Optionally, the target system may be a Linux system. The Linux system is an open source operating system that is highly customizable and cross-platform. Therefore, a firmware update toolkit developed based on the Linux system can adapt to a variety of hardware platforms, thereby enabling the firmware update method of the present application to be applied to storage devices on a variety of hardware platforms.
[0057] Optionally, the current operating system of the electronic device may be a Windows system.
[0058] Optionally, the firmware update toolkit includes a card activation tool program and a target version of firmware. The card activation tool program is used to generate an executable file for burning the target version of firmware into a storage device based on the parameter configuration information. The card activation tool program can also be used to generate the target version of firmware based on the parameter configuration information.
[0059] Optionally, the firmware update toolkit further includes other files for performing firmware update operations.
[0060] Optionally, the Linux system kernel is a Kylin system kernel.
[0061] Step S200: Execute the firmware update program to enter the firmware update file system.
[0062] In some embodiments, the firmware update file system is a folder containing multiple files. Opening the firmware update folder in the firmware update toolkit of the firmware update program accesses the firmware update file system. In this case, the firmware update toolkit or the firmware update file system may not include the target version of the firmware. After subsequently obtaining device information of the storage device, the code file of the target version of the firmware can be determined based on the device information and stored in the firmware update file system.
[0063] In some embodiments, the firmware update toolkit includes a code file of the target version of the firmware. After the card activation tool program is used to generate an executable file for burning the target version of the firmware into the storage device, a firmware update file system can be generated and entered.
[0064] In some implementations, after a card activation tool is used to generate an executable file for burning a target version of firmware into a storage device and the target version of firmware is generated based on parameter configuration information, a firmware update file system may be generated and entered.
[0065] In some embodiments, step S200 includes steps S210 to S220.
[0066] Step S210: Acquire parameter configuration information.
[0067] The parameter configuration information includes storage space allocation information, security verification information, and at least one parameter of a storage mode of the storage device.
[0068] Optionally, the storage space allocation information is used to divide the storage space in the storage device. Exemplarily, the storage space allocation information is used to divide the storage space in the storage device into multiple sub-storage spaces and set the size of each sub-storage space.
[0069] Optionally, the storage space allocation information further includes a name for each sub-storage space.
[0070] Optionally, a sub-storage space is a cache space in the storage device, and the cache space may 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 executing the firmware update operation and which verification method to use for the security verification.
[0072] Optionally, the verification method includes a TCG (Trusted Computing Group) security verification method and a deep verification method. The deep verification includes verifying the firmware and the serial number.
[0073] Optionally, the storage mode includes a balanced write mode, a concentrated write mode, and a reliable storage mode, etc. The balanced write mode writes data evenly to each storage unit or storage area of the storage device to avoid excessive writing to certain specific areas, which may cause premature wear or performance degradation.
[0074] Centralized write mode writes data to a specific storage area on a storage device. When a storage device uses centralized write mode, frequently accessed data is stored in a specific storage area, allowing for quick location and access.
[0075] In reliable storage mode, the risk of information loss is reduced by writing data to storage units with a longer predicted lifespan, storing data backups, controlling read and write speeds to control operating temperatures, and providing fault warnings based on the device status of the storage device.
[0076] In some implementations, the parameter configuration information also includes test process information. Basic test information includes whether to perform bad block recovery and / or power management detection on the storage device before executing the card activation command.
[0077] In some embodiments, the parameter configuration information further includes timeout setting information, which includes a preset time threshold. The timeout setting information is used to determine that the card activation has failed and automatically terminate the execution of the card activation command when the execution time of the card activation command exceeds the preset time threshold.
[0078] In some implementations, the parameter configuration information also includes serial number management information of the storage device, etc.
[0079] Optionally, the serial number management information includes a starting serial number, an ending serial number, and a serial number mask rule. The serial number management information is used to determine the target serial number of each storage device when batch activation of storage devices is performed.
[0080] In some implementations, a user may set parameter configuration information according to usage requirements of the storage device.
[0081] Step S220: executing the firmware update program based on the parameter configuration information, generating and entering the firmware update file system.
[0082] In some embodiments, 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, multiple executable files are generated for burning the target version of the firmware into the storage device, and all executable files are stored in the target folder of the firmware update program, thereby generating a firmware update file system. The firmware update file system includes all files used to perform the firmware update operation.
[0083] In some embodiments, the card activation tool is further configured to generate a target version of firmware based on the parameter configuration information and store the target version of firmware in a firmware folder within the firmware updater. Specifically, the card activation tool includes pre-installed firmware code. The card activation tool can compile the pre-installed firmware code based on all parameters in the parameter configuration information and the pre-installed firmware code to generate an executable file for the target version of firmware. The pre-installed firmware code can be the code for a specific version of firmware, but the parameters therein can be ultimately determined based on the parameter configuration information.
[0084] Optionally, the target folder is located in the firmware update toolkit. After all executable files are stored in the target folder in the firmware update toolkit, all files in the firmware update toolkit constitute a firmware update file system.
[0085] Optionally, the firmware update file system may include multiple sub-folders, and each sub-folder may include multiple files or folders.
[0086] Optionally, the generated multiple executable files are further used to perform a security check on the storage device based on the parameter configuration information when executing the card activation operation, and to configure the parameters of the storage device.
[0087] In some implementations, after all parameters in the parameter configuration information are entered into a card activation tool, a card activation operation is executed within the tool to test the activation of a test storage device of the same model as the storage device. After receiving a message confirming successful activation of the test storage device, the tool then executes a file generation operation to generate multiple executable files for burning the target version of firmware into the storage device. This ensures that the generated executable files can be used to correctly perform the firmware burning operation.
[0088] In some implementations, the firmware update file system is stored on an external firmware update device.
[0089] Optionally, the firmware update device includes a USB flash drive and a mobile hard drive. 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 that matches the interface of the electronic device can be used.
[0090] In some embodiments, before step S200, the method further includes: setting the system startup sequence to prioritize starting from the firmware update device. Step S200 includes: starting from the firmware update device at startup and entering the firmware update file system stored in the firmware update device.
[0091] In some embodiments, the firmware update file system is stored in a firmware update device within the electronic device. For example, the firmware update file system is stored on a system hard disk within the electronic device. In this case, the firmware update file system can be accessed by booting from the system hard disk within the electronic device according to the default system boot sequence.
[0092] In some implementations, entering the firmware update file system includes steps (220.1) to (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 including multiple files. When the folder is opened, an initial interface of the firmware update file system is entered.
[0095] (220.2) In response to receiving the unlock command and obtaining the unlock password, unlock the firmware update operation permission.
[0096] Optionally, the command identifier and unlock password of the unlock command are preset. When the command identifier of the unlock command is received, the password is obtained and identified as the preset unlock password. When the password is identified as the preset unlock password, the firmware update operation permission is unlocked.
[0097] Exemplarily, the command identifier of the unlock command is “sudo su”.
[0098] Optionally, if the password is the preset unlock password, root permissions are unlocked. Root permissions are the highest level of permissions, granting complete control over the system. Unlocking root permissions also unlocks firmware update permissions.
[0099] (220.3) In response to receiving the file execution command, execute the target executable file in the firmware update file system according to the file execution command and enter the operation interface.
[0100] In some implementations, the target executable file is executed according to the file identifier of the target executable file carried in the file execution command to enter the operation interface.
[0101] Exemplarily, the file identifier carried by the file execution command is . / NVMe Tool ARCH64, and the file name of the target executable file is NVMe Tool ARCH64.
[0102] In some implementations, command identifiers of all executable commands and operation instructions for each executable command are displayed on the operation interface.
[0103] In some implementations, all executable commands include card activation commands and commands for additional functions.
[0104] In some embodiments, the card activation command includes a new card activation command, a set serial number activation command, and a retain serial number activation command. When executing the card activation command, all stored data and fault information in the storage device are cleared, the faulty storage unit of the storage device is shielded, and the storage device's firmware is updated to the target version. When executing the new card activation command, the storage device's serial number is also set to a preset serial number. When executing the set serial number activation command, the storage device's serial number is also set to the target serial number carried in the set serial number activation command. When executing the retain serial number activation command, the storage device's serial number remains unchanged.
[0105] In some embodiments, the commands in the additional functions include commands for viewing device information, viewing SMART (Self-Monitoring, Analysis and Reporting Technology) information, firmware version update commands, viewing the operating information of the storage device, obtaining the data of the index data block, transferring WPRO (Write-Protect Register or other related) data, transferring debugging information, transferring all data, and obtaining relevant information of the storage device. Among them, the operating information of the storage device includes the usage rate of the storage space, the delay time of the I / O operation, etc. The data of the index data block is used to determine the data management method adopted by the storage device. The command for obtaining relevant information of the storage device is used to execute the command for viewing SMART information, viewing the operating information of the storage device, obtaining the data of the index data block, transferring debugging information, and transferring WPRO data at one time.
[0106] In some implementations, when the firmware version update command is executed, the firmware of the storage device is updated to the target version of firmware, and the storage data 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 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 numbers of the storage device are retained.
[0108] In some implementations, the device information includes information such as the manufacturer, model, serial number, and current firmware version identifier of the storage device.
[0109] In some embodiments, the device information also includes operating information of the storage device. Optionally, the operating information includes information such as read and write speed, error rate, storage capacity, and used capacity.
[0110] When the device information of the storage device is obtained, it indicates that the electronic device can recognize the connection to the storage device and that there is no physical damage to the storage device that would affect its normal operation. In this case, a firmware update can be performed to enable the storage device to continue to operate normally. The situation where the device information of the storage device can be obtained is called disk recognition.
[0111] In some implementations, when the device information of the storage device is obtained in the firmware update file system, the device information of the storage device is displayed in the operation interface. For example, information such as the version identifier of the current firmware of the storage device is displayed in the operation interface.
[0112] In some implementations, when the firmware version update command is executed, the version identifier and serial number of the updated firmware version are displayed in the operation 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 Tool ARCH64-1ist initial.
[0115] For example, the command identifier corresponding to the command to set the serial number to activate the card is initial--sn= <newserialnumber>, New SerialNumber represents the target serial number. For example, the command line corresponding to setting the serial number to activate the card is . / NVMe Tool ARCH64 -1ist initial --sn=AXD12240001, where AXD12240001 is the target serial number.
[0116] In some implementations, the "Set Serial Number Card Activation" command may not include a serial number. Upon receiving the "Set Serial Number Card Activation" command, a target serial number is generated based on the current time, geographic location, and storage device model using a serial number generation algorithm specific to the storage device model. This target serial number is then stored in the blockchain. This target serial number can serve as maintenance evidence and, like the original serial number, can be verified by the manufacturer, facilitating subsequent repairs of the storage device.
[0117] In some embodiments, when activating storage devices in batches, a target serial number is generated for each storage device based on the serial number management information in the parameter configuration information, and a set serial number activation command is executed on each storage device based on the target serial number of each storage device.
[0118] For example, the command identifier corresponding to the command for keeping the serial number to activate the card is initial keepsn, and the command line corresponding to the command for keeping the serial number to activate the card is . / NVMe ToolARCH64-1istinitial keepsn.
[0119] In some implementations, when no command is received, device information of the storage device is obtained in 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 to view SMART information is "smart," and the command line corresponding to the command to view SMART information is ". / NVMe Tool ARCH64-1ist smart." In some embodiments, when the command to view SMART information is executed, fault information in the SMART information is identified, and based on the fault information, it is determined whether the storage device has entered a write-protected state. If the storage device has entered a write-protected state, the write-protection state of the storage device is released by opening the card, allowing data to be written to the storage device.
[0121] In some embodiments, the fault information is a fault code. When the fault code is 0x00, it indicates that the storage device is in a normal working state. When the fault code is 0x08, it indicates that the storage device has entered a write protection state.
[0122] In some embodiments, when it is determined based on the fault information that the storage device has entered a write-protected state, a card unlock command is automatically executed to unlock the write-protected state of the storage device. Optionally, the card unlock command can be a new card unlock command.
[0123] In some embodiments, when it is determined based on the fault information that the storage device is in normal working condition, and it is determined based on the current firmware version identifier in the device information that the current firmware version is not the target version, the firmware version update command is automatically executed to update the firmware of the storage device to the target version firmware and retain all stored data.
[0124] In some implementations, the target version of firmware is firmware generated in a firmware update program based on parameter configuration information, or may be firmware pre-stored in a firmware update file system.
[0125] In some implementations, the target version of firmware may be a firmware in a firmware library.
[0126] Optionally, a target version of firmware compatible with the storage device is determined based on the storage device model and firmware library in the device information. The target version of firmware may be the latest version of firmware compatible with the storage device. The firmware library pre-stores the version identifiers, release dates, and code files of all firmware compatible with each storage device model.
[0127] Optionally, the firmware library may be pre-stored in a firmware update file system.
[0128] Optionally, the firmware library can be stored in a server and updated in real time, and the firmware library in the server can be read online in the firmware update file system.
[0129] In some implementations, due to different usage characteristics of storage devices, the latest version of firmware may not necessarily 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 a target firmware version that best suits the storage device can be selected from the recommended firmware versions.
[0130] The usage characteristics of a storage device may include the purpose of the storage device. The storage data in the storage device may reflect the main purpose of the storage device. Storage devices for different purposes often have different performance requirements. For example, when the storage device is used to store video or image data, because the video or image files are large, a higher write speed and maximum storage capacity are required; and because the storage device is often used as a local backup disk in this case and does not require frequent read and write operations, it is not necessary to achieve a very high read speed. The firmware of the storage device can be used to set the storage mode and storage space allocation method used when the storage device is working, thereby changing the performance parameters of the storage device. Performance parameters may include storage capacity, write speed, read speed, etc. Therefore, a recommended version of the firmware set can be generated based on the storage data and device information of the storage device, and then the target version of the firmware can be determined based on the recommended version of the firmware set so that the performance parameters of the storage device meet the performance requirements.
[0131] See also Figure 2 , Figure 2 This is a flow chart of the second implementation of the firmware update method provided in the embodiment of the present application. Figure 2 As shown, in some embodiments, before updating the firmware of the storage device to the target version of firmware, the method further includes steps S400 to S500.
[0132] Step S400: Generate a recommended version of a firmware set based on storage data and device information of the storage device.
[0133] The firmware set includes at least one version of firmware.
[0134] In some embodiments, step S400 includes steps S410 to S440.
[0135] Step S410: Identify all file types in the stored data.
[0136] In some embodiments, the file types include video files, image files, document files, audio files, model design files, source code files, etc. Model design files include static 3D model files and animation model files, etc., which are used for design.
[0137] Step S420: Determine the performance requirement 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 embodiments, step S420 includes steps S421 to S423.
[0139] Step S421: Calculate the file type distribution entropy value according to the number of file types in the stored data and the number of files included in each file type.
[0140] In some implementations, the occurrence probability 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 occurrence probability of each file type and the number of file types.
[0141] In some implementations, the calculation formula for the file type distribution entropy value is:
[0142]
[0143] Among them, p i represents the probability of occurrence of the i-th file type, n i Indicates the number of files included in the i-th file type, N indicates the total number of files, h i It represents the entropy value of the file type distribution of stored data, and k represents the number of file types.
[0144] The file type distribution entropy value can be used to indicate the degree of dispersion of file types in the stored data. A larger file type distribution entropy value indicates that the number of files included in each file type is closer to being equal, and the files of each file type are more evenly 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 ratio of the file size of each file type to the total storage data size.
[0146] When the number of files of a certain file type is small, the file size may be large, and the proportion of the file size of this file type 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 and the proportion of each file type's file size to the total stored data size can more accurately determine the purpose of the storage device.
[0147] In some embodiments, 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 means that the number of files and the file size of a file type corresponding to the first preset ratio value are large. Therefore, it can be determined that the storage device is mainly used to store files of a file type corresponding to the first preset ratio value, and then 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 embodiments, the storage device may be used to store office files, video files or image files, and model design files, etc. Office files include document files, spreadsheet files, slide files, and source code files.
[0150] Optionally, the storage device may be used to store various files.
[0151] In some embodiments, when the largest ratio among all ratios is not greater than the first preset ratio value, it means that the proportion of the file size of a file type corresponding to the first preset ratio value 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 the second preset value, and the probability of occurrence of a file type corresponding to the first preset ratio value is the largest, it means that the discreteness of the file types in the stored data is large, and the number of files of a file type corresponding to the first preset ratio value is also large. Although the proportion of files of this file type is not very large, it can also be determined that the storage device is mainly used to store files of a file type corresponding to the first preset ratio value, and then the purpose of the storage device can be determined based on the file type. When the file type distribution entropy value is greater than the second preset value, or 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 ratio value is not the largest probability, it can be determined that the purpose of the storage device is to store various files.
[0152] Step S423: Determine the performance requirement of the storage device based on the usage of the storage device.
[0153] In some implementations, when the storage device is used to store office files, the performance requirement of the storage device is determined to be that a performance parameter of storage reliability needs to be greater than a first preset value.
[0154] When a storage device is used to store office documents, the information contained in the documents is very important, so the storage device needs to have high storage reliability to reduce the risk of information loss. This can be achieved by setting the storage mode of the storage device to reliable storage mode through the firmware.
[0155] In some implementations, when the storage device is used to store video files or picture files, the performance requirements of the storage device are determined to require 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 the maximum storage capacity within the limitations of its own hardware conditions. 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 embodiments, when the storage device is used to store model design files, the performance requirements of the storage device are determined as follows: 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.
[0158] When the storage device is used to store model design files, users need to frequently modify the model design files in the storage device, so the storage device needs to achieve higher reading speed and writing speed.
[0159] Optionally, since the model design files are often large, the performance requirements of the storage device may also include achieving maximum storage capacity under the premise of achieving a read speed greater than a second preset speed and a write speed greater than a third preset speed.
[0160] In some implementations, when the storage device is used to store various files, the performance requirement of the storage device is determined to be a balanced performance requirement.
[0161] Step S430: Determine the current device status of the storage device according to the device information.
[0162] The device information includes the data error rate, storage capacity, and used capacity of the storage device.
[0163] In some embodiments, when the data error rate of the storage device is greater than a preset error rate, the current device state of the storage device is determined to be a state with a large number of failed storage units. If the current device state of the storage device is a state with a large number of failed storage units, it indicates that the storage reliability of the storage device is already low, and the storage mode of the storage device can be subsequently changed through firmware to improve storage reliability.
[0164] In some embodiments, when the ratio of used capacity to storage capacity is greater than a second preset ratio, the current device state of the storage device is determined to be insufficient storage capacity. When the current device state of the storage device is insufficient storage capacity, the storage mode and storage space allocation method of the storage device can be subsequently changed through firmware to expand the available storage capacity of the storage device.
[0165] Optionally, the second preset ratio is 0.7, 0.8 or 0.85, etc.
[0166] In some embodiments, 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 or is about to become too low. Subsequently, the storage mode of the storage device can be changed through firmware to improve storage reliability.
[0167] In some embodiments, the above method steps for determining the current device state of a storage device may be performed in a cumulative manner, 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 ratio of used capacity to storage capacity is greater than a second preset ratio, the current device state of the storage device is determined to be a state in which a large number of failed storage units exist and storage capacity is insufficient.
[0168] Step S440: Generate a recommended version of firmware set based on the performance requirements of the storage device, the current device status, and the compatibility information and functional characteristics information of each version of firmware.
[0169] In some embodiments, step S440 includes steps S441 to S443.
[0170] Step S441: Read the firmware compatibility information matrix and the functional characteristics information matrix in the firmware library.
[0171] Among them, the firmware compatibility information matrix includes the compatibility scores of each version of the firmware in multiple adaptation situations for each model of storage device, and the functional characteristic information matrix includes multiple functional characteristic parameters of each version of the firmware. The functional characteristic parameters include the maximum write speed, maximum read speed, maximum storage capacity and storage reliability values of the storage device when using the firmware.
[0172] Optionally, a row number of the firmware compatibility information matrix corresponds to a version of firmware, a column number corresponds to a model of storage device, and an element in the firmware compatibility information matrix is a compatibility score of a version of firmware when adapted to a corresponding model of storage device.
[0173] Optionally, a row number of the functional characteristic information matrix corresponds to a version of firmware, a column number corresponds to a functional characteristic parameter, and an element in the functional characteristic information matrix is a value of a functional characteristic parameter corresponding to a version of firmware.
[0174] In some implementations, a historical update record matrix in the firmware library is also read, wherein the historical update record matrix includes the historical update success rate of each storage device model when updating each version of firmware.
[0175] Optionally, a row number of the historical update record matrix corresponds to a version of firmware, a column number corresponds to a model of a storage device, and an element in the functional characteristic information matrix is the historical update success rate of a model of storage device when updating a corresponding version of firmware.
[0176] Step S442: Calculate the recommendation score of each version of firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional characteristics information matrix.
[0177] In some implementations, the performance requirements of the storage device, the current device status, and the firmware compatibility information matrix and the functional characteristics information matrix are input into a firmware recommendation calculation model to obtain a recommendation score for each version of the firmware.
[0178] Optionally, the firmware recommendation degree calculation model may include a preset firmware recommendation degree calculation formula, or may be a trained artificial intelligence model.
[0179] Optionally, the artificial intelligence model may include models such as a neural network model, a model based on a Transformer architecture, and a generative adversarial network model.
[0180] In the case where the firmware recommendation degree calculation model is an artificial intelligence model, the firmware recommendation degree calculation model can be continuously trained with new training data to update the parameters therein.
[0181] In some embodiments, step S442 includes steps (442.1) to (442.4).
[0182] (442.1) Generate a first performance requirement matrix based on the performance requirements of the storage device.
[0183] In some embodiments, the performance requirement parameters in the first performance requirement matrix include minimum values for write speed, read speed, storage capacity, and storage reliability. If the minimum value for a particular performance parameter is not determined based on the purpose of the storage device, the minimum value for that performance parameter is set as the corresponding default value.
[0184] Optionally, a column of the first performance requirement matrix corresponds to a minimum value of a performance parameter.
[0185] Exemplarily, when the storage device is used to store office files, in the first performance requirement matrix of the storage device, the lowest value of storage reliability is determined to be the first preset value, and the lowest 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 state may include multiple states. In some embodiments, a row of the device state matrix represents the current device state of the storage device, and each column represents a separate state. Separate states may include a state with a large number of failed storage units, a state with insufficient storage capacity, or a high-temperature operating state.
[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 the column, and when the value of the element in the column is a second value, it indicates that the current device state does not include the state corresponding to the column, wherein the first value and the second value are different.
[0189] Exemplarily, 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 status matrix.
[0191] In some implementations, performance requirement parameters in the first performance requirement matrix are modified based on the device state matrix to obtain a second performance requirement matrix.
[0192] Specifically, the corresponding performance requirement parameters in the first performance requirement matrix are modified according to each individual state included in the current device state in the device state matrix. For example, when it is determined according to the device state matrix that the current device state includes a state with a large number of faulty storage units or a high-temperature working state, the minimum value of the storage reliability in the first performance requirement matrix is modified to the first preset value. When it is determined according to the device state matrix that the current device state includes a state with a large number of faulty storage units, the minimum value of the 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 the 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, the firmware compatibility information matrix, and the functional characteristic information matrix into the firmware recommendation calculation model to obtain a recommendation score matrix for each version of the firmware.
[0194] As described above, the functional characteristic information matrix includes multiple functional characteristic parameters for each firmware version. The functional characteristic parameters include the maximum write speed, maximum read speed, maximum storage capacity, and storage reliability of the storage device when the firmware is used. In some embodiments, the functional characteristic information matrix is an A×B matrix, where A represents the number of all firmware versions and B represents the number of functional characteristic 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 embodiments, 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 embodiments, when the firmware recommendation degree calculation model includes a preset firmware recommendation degree calculation formula, step (442.4) includes steps (442.4.1) to step (442.4.4).
[0197] (442.4.1) For each row vector in the functional characteristic information matrix, when there is at least one functional characteristic parameter in the row vector whose value is lower than the minimum value of the same performance parameter in the second performance requirement matrix, the row vector is deleted to obtain an 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 including performance requirement parameters whose values are corresponding default values, and the second parameter set including performance requirement parameters whose values are not corresponding default values.
[0201] In some embodiments, the calculation formula for calculating the weight of the performance requirement parameter 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 embodiments, the calculation formula for calculating the weight of the performance requirement parameter 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 first preset weight is 0.3.
[0204] In some implementations, the calculation formula for the weight of the performance requirement parameter may also be: weight of the performance requirement parameter = weight corresponding to the parameter set to which the performance requirement parameter belongs × weight corresponding to the performance requirement parameter itself.
[0205] (442.4.3) Based on the model in the device information, a first target column vector corresponding to the model in the firmware compatibility information matrix is selected.
[0206] The first target column vector includes a compatibility score of each version of the firmware when adapted to the storage device of this model.
[0207] Optionally, the target column vector is an A×1 column vector.
[0208] (442.4.4) Left-cross multiply the updated functional characteristic information matrix by the performance weight matrix, and then dot-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 parameter values are no less than the lowest values of the same performance parameters in the second performance requirement matrix. D represents the number of firmware versions whose functional characteristic parameter values are no less than the lowest values of the same performance parameters in the second performance requirement matrix.
[0210] In some embodiments, operational behavior information from the storage device can also be read, and a recommendation score for each version of firmware can be calculated based on the storage device's performance requirements, current device status, operational behavior information, a firmware compatibility information matrix, and a functional feature information matrix. Optionally, the operational behavior information can be a record of data read and write behaviors performed by the storage device within a second preset time period closest to the current time. For example, the operational behavior information can include record information for writing 5GB of data and record information for reading 3GB of data.
[0211] Optionally, the second preset time period may 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 embodiments, 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-cross-multiplying it by the performance weight matrix, and then multiplying it by the first target column vector to obtain a first recommendation rating matrix.
[0213] In some embodiments, determining a user behavior factor matrix based on operational behavior information includes: calculating the time decay coefficient of each read data behavior and each write data behavior and the data size ratio of the corresponding operation based on the operational behavior information; multiplying the time decay coefficient of each read data behavior by the data size ratio of the corresponding operation and then adding all of them together to obtain an initial behavior factor of the read data behavior; multiplying the time decay coefficient of each write data behavior by the data size ratio of the corresponding operation and then adding all of them together to obtain an initial behavior factor of the write data behavior; performing a nonlinear transformation on each initial behavior factor to obtain a final behavior factor, and determining the user behavior factor matrix based on all 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 dot-multiplied with the functional characteristic information matrix. In the user behavior factor matrix, the final behavior factor of the data writing behavior corresponds to the position of the maximum write speed value in the functional characteristic information matrix, and the final behavior factor of the data reading behavior corresponds to the position of the maximum read speed value in the functional characteristic information matrix. The behavior factor that does not correspond to a functional characteristic parameter in the functional characteristic information matrix is 1.
[0215] Exemplarily, when a 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 [behavior factor of writing data behavior, behavior factor of reading data behavior, 1, 1].
[0216] In some embodiments, the calculation formula for the time attenuation coefficient of the data reading behavior or the data writing behavior is: n =e -λΔt , where r n Represents the nth user action, which is either a read or write action. e represents the base of the natural logarithm, and λ represents the preset calculation parameter, which is a positive number. Δt represents the time difference between the time the nth user action occurred and the current time, which is a positive number.
[0217] The later a user action occurs, the more it represents the user's recent operational preferences. By using this approach, the later a user action occurs, the smaller the time decay coefficient is. This can increase the behavior factor for that user action, making the calculation more likely to reflect the user's recent operational preferences.
[0218] In some implementations, the data size of the operation corresponding to the user behavior is divided by the sum of the data sizes of all written data and read data in the operation behavior information to obtain the proportion of the data size of the operation corresponding to the user behavior.
[0219] In some embodiments, a hyperbolic tangent function may be used to perform nonlinear transformation calculation on each initial behavior factor, and the calculation formula is: n =tanh(u n ), where U n represents the final behavior factor of the nth user behavior, tanh() represents the hyperbolic tangent function, u n Represents the initial behavior factor for the nth user behavior. 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 in the behavior factor when the initial behavior factor is small, making the behavior factor more clearly reflect the user's action preference. Furthermore, the hyperbolic tangent function has a range of [-1, 1], which can constrain the final behavior factor to a single value range for subsequent calculations.
[0220] In some implementations, a Sigmoid function or a ReLU function may 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 numerical range to obtain a second recommendation score matrix.
[0222] Optionally, the preset numerical range is 1 to 100. The difference obtained by subtracting the smallest recommendation score from each recommendation score in the first recommendation score matrix is divided by the difference obtained by subtracting the smallest recommendation score from the largest recommendation score, and the resulting value is multiplied by 100 to obtain a normalized recommendation score, thereby obtaining a 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 a third recommendation score matrix based on the historical update record matrix and the second recommendation score matrix.
[0225] In some embodiments, based on the model number in the device information, a second target column vector corresponding to the model number in the historical update record matrix is selected, 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 each firmware version for the storage device of that model number.
[0226] In some embodiments, when the firmware recommendation calculation model is a trained artificial intelligence model, step (442.4) includes steps (442.4.7) to step (442.4.8).
[0227] (442.4.7) The second performance requirement matrix, the firmware compatibility information matrix, and the functional characteristic information matrix are concatenated to obtain an input tensor.
[0228] In some implementations, the second performance requirement matrix, the firmware compatibility information matrix, the functional characteristic information matrix, and the historical update record matrix may be concatenated to obtain an input tensor.
[0229] (442.4.8) The input tensor is input 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 embodiments, operation behavior information is also input into the input layer, and feature extraction of the operation behavior information is performed in the firmware recommendation calculation model to obtain user operation preference information, and then a 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 including all versions of firmware having a recommendation score higher than a second preset value.
[0232] Optionally, the second preset value is 80, 85 or 90, etc.
[0233] In some implementations, a firmware set including a first preset number of firmware versions with the highest recommendation scores may also be generated.
[0234] Optionally, the first preset number 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 embodiments, the version identifier of each firmware in the firmware set is displayed in the operation interface. Optionally, the version identifier, performance parameters and recommendation score of each version of the firmware in the firmware set are also displayed in the operation interface for user selection.
[0237] Step S500: In response to receiving a selection command, determining a target version of firmware according to the selection command.
[0238] The target version of the firmware is a version of the firmware in the firmware set.
[0239] In some implementations, when no selection command is received within a first preset time period, a firmware version with the highest recommendation score in the firmware set is determined as the target firmware version.
[0240] In some implementations, a code file of the target version of the firmware is obtained from a firmware library according to a storage address of the target version of the firmware.
[0241] It is understandable that because the firmware recommendation score is calculated based not simply on performance requirements but on the storage device's performance requirements, current device status, firmware compatibility matrix, and feature matrix, after the storage device's firmware is updated to the target version, the storage device's performance parameters may not strictly meet the performance requirements. However, the target version of firmware is determined based on multiple factors, which is a more appropriate approach compared to determining the target version based solely on performance requirements.
[0242] In some implementations, when the storage device is used to store various files, the storage mode of the storage device is set to a balanced write mode through a target version of firmware.
[0243] In some implementations, when a storage device is used to store office documents, the target version of the firmware sets the storage device's storage mode to reliable storage mode. In reliable storage mode, the risk of information loss is reduced by, for example, writing data to storage units with a predicted long lifespan, storing data backups, controlling operating temperature, and providing fault warnings based on the storage 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 duplicate in at least two storage spaces. When it is detected that the proportion of faulty storage units in the storage device is greater than a fourth preset ratio, the device enters a write-protect state and issues a fault warning, so that the user can transfer data as quickly as possible.
[0245] In some embodiments, when a storage device is used to store model design files, the target version of the firmware sets the storage device's storage mode to centralized write mode. When the storage device uses centralized write mode, frequently accessed data can be centrally stored in a specific storage area, allowing for quick data location and access. Because model design files need to be frequently read and modified, this approach can improve the storage device's read and write speed, making the storage device more suitable for storing model design files.
[0246] Optionally, in the centralized write mode, the storage space of the storage device is divided into multiple sub-storage spaces, and one of the sub-storage spaces is determined as a cache space. When the storage device writes data, the data is first written to the cache space, and the data in the cache space is written to other sub-storage spaces when idle.
[0247] Alternatively, the cache space may be an emulated SLC storage space. SLC is a type of storage unit that writes data faster. In the emulated SLC storage space, the storage unit is simulated as an SLC storage unit for writing, which can greatly improve the write speed.
[0248] In some embodiments, in centralized write mode, the size of the cache space can be dynamically adjusted in stages. When the amount of read and write data exceeds a first preset data amount, the size of the cache space is determined to be a first size. When the amount of read and write data is not greater than the first preset data amount but greater than a second preset data amount, the size of the cache space is determined to be a second size, and so on.
[0249] Optionally, the first size may be larger than a first preset data volume, and the second size may be larger than a second preset data volume. For example, the first preset data volume is 100 GB, the second preset data volume is 50 GB, the first size is 105 GB, and the second size is 51 GB.
[0250] In some embodiments, a hierarchical writing method is used in the centralized writing 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 written to the second sub-storage space. When the second sub-storage space is full, the data is written to the third sub-storage space, and so on.
[0251] In some embodiments, in centralized write mode, the storage device's storage space 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. At this point, the new data is written to the next sub-storage space in the order in which it was activated. Because data is always written to the same sub-storage space, this approach reduces the time required to find the write address, thereby increasing 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, eliminating the need for complex data migration operations.
[0252] In some implementations, when a storage device is used for video or image files, the target version of the firmware can be used to set the storage device's storage mode to centralized write mode. This is because when a storage device is used for video or image files, it may be used in applications where sequential writes are the primary focus, such as log storage and video surveillance. In these applications, centralized write mode enables more efficient data retrieval and management compared to balanced write mode.
[0253] In some embodiments, when the storage device is used for video or image files, the target version of the firmware sets the storage device's storage mode to a data compression-before-storage mode, disables reserved storage space, and uses the target file system to store the data. Optionally, the target file system can be NTFS or exFAT. NTFS or exFAT file systems can support storage of larger files and achieve higher storage efficiency than the standard FAT32 file system.
[0254] Optionally, when the storage device is used for video or image files, the target version of the firmware can be used to configure the storage device's storage space allocation as a sub-storage space. Because each sub-storage space has some space for storing file system metadata, this approach can avoid excessive sub-storage space allocation and increase the available storage capacity of the storage device.
[0255] In some implementations, when the storage device is used to store various files, the storage mode of the storage device is set to a balanced write mode through a target version of firmware.
[0256] In summary, the firmware update method provided by the embodiment of the present application has the following advantages:
[0257] 1. By obtaining the storage device's device information from the firmware update file system and receiving a firmware update command, the storage device's firmware is updated to the target version while retaining all stored data and serial number. This allows the firmware update to be automatically executed simply by receiving the firmware update command, simplifying the firmware update process and enabling users to independently update the firmware locally. All stored data is also retained, allowing users to continue using the storage device. Furthermore, the storage device's serial number is retained, ensuring that the device can be verified during subsequent repairs.
[0258] 2. By calculating the recommendation score of each version of firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix and the functional characteristics information matrix, the most suitable firmware for the storage device can be determined based on the usage characteristics of the storage device and the performance of the current device status, making the storage device more suitable for specific application scenarios.
[0259] 3. When the storage device is used to store model design files, by setting the storage mode of the storage device to centralized write mode through the target version of the firmware, 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. In centralized write mode, the storage device's storage space 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. At this point, the new data is written to the next sub-storage space in the order in which it is activated. This reduces the time spent searching for write addresses, thereby improving write speeds. Centralized write mode also facilitates fault recovery. When a sub-storage space is about to fail, the next sub-storage space can be directly activated, eliminating the need for complex data migration operations.
[0261] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the firmware update device provided in the embodiment of the present application. Figure 3 As shown, the firmware updating apparatus 300 includes an acquisition module 310 and an execution module 320 .
[0262] In some implementations, the acquisition module 310 is configured to acquire a firmware update program.
[0263] In some embodiments, the execution module 320 is used to 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, the firmware of the storage device is updated to the target version of the firmware, and all storage data and serial numbers of the storage device are retained.
[0264] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Figure 4 A processor 410 is taken as an example.
[0265] In some embodiments, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 4 The bus connection is taken as an example.
[0266] In some embodiments, the processor 410 is used to obtain a firmware update program; execute the firmware update program to enter a firmware update file system; when 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 numbers of the storage device are retained.
[0267] In some embodiments, memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as the program instructions / modules of the firmware update method in the embodiments of the present application. Processor 410 executes the non-volatile software programs, instructions, and modules stored in memory 420 to execute various functional applications and data processing of electronic device 400, thereby implementing the firmware update method of the above method embodiment.
[0268] In some embodiments, the memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device 400, etc. In addition, the memory 420 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely located relative to the processor 410, and these remote memories may be connected to the controller via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0269] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, perform the firmware update method in any of the above method embodiments, for example, perform the above described Figure 1 Method steps S100 to S300 in.
[0270] Please refer to Figure 5 , Figure 5 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 embodiment.
[0271] The computer-readable storage medium 500 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, 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 executes any method steps in the above-described firmware update method. These program codes can be read from or written to one or more computer program products. The program code can be compressed, for example, in an appropriate form.
[0272] In some embodiments, the computer-readable storage medium 500 may be a removable computer-readable storage medium. For example, the computer-readable storage medium 500 may be a USB flash drive or a mobile hard disk.
[0273] In some implementations, the embodiments of the present application further provide a computer program product, including a computer program, which implements the above-mentioned firmware update method when executed by a processor.
[0274] In summary, the present 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 a 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 the storage data and serial number of the storage device are retained. The present application automatically performs the firmware update operation upon receiving a firmware version update command, thereby reducing the difficulty of performing firmware updates and allowing users to independently update the firmware locally. At the same time, all stored data can be retained so that users can continue to use the storage device. In addition, the serial number of the storage device can be retained so that the storage device can pass verification when the storage device is subsequently repaired.
[0275] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.< / newserialnumber>
Claims
1. A firmware update method, characterized in that: include: Get firmware updates; Executing 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, the firmware of the storage device is updated to the target version of firmware, and all storage data and serial numbers of the storage device are retained.
2. The firmware update method according to claim 1, wherein: The executing the firmware update program to enter the firmware update file system includes: Acquire parameter configuration information, where the parameter configuration information includes storage space allocation information, security verification information, and at least one parameter of a storage mode of the storage device; The firmware update program is executed based on the parameter configuration information, and the firmware update file system is generated and entered.
3. The firmware update method according to claim 1, wherein: The method further comprises: generating a recommended version of a firmware set according to storage data and device information of the storage device, the firmware set including at least one version of firmware; In response to receiving a selection command, a target version of firmware is determined according to the selection command, where the target version of firmware is a version of firmware in the firmware set.
4. The firmware update method according to claim 3, wherein: Generating a recommended version of the firmware set according to the storage data and device information of the storage device includes: Identify all file types in the stored data; determining a performance requirement 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; determining a current device status of the storage device according to the device information, wherein the device information includes a data error rate, storage capacity, and used capacity of the storage device; A recommended version of the firmware set is generated based on the performance requirements of the storage device, the current device status, and the compatibility information and functional characteristic information of each version of the firmware.
5. The firmware update method according to claim 4, wherein: The determining the performance requirement 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: Calculating a file type distribution entropy value according to the number of file types in the stored data and the number of files included in each file type; Determining a purpose of the storage device based on the file type distribution entropy value and the ratio of the file size of each file type to the total storage data size; A performance requirement of the storage device is determined based on a usage of the storage device.
6. The firmware update method according to claim 5, wherein: The purpose of the storage device includes storing office files, storing video files or picture files, and storing model design files. The determining of the performance requirements of the storage device based on the purpose of the storage device includes: When the storage device is used to store office files, determining that the performance requirement of the storage device is that a performance parameter of storage reliability needs to be greater than a first preset value; When the storage device is used to store video files or picture files, determining that the performance requirements of the storage device are that a maximum storage capacity is required and a write speed is required to be greater than a first preset speed; When the storage device is used to store model design files, the performance requirements of the storage device are determined to be that the reading speed needs to be greater than the second preset speed and the writing speed needs to be greater than the third preset speed.
7. The firmware update method according to claim 4, wherein: Generating a recommended version of the firmware set based on the performance requirements of the storage device, the current device status, and the compatibility information and functional feature information of each version of the firmware includes: Reading a firmware compatibility information matrix and a functional characteristic information matrix from a firmware library, wherein the firmware compatibility information matrix includes a compatibility score of each version of the firmware under multiple adaptation scenarios for each type of storage device, and the functional characteristic information matrix includes multiple functional characteristic parameters of each version of the firmware, wherein the functional characteristic parameters include values of a maximum write speed, a maximum read speed, a maximum storage capacity, and storage reliability of the storage device when the firmware is used; Calculating a recommendation score for each version of the firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional characteristics information matrix; A firmware set including all versions of firmware having a recommendation score higher than a second preset value is generated.
8. The firmware update method according to claim 7, wherein: The calculating the recommendation score of each version of the firmware based on the performance requirements of the storage device, the current device status, the firmware compatibility information matrix, and the functional characteristics information matrix includes: The performance requirements of the storage device, the current device status, and the firmware compatibility information matrix and the functional characteristic information matrix are input into a firmware recommendation calculation model to obtain a recommendation score for each version of the firmware.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the firmware update method according to any one of claims 1 to 8.
10. 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 a processor to implement the firmware updating method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for updating firmware, chip and communication terminal
CN102830984A
Program information pushing method and apparatus
CN106469066A
Multi-firmware upgrading method and device
CN110119280A
Method for upgrading signature firmware, electronic equipment and storage medium
CN115640582A
Heterogeneous cross-domain controller upgrading method and device, equipment and medium
CN117075922A