Read-only mode releasing method of storage device, electronic device and storage medium
By judging the service life of the BGA SSD and identifying the faulty storage unit, the read-only mode of the user is solved, and the normal use of the storage device is achieved.
Patent Information
- Application Number
- CN202510539976.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-05
AI Technical Summary
In the prior art, after BGA SSD enters read-only mode, users need to return to the factory for repair. The operation is cumbersome and dependent on professionals, so they cannot automatically release the read-only mode.
By obtaining the storage device information, we judge whether the service life has been reached, identify the faulty storage unit, block the real faulty storage unit and read the data to the normal unit, delete the non-real fault identifier, and send a command to release the read-only mode.
Users can independently uninstall the BGA SSD's read-only mode locally, and the storage device continues to be used normally, avoiding the trouble of returning to the factory for repair.
Smart Images

Figure CN120429152A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a method for releasing a read-only mode of a storage device, an electronic device, and a 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, reaches the end of its lifespan, or experiences an unexpected power outage, it enters read-only mode. In read-only mode, data cannot be written to the SSD.
[0003] A BGA (Ball Grid Array) SSD is a solid-state drive that uses ball grid array packaging technology. The flash memory and controller are typically packaged together, making repairs expensive if a BGA SSD fails. Currently, if a BGA SSD enters read-only mode, removing it from read-only mode often requires returning it to the factory for repair.
[0004] However, the factory repair method for BGA SSDs requires users to send the BGA SSD back to the original manufacturer themselves, and it is highly dependent on professional personnel to operate, making the entire process very troublesome. Summary of the Invention
[0005] In response to the deficiencies in the prior art, the present application provides a method for releasing the read-only mode of a storage device, an electronic device, and a storage medium. When it is determined based on device information that the storage device has entered the read-only mode, the method determines whether the storage device has reached the end of its service life. When it is determined that the storage device has not reached the end of its service life, the method identifies whether each faulty storage unit in the storage device is a real faulty storage unit. When all faulty storage units are identified, a command to release the read-only mode is sent to the storage device to cause the storage device to exit the read-only mode, so that the user can locally release the read-only mode of the storage device independently, so that the storage device can continue to be used normally.
[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 method for releasing a storage device from read-only mode, comprising:
[0008] When a storage device connection is detected, device information of the storage device is obtained;
[0009] When it is determined according to the device information that the storage device has entered the read-only mode, determining whether the storage device has reached the end of its service life;
[0010] When it is determined that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit;
[0011] When the faulty storage unit is a real faulty storage unit, shielding the faulty storage unit and reading the data in the faulty storage unit to a normal storage unit;
[0012] When the fault storage unit is not a real fault storage unit, deleting the fault identifier corresponding to the fault storage unit;
[0013] When all the faulty storage units are identified, a command for releasing the read-only mode is sent to the storage device, so that the storage device exits the read-only mode.
[0014] In some embodiments, when determining, based on the device information, that the storage device has entered the read-only mode, determining whether the storage device has reached the end of its service life includes:
[0015] When it is determined according to the device information that the storage device has entered the read-only mode, obtaining self-monitoring information of the storage device;
[0016] calculating a remaining life percentage of the storage device based on the self-monitoring information;
[0017] When the remaining life percentage is less than a first preset percentage, it is determined that the storage device has reached the end of its service life; otherwise, it is determined that the storage device has not reached its service life.
[0018] In some embodiments, calculating the remaining life percentage of the storage device based on the self-monitoring information includes:
[0019] The remaining life percentage of the storage device is obtained by subtracting the accumulated written data amount from the total written data amount limit in the self-monitoring information and dividing the difference by the total written data amount.
[0020] In some embodiments, when determining that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit includes:
[0021] When it is determined that the storage device has not reached the end of its service life, obtaining a bad block address mapping table of the storage device;
[0022] For each of the faulty storage units, performing multiple read operations on the faulty storage unit based on the bad block address mapping table, and determining that the faulty storage unit is a real faulty storage unit when multiple data obtained by the multiple read operations are inconsistent;
[0023] Reading the number of erasures and the number of writes of each of the faulty storage units, and determining that the faulty storage unit is a real faulty storage unit when the number of erasures or the number of writes is greater than a preset number;
[0024] When it is determined based on the bad block address mapping table that the faulty storage unit is a faulty storage unit pre-marked at the factory, the faulty storage unit is judged to be a real faulty storage unit; otherwise, the faulty storage unit is judged not to be a real faulty storage unit.
[0025] In some embodiments, the method further comprises:
[0026] When it is determined that the storage device has not reached the end of its service life, determining the data storage mode of the storage device as a target data storage mode according to a device status of the storage device or a data storage mode designation command, wherein the target data storage mode is an encrypted storage mode, a load balancing storage mode, or a centralized storage mode; and / or
[0027] The logging mode of the storage device is determined as a target logging mode according to a logging mode designation command, where the target logging mode is a full logging mode or a secret logging mode.
[0028] In some embodiments, the device status of the storage device includes a remaining lifespan percentage of the storage device, and when it is determined that the storage device has not reached the end of its lifespan, determining the data storage mode of the storage device as the target data storage mode according to the device status of the storage device or the data storage mode designation command includes:
[0029] When it is determined that the storage device has not reached its service life and the remaining life percentage is greater than a second preset percentage, determining the data storage mode of the storage device to be the centralized storage mode;
[0030] When it is determined that the storage device has not reached its service life and the remaining life percentage is not greater than a second preset percentage, determining the data storage mode of the storage device to be the load balancing storage mode;
[0031] When it is determined that the data stored in the storage device is of an important data type, the data storage mode of the storage device is determined to be the encrypted storage mode.
[0032] In some embodiments, the complete recording mode is a log recording mode that records the data address and operation time of each read operation and write operation;
[0033] The secret recording mode is a log recording mode that does not record the data address and operation time of the read operation and the write operation, or encrypts the recorded data address and operation time.
[0034] 8. The method for releasing the read-only mode of a storage device according to claim 1, further comprising:
[0035] Identifying a data type of the stored data in the storage device;
[0036] When it is determined that the data type of the stored data is an important data type, the operation mode of the storage device is determined to be a write-only mode.
[0037] In a second aspect, an embodiment of the present application provides an electronic device, comprising:
[0038] at least one processor; and,
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] 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 execute the method for releasing the read-only mode of the storage device as described in the first aspect.
[0041] 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 method for releasing the read-only mode of the storage device as described in the first aspect.
[0042] The present application provides a method for releasing a storage device from read-only mode, an electronic device, and a storage medium. The present application determines whether the storage device has reached the end of its service life when it is determined based on device information that the storage device has entered read-only mode. When it is determined that the storage device has not reached the end of its service life, the application identifies whether each faulty storage unit in the storage device is a real faulty storage unit. When all faulty storage units have been identified, a command to release the read-only mode is sent to the storage device to cause the storage device to exit the read-only mode, so that the user can locally release the read-only mode of the storage device independently and enable the storage device to continue to be used normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flowchart of a method for releasing a storage device from read-only mode according to an embodiment of the present application.
[0044] Figure 2 yes Figure 1 Detailed flowchart of step S200.
[0045] Figure 3 yes Figure 1 Detailed flowchart of step S300.
[0046] Figure 4 2 is a schematic diagram of the structure of the device for releasing the read-only mode of the storage device provided in an embodiment of the present application.
[0047] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application.
[0048] Figure 6 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] 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.
[0050] 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.
[0051] The present application provides a method for releasing a storage device from read-only mode, an electronic device, and a storage medium. The method comprises the following steps: when it is determined based on device information that the storage device has entered read-only mode, determining whether the storage device has reached the end of its service life; and when it is determined that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit; and when all faulty storage units have been identified, sending a command to release the read-only mode to the storage device, so that the storage device exits the read-only mode. This allows a user to locally release the read-only mode of the storage device independently, so that the storage device can continue to be used normally.
[0052] 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.
[0053] The following will describe in detail the method for releasing the read-only mode of the storage device provided by the present application with reference to the accompanying drawings.
[0054] See also Figure 1 , Figure 11 is a flow chart of a method for releasing a storage device from read-only mode according to an embodiment of the present application. Figure 1 As shown, the method for releasing the read-only mode of the storage device includes: steps S100 to S600.
[0055] Step S100: When it is detected that a storage device is connected, device information of the storage device is obtained.
[0056] In some implementations, the device information includes fault information.
[0057] In some implementations, the device information also includes information such as the manufacturer information, model, serial number, and current firmware version identifier of the storage device.
[0058] 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.
[0059] In some implementations, step S100 includes: obtaining a mode update program, executing the mode update program to enter a mode update system, and obtaining device information of the storage device in the mode update system.
[0060] In some embodiments, when a mode update operation needs to be performed in a target system and the electronic device's current operating system is not the target system, the mode update program includes a target version of the system kernel and a mode update toolkit. The target version of the system kernel is used to access the target system. The mode update toolkit includes multiple files for performing the mode update operation in the target system. In read-only mode, the mode update operation also serves as a card activation operation.
[0061] Optionally, the schema update kit is a folder.
[0062] In some implementations, when a mode update operation needs to be performed in a target system and the current operating system of the electronic device is the target system, the mode update program only includes a mode update toolkit.
[0063] 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, the pattern update toolkit developed based on the Linux system can adapt to a variety of hardware platforms, thereby enabling the pattern update method of the present application to be applied to storage devices on a variety of hardware platforms.
[0064] Optionally, the current operating system of the electronic device may be a Windows system.
[0065] Optionally, the mode 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.
[0066] 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 mode update program, thereby generating a mode update file system. The mode update file system includes all files used to perform the mode update operation.
[0067] 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 mode 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.
[0068] Optionally, the target folder is located in the schema update toolkit. After all executable files are stored in the target folder in the schema update toolkit, all files in the schema update toolkit constitute the schema update file system.
[0069] Optionally, the schema update toolkit also includes other files for performing schema update operations.
[0070] Optionally, the Linux system kernel is a Kylin system kernel.
[0071] In some implementations, the schema update file system is a folder including multiple files. Opening the schema update folder in the schema update toolkit of the schema update program enters the schema update file system.
[0072] In some implementations, the schema update file system is stored on an external schema update device.
[0073] Optionally, the mode 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 the external mode update device. When the electronic device includes other types of interfaces, a mode update device that matches the interface of the electronic device can be used.
[0074] In some embodiments, before step S100, the method further includes: setting the system startup sequence to prioritize starting from the mode update device. Step S100 includes: starting from the mode update device at startup and entering the mode update file system stored in the mode update device.
[0075] In some embodiments, the mode update file system is stored in a mode update device within the electronic device. For example, the mode update file system is stored on a system hard disk within the electronic device. In this case, the system hard disk within the electronic device can be booted according to the default system boot sequence to access the mode update file system.
[0076] In some implementations, entering a mode to update a file system includes steps (100.1) to (100.3).
[0077] (100.1) Enter the initial interface of the mode to update the file system.
[0078] In some implementations, the mode update file system is a folder including multiple files. When the folder is opened, an initial interface of the mode update file system is entered.
[0079] (100.2) In response to receiving the unlock command and obtaining the unlock password, the unlock mode updates the operation authority.
[0080] 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 it is identified whether the password is the preset unlock password. When the password is identified as the preset unlock password, the unlock mode update operation authority.
[0081] Exemplarily, the command identifier of the unlock command is “sudo su”.
[0082] 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. After root permissions are unlocked, mode update permissions are also unlocked.
[0083] (100.3) In response to receiving the file execution command, the target executable file in the file system is updated according to the execution mode of the file execution command, and the operation interface is entered.
[0084] 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.
[0085] 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.
[0086] In some implementations, command identifiers of all executable commands and operation instructions for each executable command are displayed on the operation interface.
[0087] In some implementations, all executable commands include card activation commands and commands for additional functions.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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-1istinitial.
[0093] 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 ToolARCH64-1istinitial--sn=AXD12240001, where AXD12240001 is the target serial number.
[0094] For example, the command identifier corresponding to the command to keep the serial number and activate the card is initial keepsn, and the command line corresponding to the command to keep the serial number and activate the card is . / NVMe ToolARCH64-1istinitial keepsn.
[0095] In some implementations, when no command is received, device information of the storage device is obtained in the mode update file system, and when the device information is obtained, the initial device information is displayed in the operation interface.
[0096] Step S200: When it is determined according to the device information that the storage device has entered the read-only mode, it is determined whether the storage device has reached the end of its service life.
[0097] When a storage device enters read-only mode, it also enters write protection. In this state, data stored on the storage device can only be read, not written. Read-only mode is designed to prevent data loss if a user writes data while the storage device is experiencing an anomaly.
[0098] In some implementations, whether the storage device has entered the read-only mode is determined based on the fault information in the device information.
[0099] Optionally, the fault information is a fault code. When the fault code is 0x00, it indicates that the storage device is in normal working state. When the fault code is 0x08, it indicates that the storage device has entered read-only mode.
[0100] See also Figure 2 , Figure 2 yes Figure 1 Detailed flow chart of step S200. Figure 2 As shown, in some embodiments, step S200 includes steps S210 to S230.
[0101] Step S210: When it is determined according to the device information that the storage device has entered the read-only mode, self-monitoring information of the storage device is obtained.
[0102] In some embodiments, the self-monitoring information is Self-Monitoring, Analysis and Reporting Technology (SMART) information.
[0103] In some embodiments, the self-monitoring information includes the power-on time of the storage device, the number of faulty storage units, the operating temperature, the total amount of data written, the total amount of data written limit, the number of erases and writes per storage unit, etc. The power-on time refers to the cumulative power-on time of the storage device since its first use. The total amount of data written refers to the cumulative amount of data written to the storage device since its first use. The total amount of data written limit refers to the maximum amount of data that can be written to the storage device since its first use.
[0104] Step S220: Calculate the remaining life percentage of the storage device based on the self-monitoring information.
[0105] In some implementations, the remaining life percentage of the storage device is obtained by subtracting the accumulated written data amount from the total written data amount limit in the self-monitoring information and dividing the difference by the total written data amount.
[0106] In some embodiments, the total high-temperature operation time of the storage device with an operating temperature higher than a preset temperature is determined based on the operating temperature of the storage device at various time points in the self-monitoring information, and the total high-temperature operation time is divided by the preset high-temperature operation total time limit to obtain the remaining life percentage of the storage device.
[0107] Optionally, the self-monitoring information also includes the total number of storage units.
[0108] In some embodiments, the remaining life percentage of the storage device is obtained by subtracting the quotient of the number of failed storage units in the self-monitoring information divided by the total number of storage units from 1.
[0109] In some embodiments, the self-monitoring information includes a percentage of life remaining for the storage device.
[0110] Step S230: When the remaining life percentage is less than the first preset percentage, it is determined that the storage device has reached its service life; otherwise, it is determined that the storage device has not reached its service life.
[0111] Optionally, the first preset percentage is 80%, 85%, 90% or 95%, etc.
[0112] When it is determined that the storage device has not reached its service life, steps S300 to S600 are executed to release the read-only mode of the storage device. When it is determined that the storage device has reached its service life, the read-only mode of the storage device is not released because writing data to the storage device at this time is likely to cause data loss.
[0113] In some embodiments, when it is determined that the storage device has reached the end of its service life, a prompt message indicating that the storage device has reached the end of its service life is displayed, and / or the stored data in the current storage device is read and stored in another normal storage device.
[0114] In this way, the read-only mode is released only when the storage device has not reached the end of its service life, which can avoid the situation where the read-only mode is released when the storage device has reached the end of its service life, thereby causing data loss during subsequent use.
[0115] Step S300: When it is determined that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit.
[0116] When it is determined that the storage device has not reached the end of its service life, the faulty storage unit in the storage device may be marked as faulty due to an unexpected power outage of the storage device, but is actually not faulty, or may be a truly faulty storage unit.
[0117] See also Figure 3 , Figure 3 yes Figure 1 Detailed flow chart of step S300 in FIG. Figure 3 As shown, in some embodiments, step S300 includes steps S310 to S330.
[0118] Step S310: When it is determined that the storage device has not reached the end of its service life, a bad block address mapping table of the storage device is obtained.
[0119] In some implementations, the bad block address mapping table includes the physical address and failure identifier of each failed storage unit.
[0120] Step S320: For each faulty storage unit, multiple read operations are performed on the faulty storage unit based on the bad block address mapping table. When multiple data obtained from the multiple read operations are inconsistent, the faulty storage unit is determined to be a real faulty storage unit.
[0121] In some implementations, multiple read operations are performed on the faulty storage unit according to the physical address of each faulty storage unit. When multiple data obtained from the multiple read operations are inconsistent, the faulty storage unit is determined to be a real faulty storage unit.
[0122] Step S330: reading the erase count and write count of each faulty storage unit, and when the erase count or write count is greater than a preset count, determining that the faulty storage unit is a real faulty storage unit.
[0123] In some embodiments, the erase count and write count of each faulty memory cell are read from the self-monitoring information. When the erase count or write count exceeds a preset count, the faulty memory cell is determined to be a truly faulty memory cell. Because the erase count and write count of a memory cell are limited, when the erase count or write count exceeds the preset count, the memory cell is excessively worn and is a truly faulty memory cell.
[0124] Step S340: when it is determined based on the bad block address mapping table that the faulty storage unit is a faulty storage unit pre-marked at the factory, the faulty storage unit is determined to be a real faulty storage unit; otherwise, the faulty storage unit is determined not to be a real faulty storage unit.
[0125] In some embodiments, the fault identifier in the bad block address mapping table may further include a factory mark. When the fault identifier includes a factory mark, it indicates that the faulty storage unit corresponding to the fault identifier is a faulty storage unit pre-marked at the factory, and the faulty storage unit pre-marked at the factory is a real faulty storage unit.
[0126] For each faulty storage unit, at least one of step S320, step S330, and step S340 may be executed, and the present application does not limit the order in which the steps are executed.
[0127] Step S400: When the faulty storage unit is a real faulty storage unit, the faulty storage unit is shielded and data in the faulty storage unit is read to a normal storage unit.
[0128] In some implementations, when the faulty storage unit is a real faulty storage unit, the address of each faulty storage unit is mapped to the address of a normal storage unit to mask the faulty storage unit of the storage device.
[0129] Optionally, when the storage device is a solid-state drive including a Flash storage chip, the storage unit is a block in the Flash storage chip, the faulty storage unit is a bad block in the Flash storage chip, and the normal storage unit is a normal block in the Flash storage chip.
[0130] In some implementations, the address of each failed storage unit is mapped to the address of a normal storage unit by modifying the bad block address mapping table.
[0131] In some implementations, multiple masking modes can be used to mask faulty storage units of a storage device based on the device information of the storage device. Different storage device models often have different usage requirements, and sometimes a more intelligent masking mode is needed for the storage device to prevent the address of a faulty storage unit from being mapped to the address of a normal storage unit that has not been detected as faulty but may be about to fail, thereby improving the reliability of the storage device.
[0132] In some implementations, step S400 includes steps S401 and S402.
[0133] Step S401: determining a shielding mode corresponding to a storage device based on preset correspondence information between device information and shielding modes and device information.
[0134] In some implementations, in the correspondence information, one model or manufacturer information corresponds to one shielding mode.
[0135] In some implementations, the shielding mode corresponding to the storage device is determined based on the model or manufacturer information in the device information and the corresponding relationship information.
[0136] Step S402: using the masking mode corresponding to the storage device to map the address of each faulty storage unit to the address of a normal storage unit.
[0137] In some embodiments, the shielding mode includes a redundant shielding mode and a dynamic shielding mode.
[0138] In some embodiments, a storage device is pre-configured with spare storage space. When the masking mode is a redundant masking mode, a sequential mapping method can be used to map the address of each faulty storage unit to the address of a normal storage unit. Specifically, starting from the starting address of the spare storage space, the address of each faulty storage unit is sequentially mapped to the address of a normal storage unit in the spare storage space in the address mapping table.
[0139] In some embodiments, when the masking mode is a redundant masking mode, a random mapping method can be used to map the address of each failed storage unit to the address of a normal storage unit. Specifically, a hash function can be used to sequentially convert the address of each failed storage unit to the address of a normal storage unit in the backup storage space, and the address mapping table can be modified accordingly.
[0140] Because there are many factors that affect the life of a storage unit, even a normal storage unit may fail within a period of time. When the shielding mode is dynamic shielding mode, failure prediction can be performed on normal storage units.
[0141] In some embodiments, when the shielding mode is a dynamic shielding mode, a score of each normal storage unit in the storage device is calculated according to a preset scoring rule, and the address of each faulty storage unit is mapped to the address of a corresponding normal storage unit whose score is within a preset score range.
[0142] In some embodiments, the preset scoring rule is that the score of a normal storage cell is equal to the first weight multiplied by the number of erase / write cycles of the normal storage cell plus the second weight multiplied by the data error rate of the normal storage cell. The number of erase / write cycles and the data error rate of the normal storage cell can be read from a preset storage location on the storage device. The data error rate can be an error correction code (ECC) error rate obtained during a self-test of the storage device.
[0143] The more times a normal memory cell is erased or written, or the higher its data error rate, the more likely it is to fail. Therefore, it can be assumed that a normal memory cell with a score above the upper limit of the preset score range is likely to fail soon, while a normal memory cell with a score within the preset score range has a low probability of failing in the short term.
[0144] In some embodiments, information such as the number of erase and write cycles, electrical data, data error rate, operating temperature curve, and read and write speed of a normal storage unit is read in a storage device, and this information is input into a pre-trained scoring model to obtain a score for the normal storage unit.
[0145] Optionally, the scoring model can be a multi-layer perceptron model, a convolutional neural network model, a recurrent neural network model, or a variant model thereof, etc.
[0146] By adopting the dynamic shielding mode to shield the faulty storage unit, it is possible to avoid mapping the address of the faulty storage unit to the address of a normal storage unit that has not been detected as faulty but may be about to fail, thereby avoiding the normal storage unit from failing in a short period of time, thereby improving the reliability of the storage device.
[0147] Step S500: When the faulty storage unit is not a real faulty storage unit, the fault identifier corresponding to the faulty storage unit is deleted.
[0148] In some implementations, when the faulty storage unit is not a real faulty storage unit, the fault identifier corresponding to the faulty storage unit in the bad block address mapping table is deleted, and the faulty storage unit is marked as a normal storage unit.
[0149] By identifying whether each faulty storage unit in the storage device is a real faulty storage unit before releasing the read-only mode, and if so, reading the data to the normal storage unit, and otherwise deleting the fault identifier corresponding to the faulty storage unit, it is possible to avoid data being lost due to being stored in the faulty storage unit and maximize the available capacity of the storage device.
[0150] Step S600: When all faulty storage units are identified, a command to release the read-only mode is sent to the storage device, so that the storage device exits the read-only mode.
[0151] After executing steps S100 to S500, it can be determined that the storage device is not physically damaged, but rather has entered read-only mode due to an abnormality during operation (e.g., an unexpected power outage). At this point, the storage device is ready to continue normal operation. After the storage device exits read-only mode, the user can write data to the storage device, and the storage device can continue to be used normally.
[0152] In some implementations, in a mode update system, the read-only mode of the storage device is released by a card opening operation, so that data can be written to the storage device.
[0153] In some embodiments, in the mode update system, when all failed storage units are identified, a card unlock command is automatically executed to release the read-only mode of the storage device.
[0154] Optionally, the card activation command may be a new card activation command.
[0155] In some embodiments, in the mode update system, when all failed storage units are identified and a card-opening command is received, the card-opening command is executed to release the read-only mode of the storage device.
[0156] In some embodiments, the method further includes step S700 and / or step S800.
[0157] Step S700: When it is determined that the storage device has not reached the end of its service life, the data storage mode of the storage device is determined as a target data storage mode according to the device status of the storage device or a data storage mode designation command.
[0158] The target data storage mode is an encrypted storage mode, a load balancing storage mode or a centralized storage mode.
[0159] In some embodiments, the device status of the storage device includes a remaining lifespan percentage of the storage device. In this case, step S700 includes steps S710 to S730.
[0160] Step S710: When it is determined that the storage device has not reached its service life and the remaining life percentage is greater than a second preset percentage, the data storage mode of the storage device is determined to be a centralized storage mode.
[0161] Optionally, the second preset percentage is 50%, 60%, 65%, 70% or 80%, etc.
[0162] When the remaining life percentage of the storage device is greater than the second preset percentage, it indicates that the remaining life of the storage device is still relatively long. In this case, the data storage mode of the storage device is determined to be the centralized storage mode.
[0163] When a storage device uses centralized storage mode, frequently accessed data can be stored in a specific storage area so that it can be quickly located and read. Therefore, the centralized storage mode can improve the read and write speed of the storage device.
[0164] Optionally, in the centralized storage 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 then the data in the cache space is written to other sub-storage spaces when it is idle.
[0165] 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.
[0166] In some embodiments, in the centralized storage 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.
[0167] 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.
[0168] Exemplarily, 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.
[0169] In some embodiments, a hierarchical writing method is used in the centralized storage 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.
[0170] In some embodiments, in centralized storage 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 storage 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.
[0171] In some embodiments, when the storage device's stored data includes video files or image files exceeding a third preset data size, the storage device's storage mode can be set to centralized storage mode via the target version of the firmware. This is because when the stored data includes video files or image files exceeding the third preset data size, the storage device may be used in applications primarily requiring sequential writes, such as log storage and video surveillance. In these applications, centralized storage mode enables more efficient data retrieval and management, compared to balanced write mode.
[0172] In some implementations, in the centralized storage mode, which compresses data before storing it, the reserved storage space is disabled, and the target file system is used to store the data.
[0173] Optionally, the target file system may be NTFS or exFAT file system. NTFS or exFAT file system can support storing larger files and achieve higher storage efficiency compared to the general FAT32 file system.
[0174] Optionally, in the centralized storage mode, the storage space allocation mode of the storage device is set to a sub-storage space. Because each sub-storage space has some space for storing file system metadata, this method can avoid dividing too many sub-storage spaces and increase the available storage capacity of the storage device.
[0175] Step S720: When it is determined that the storage device has not reached its service life and the remaining life percentage is not greater than a second preset percentage, the data storage mode of the storage device is determined to be a load balancing storage mode.
[0176] When the remaining life percentage of the storage device is not greater than the second preset percentage, it means that the remaining life of the storage device is already short. At this time, the data storage mode of the storage device is determined to be a load balancing storage mode, which can balance the wear of the storage units and thus extend the usable time of the storage device.
[0177] Step S730: When it is determined that the data stored in the storage device is of an important data type, the data storage mode of the storage device is determined to be an encrypted storage mode.
[0178] In the encrypted storage mode, the data is first encrypted and then stored.
[0179] In some embodiments, when part of the stored data is of an important data type, the data storage mode of the storage device is determined to be an encrypted storage mode, so that all the stored data or part of the stored data of the important data type is encrypted and stored.
[0180] In some implementations, when all stored data are of important data type, the data storage mode of the storage device is determined to be an encrypted storage mode.
[0181] In some implementations, whether the stored data is of an important data type is determined based on the file type of the file in the stored data.
[0182] In some embodiments, the file types include video files, image files, document files, audio files, model design files, source code files, temporary files, etc. Model design files include static 3D model files and animation model files, etc., which are used for design.
[0183] In some implementations, whether the stored data is an important data type may be determined based on business value, recovery difficulty, or legal relevance according to the file type in the stored data.
[0184] In some embodiments, a determination is made based on one of the following indicators: business value, recovery difficulty, and legal relevance, according to the received selection instruction, to determine whether the stored data is an important data type based on the file type in the stored data. In this way, an appropriate determination method can be determined based on the user's needs.
[0185] In some implementations, determining whether the stored data is an important data type based on the file type of the file in the stored data based on the business value includes steps S731 to S734.
[0186] Step S731: When the file type of the file is a model design file or a source code file, it is determined that the data type of the file is an important data type.
[0187] Model design files or source code files are files that can be used directly in production and have high business value, and therefore are important data.
[0188] Step S732: When the file type of the file is a document file, identify the content type of the file, and determine whether the data type of the file is an important data type based on the content type.
[0189] In some implementations, when the content type of a file is identified as an important content type such as a technical proposal, a contract, a financial report, or a meeting minutes, the data type of the file is determined to be an important data type.
[0190] In some implementations, when it is identified that the content type of a file is an unimportant content type such as promotional materials or a draft, the data type of the file is determined to be an unimportant data type.
[0191] Step S733: When the file type of the file is an audio file or a video file, the content type of the file is identified, and whether the data type of the file is an important data type is determined according to the content type.
[0192] In some implementations, when the content type of a file is identified as entertainment content such as music, movies, TV series, or short videos, the data type of the file is determined to be an unimportant data type.
[0193] In some implementations, when it is identified that the content type of a file is an important content type such as meeting minutes, the data type of the file is determined to be an important data type.
[0194] Step S734: When the file type of the file is a temporary file, it is determined that the data type of the file is an unimportant data type.
[0195] In some implementations, determining whether the stored data is an important data type based on the file type of the file in the stored data based on the difficulty of recovery includes steps S735 to S736.
[0196] Step S735: When the file type of the file is a model design file, a source code file, a document file, an audio file, or a video file, it is determined that the data type of the file is an important data type.
[0197] Model design files, source code files, document files, audio files, or video files are very difficult to recover and are therefore important data.
[0198] Step S736: When the file type of the file is a temporary file, it is determined that the data type of the file is an unimportant data type.
[0199] In some implementations, determining whether the stored data is an important data type based on the file type of the file in the stored data based on the legal relevance includes steps S737 to S739.
[0200] Step S737: When the file type of the file is a document file, identify the content type of the file, and determine whether the data type of the file is an important data type based on the content type.
[0201] In some implementations, when the content type of a file is identified as a legally relevant type such as an invoice, audit report, contract, or financial statement, the data type of the file is determined to be an important data type; otherwise, it is determined to be an unimportant data type.
[0202] Step S738: When the file type of the file is an audio file or a video file, identify the content type of the file, and determine whether the data type of the file is an important data type based on the content type.
[0203] In some implementations, when the content type of a file is identified as entertainment content such as music, movies, TV series, or short videos, the data type of the file is determined to be an unimportant data type.
[0204] In some implementations, when it is identified that the content type of a file is an important content type such as a meeting record or a call recording, the data type of the file is determined to be an important data type.
[0205] Step S739: When the file type of the file is a model design file, a source code file, or a temporary file, it is determined that the data type of the file is an unimportant data type.
[0206] In some implementations, data type information of the stored data is obtained, and whether the stored data is an important data type is determined based on the data type information.
[0207] Step S800: determining the logging mode of the storage device as the target logging mode according to the logging mode designation command.
[0208] The target logging mode is either full logging mode or secret logging mode.
[0209] In some embodiments, the full logging mode is a logging mode that records the data address and operation time of each read and write operation. The secret logging mode is a logging mode that does not record the data address and operation time of the read and write operations, or encrypts the recorded data address and operation time.
[0210] In some embodiments, the method further includes steps S900 to S901.
[0211] Step S900: Identify the data type of the stored data in the storage device.
[0212] The method for identifying the data type of the storage data in the storage device refers to the relevant description in step S730.
[0213] Step S901: When it is determined that the data type of the stored data is an important data type, the operation mode of the storage device is determined to be a write-only mode.
[0214] In some implementations, when the data type of the stored data is determined to be an important data type, the operation mode of the storage device is determined to be a write-only mode, which can prevent the important data from being read.
[0215] In some implementations, when a portion of the stored data is of an important data type, the operation mode of the storage device is determined to be a write-only mode.
[0216] In some implementations, when all stored data are of important data types, the operation mode of the storage device is determined to be a write-only mode.
[0217] In some embodiments, when the data type of the stored data is determined to be important, the storage device's data storage mode can be set to encrypted storage mode, and its operation mode can be set to write-only mode. The storage device is then controlled to encrypt the previously stored data and re-store it, making it impossible for the user to read the stored data. In this case, the user can only write data.
[0218] In summary, the method for releasing the read-only mode of a storage device provided in the embodiments of the present application has the following advantages:
[0219] 1. When it is determined based on device information that the storage device has entered read-only mode, it is determined whether the storage device has reached the end of its service life. When it is determined that the storage device has not reached the end of its service life, it is identified whether each faulty storage unit in the storage device is a real faulty storage unit. When all faulty storage units are identified, a command to release the read-only mode is sent to the storage device to make the storage device exit the read-only mode, so that the user can locally release the read-only mode of the storage device independently and the storage device can continue to be used normally.
[0220] Furthermore, it can determine whether a storage device has reached the end of its lifespan and only remove the read-only mode if the storage device has not yet reached the end of its lifespan. This can prevent the situation where read-only mode is removed when the storage device has reached the end of its lifespan, which could lead to data loss during subsequent use. Furthermore, if the storage device has not reached the end of its lifespan but entered read-only mode due to an unexpected power outage, the storage device can be quickly removed from read-only mode without having to return it to the factory for repair.
[0221] 2. By identifying whether each faulty storage unit in the storage device is a real faulty storage unit before releasing the read-only mode, if so, the data is read to the normal storage unit, and if not, the fault identifier corresponding to the faulty storage unit is deleted. This can not only avoid data loss due to storage in the faulty storage unit, but also maximize the available capacity of the storage device.
[0222] See also Figure 4 , Figure 4 Schematic diagram of the structure of the device for releasing the read-only mode of the storage device provided in the embodiment of the present application. Figure 4 As shown, the apparatus 300 for releasing the read-only mode of a storage device includes an acquisition module 310 and an execution module 320 .
[0223] In some implementations, the acquisition module 310 is configured to acquire device information of the storage device when detecting that the storage device is connected.
[0224] In some embodiments, the execution module 320 is used to determine whether the storage device has reached its service life when it is determined based on device information that the storage device has entered read-only mode; when it is determined that the storage device has not reached its service life, identify whether each faulty storage unit in the storage device is a real faulty storage unit; when the faulty storage unit is a real faulty storage unit, shield the faulty storage unit and read the data in the faulty storage unit to a normal storage unit; when the faulty storage unit is not a real faulty storage unit, delete the fault identifier corresponding to the faulty storage unit; when the identification of all faulty storage units is completed, send a command to release the read-only mode to the storage device to cause the storage device to exit the read-only mode.
[0225] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Figure 5 A processor 410 is taken as an example.
[0226] In some embodiments, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 5 The bus connection is taken as an example.
[0227] In some embodiments, the processor 410 is used to obtain device information of the storage device when a storage device connection is detected; when it is determined based on the device information that the storage device has entered the read-only mode, determine whether the storage device has reached its service life; when it is determined that the storage device has not reached its service life, identify whether each faulty storage unit in the storage device is a real faulty storage unit; when the faulty storage unit is a real faulty storage unit, shield the faulty storage unit and read the data in the faulty storage unit to a normal storage unit; when the faulty storage unit is not a real faulty storage unit, delete the fault identifier corresponding to the faulty storage unit; when the identification of all faulty storage units is completed, send a command to release the read-only mode to the storage device to cause the storage device to exit the read-only mode.
[0228] 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 for the method for relieving a storage device from read-only mode 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 method for relieving a storage device from read-only mode in the above-described method embodiment.
[0229] 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.
[0230] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, the method for releasing the read-only mode of the storage device in any of the above method embodiments is executed, for example, the method described above is executed. Figure 1 Method steps S100 to S600 in.
[0231] Please refer to Figure 6 , Figure 6 The computer-readable storage medium 500 stores program code 510, which can be called by a processor to execute the method for releasing the read-only mode of the storage device described in the above method embodiment.
[0232] The computer-readable storage medium 500 can be an electronic memory such as a flash memory, an electrically erasable programmable read-only memory (EEPROM), a hard disk, or a read-only memory (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 codes for executing any method steps in the above-described image processing method. These program codes can be read from or written into one or more computer program products. The program codes can be compressed, for example, in an appropriate form.
[0233] 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.
[0234] In some implementations, the embodiments of the present application further provide a computer program product, including a computer program, which implements the above-mentioned method for releasing the read-only mode of the storage device when executed by a processor.
[0235] In summary, the present application provides a method for releasing the read-only mode of a storage device, an electronic device, and a storage medium. The method for releasing the read-only mode of the storage device includes: when a storage device connection is detected, obtaining device information of the storage device; when it is determined based on the device information that the storage device has entered the read-only mode, judging whether the storage device has reached its service life; when it is judged that the storage device has not reached its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit; when the faulty storage unit is a real faulty storage unit, shielding the faulty storage unit and reading the data in the faulty storage unit to a normal storage unit; when the faulty storage unit is not a real faulty storage unit, deleting the fault identifier corresponding to the faulty storage unit; when the identification of all faulty storage units is completed, sending a command to release the read-only mode to the storage device to cause the storage device to exit the read-only mode. The present application determines whether the storage device has reached the end of its service life when it is determined based on device information that the storage device has entered read-only mode. When it is determined that the storage device has not reached the end of its service life, it identifies whether each faulty storage unit in the storage device is a real faulty storage unit. When all faulty storage units have been identified, a command to release the read-only mode is sent to the storage device to cause the storage device to exit the read-only mode, so that the user can locally release the read-only mode of the storage device independently and enable the storage device to continue to be used normally.
[0236] 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 method for releasing a storage device from read-only mode, characterized in that: include: When a storage device connection is detected, device information of the storage device is obtained; When it is determined according to the device information that the storage device has entered the read-only mode, determining whether the storage device has reached the end of its service life; When it is determined that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit; When the faulty storage unit is a real faulty storage unit, shielding the faulty storage unit and reading the data in the faulty storage unit to a normal storage unit; When the fault storage unit is not a real fault storage unit, deleting the fault identifier corresponding to the fault storage unit; When all the faulty storage units are identified, a command for releasing the read-only mode is sent to the storage device, so that the storage device exits the read-only mode.
2. The method for releasing the read-only mode of a storage device according to claim 1, wherein: When it is determined according to the device information that the storage device has entered the read-only mode, determining whether the storage device has reached the end of its service life includes: When it is determined according to the device information that the storage device has entered the read-only mode, obtaining self-monitoring information of the storage device; calculating a remaining life percentage of the storage device based on the self-monitoring information; When the remaining life percentage is less than a first preset percentage, it is determined that the storage device has reached the end of its service life; otherwise, it is determined that the storage device has not reached its service life.
3. The method for releasing the read-only mode of a storage device according to claim 2, wherein: Calculating the remaining life percentage of the storage device based on the self-monitoring information includes: The remaining life percentage of the storage device is obtained by subtracting the accumulated written data amount from the total written data amount limit in the self-monitoring information and dividing the difference by the total written data amount.
4. The method for releasing the read-only mode of a storage device according to claim 1, wherein: When it is determined that the storage device has not reached the end of its service life, identifying whether each faulty storage unit in the storage device is a real faulty storage unit includes: When it is determined that the storage device has not reached the end of its service life, obtaining a bad block address mapping table of the storage device; For each of the faulty storage units, performing multiple read operations on the faulty storage unit based on the bad block address mapping table, and determining that the faulty storage unit is a real faulty storage unit when multiple data obtained by the multiple read operations are inconsistent; Reading the number of erasures and the number of writes of each of the faulty storage units, and determining that the faulty storage unit is a real faulty storage unit when the number of erasures or the number of writes is greater than a preset number; When it is determined based on the bad block address mapping table that the faulty storage unit is a faulty storage unit pre-marked at the factory, the faulty storage unit is judged to be a real faulty storage unit; otherwise, the faulty storage unit is judged not to be a real faulty storage unit.
5. The method for releasing the read-only mode of a storage device according to claim 1, wherein: The method further comprises: When it is determined that the storage device has not reached the end of its service life, determining the data storage mode of the storage device as a target data storage mode according to a device status of the storage device or a data storage mode designation command, wherein the target data storage mode is an encrypted storage mode, a load balancing storage mode, or a centralized storage mode; and / or The logging mode of the storage device is determined as a target logging mode according to a logging mode designation command, where the target logging mode is a full logging mode or a secret logging mode.
6. The method for releasing the read-only mode of a storage device according to claim 5, wherein: The device status of the storage device includes a remaining life percentage of the storage device, and when it is determined that the storage device has not reached its service life, determining the data storage mode of the storage device as the target data storage mode according to the device status of the storage device or the data storage mode designation command includes: When it is determined that the storage device has not reached its service life and the remaining life percentage is greater than a second preset percentage, determining the data storage mode of the storage device to be the centralized storage mode; When it is determined that the storage device has not reached its service life and the remaining life percentage is not greater than a second preset percentage, determining the data storage mode of the storage device to be the load balancing storage mode; When it is determined that the data stored in the storage device is of an important data type, the data storage mode of the storage device is determined to be the encrypted storage mode.
7. The method for releasing the read-only mode of a storage device according to claim 5, wherein: The complete recording mode is a log recording mode that records the data address and operation time of each read operation and write operation; The secret recording mode is a log recording mode that does not record the data address and operation time of the read operation and the write operation, or encrypts the recorded data address and operation time.
8. The method for releasing the read-only mode of a storage device according to claim 1, wherein: The method further comprises: Identifying a data type of the stored data in the storage device; When it is determined that the data type of the stored data is an important data type, the operation mode of the storage device is determined to be a write-only mode.
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 execute the method for releasing the read-only mode of the storage device 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, and the executable code is executed by a processor to implement the method for releasing the read-only mode of the storage device according to any one of claims 1 to 8.