Method for solid state disk firmware

By using bits of the main file table address in the solid state drive firmware, the problem that the solid state drive cannot judge the data format is solved, effective protection of written data and anti-virus processing is achieved, and the security and system efficiency of the hard disk are improved.

CN119597206APending Publication Date: 2025-03-11APACER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311157803.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-08
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The data format cannot be judged when writing data, resulting in data protection and anti-virus processing being unable to be effectively carried out.

Method used

Before writing to a file, by obtaining bits corresponding to the main file table address in the directory table, it is determined whether to obtain the main file table from the main file table address, and perform subsequent processing based on this attribute, such as antivirus processing and file protection.

Benefits of technology

It realizes the format of writing data, can effectively protect files and prevent virus writing, and improves the security and system efficiency of the solid-state drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597206A_ABST
    Figure CN119597206A_ABST
Patent Text Reader

Abstract

A method for firmware used in a solid state disk comprises the following steps of: before writing a file, obtaining a bit corresponding to a main file table address in a directory table; judging whether a master file table is obtained from the master file table address or not; if the master file table is obtained, obtaining attributes from the master file table; and executing subsequent processing according to the attribute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a solid-state drive (SSD), and more particularly to a method used in SSD firmware. Background Art

[0002] Solid-state drives (SSDs) are excellent in reading speed, which can greatly reduce the time users have to wait while using their computers. However, the communication between SSDs and the system can only be analyzed through the logical block address (LBA) and length, and they have no ability to determine the format of the written data. Summary of the invention

[0003] The present invention provides a method for firmware of a solid-state drive (SSD), comprising obtaining a bit corresponding to a master file table (MFT) address in a directory table before writing a file; determining whether to obtain a master file table from the master file table address; if the master file table is obtained, obtaining attributes from the master file table; and performing subsequent processing according to the attributes.

[0004] The present invention provides another method for firmware of a solid-state drive (SSD), comprising obtaining a bit corresponding to a master file table address in a directory table before writing a file; determining whether the write address of the file is the master file table address; if the write address is the master file table address, obtaining a master file table from the master file table address, and obtaining attributes from the master file table; and

[0005] A subsequent process is performed according to the attribute. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Figure 1 It is a block diagram of a computer system in an embodiment of the present invention.

[0007] Figure 2 Is for Figure 1 Schematic diagram of the file architecture of the file system in .

[0008] Figure 3 Is for Figure 1 Flowchart of a method for writing new files to solid-state drive firmware.

[0009] Figure 4 Is for Figure 1 Flowchart of the antivirus method for solid-state drive firmware.

[0010] Figure 5 Is for Figure 1 Flow chart of a file protection method for a solid state drive firmware.

[0011] Figure 6 Is for Figure 1 Flowchart of a data analysis method for a solid-state drive firmware.

[0012] The reference numerals are described as follows:

[0013] 1: Computer system

[0014] 10: File System

[0015] 12: Solid State Drive

[0016] 120: Firmware

[0017] 122: Master file table

[0018] 124: File data

[0019] 2: File Structure

[0020] 20: Startup code

[0021] 21: Data

[0022] 22, 221 to 22N: Master file table

[0023] 23: Data

[0024] 24: Master file table backup

[0025] 25: Data

[0026] 3: How to write new files

[0027] S301 to S306: Steps

[0028] 4: Anti-virus methods for solid state drives

[0029] S401 to S405: Steps

[0030] 5: File protection methods for solid state drives

[0031] S501 to S506: Steps

[0032] 6: SSD storage data analysis method

[0033] S601 to S605: Steps DETAILED DESCRIPTION

[0034] Figure 1 1 is a block diagram of a computer system 1 according to an embodiment of the present invention. The computer system 1 may include a file system 10 and a solid state drive 12.

[0035] The file system 10 is a layer of software between the application and the solid state drive 12, which implements disk space management for the solid state drive 12 and provides a user access interface for the application. The file system 10 may be a new technology file system (NTFS). Users may create, delete or read files through the file system 10. The solid state drive 12 may store firmware 120, a master file table 122 and file data 124. The solid state drive 12 may execute the firmware 120 so that the solid state drive 12 performs various subsequent processes (such as anti-virus processing, file protection processing and data analysis processing) according to file attributes (such as file name), thereby enhancing the added value of the solid state drive 12 and improving system performance.

[0036] Figure 2 2 is a schematic diagram of a file structure 2 of a file system 10. The file structure 2 may include a boot code 20, data 21, a master file table portion 22, data 23, a master file table backup portion 24 and data 25.

[0037] The boot code 20 may be the program code that is first executed after the computer system 1 is turned on. The data 21 may be data used by the boot code 20. The master file table portion 22 may include a plurality of master file tables (MFT) 221 to 22N, where N is a positive integer greater than 1. Each master file table may have 1024 bytes, and the master file table portion 22 may be a fixed and continuous area. The data 23 and 25 may be data used by the master file table portion 22. The master file table backup portion 24 may be a backup of the master file table portion 22.

[0038] Figure 3 This is a flow chart of a new file writing method 3 of the firmware 120 in the solid state drive 12. The new file writing method 3 includes steps S301 to S306, which are used to write a new file. Any reasonable technical changes or step adjustments fall within the scope of the present invention. Steps S301 to S306 are as follows:

[0039] Step S301: The firmware 120 reads the logical block address 0 and obtains the address of the boot code ($BOOT);

[0040] Step S302: The firmware 120 obtains the address of the master file table;

[0041] Step S303: The firmware 120 obtains the address of the directory table ($MFT:bitmap) through the master file table;

[0042] Step S304: The firmware 120 writes the directory table ($MFT:bitmap) address;

[0043] Step S305: The firmware 120 obtains the address of the content directory table ($Bitmap);

[0044] Step S306: The firmware 120 writes the file data.

[0045] When a file is written through NTFS, the computer system 1 will first write the directory and then the content. Two master file tables will be processed in the directory. The first master file table (also called directory table or $MFT:bitmap) can be used to determine whether it is a new file to be written, and the second master file table can be used to find the file logical block address (Logical Block Address, LBA).

[0046] When the solid state drive 12 is started, the firmware 120 can obtain the data in the logical block address 0 (LBA0) through the logical block address to physical block address table (L2P Table), wherein the data in the logical block address 0 is the master boot record (MBR). Therefore, in step S301, the firmware 120 can obtain the entry point of the file system (NTFS) data through the logical block address 0 (get the logical block address of the boot code ($BOOT)).

[0047] In step S302, when the firmware 120 obtains the entry point of the file system data, it can obtain the logical block address of the master file table according to the NTFS architecture. A master file table includes a header and attributes. The header contains the information of this master file table. The attributes are information related to the written data, including standard attributes, file name attributes, file data attributes, bitmap attributes, etc. In step S303, the logical block address (Logical Block Address, LBA) of the directory table ($MFT:bitmap) can be obtained through the attributes of the master file table.

[0048] The directory table contains a plurality of bits, each bit representing whether the master file table of the corresponding master file table address has been used. In some embodiments, if the bit in the directory table is 1, it indicates that the master file table of the corresponding master file table address has been used; if the bit in the directory table is 0, it indicates that the master file table of the corresponding master file table address has not been used. Step S304 determines whether the master file table of the corresponding master file table address has been used through the bits of the directory table. If the master file table of the corresponding master file table address has not been used, data is written to the address. In step S305, the content directory table ($BitMap) address is obtained. Then, in step S306, the data content is written.

[0049] Figure 4This is a flow chart of the antivirus method 4 for the firmware 120 in the solid state drive 12. The solid state drive firmware antivirus method 4 includes steps S401 to S405, which are used to block virus file writing. Any reasonable technical changes or step adjustments fall within the scope disclosed by the present invention. Steps S401 to S405 are as follows:

[0050] Step S401 obtains the bit corresponding to the master file table address in the directory table ($MFT:bitmap), and determines whether to obtain the master file table from the master file table address according to the bit; if so, proceed to step S402; if not, proceed to step S405;

[0051] Step S402 obtains the master file table from the master file table address, and obtains the file extension from the master file table;

[0052] Step S403 determines whether the file extension is the same as the preset extension; if so, proceed to step S404; if not, proceed to step S405;

[0053] Step S404 stops writing files;

[0054] Step S405 writes the file.

[0055] Step S401 Before writing a file, the firmware 120 obtains the master file table address of the written file, obtains the bit corresponding to the master file table address in the directory table, and determines whether to obtain the master file table from the master file table address based on the bit. The directory table includes a plurality of bits, each bit representing whether the master file table of the corresponding master file table address has been used. In some embodiments, if the bit in the directory table is 1, it indicates that the master file table of the corresponding master file table address has been used; if the bit in the directory table is 0, it indicates that the master file table of the corresponding master file table address has not been used. For example, the master file table address of the written file is the 8th master file address, and the 0th byte (BYTE[0]) in the directory table is 0xFE (=1111 1110b), which means that the 8th master file is not used, so the written file is a new file. In another example, the master file table address of the written file is the address of the first master file, and the 0th byte (BYTE[0]) in the directory table is 0xFE (=1111 1110b), which means that the first master file has been used, so the written file is not a new file. If it is not a new file, the firmware 120 writes the file (step S405), and if it is a new file, step S402 is performed.

[0056] In step S402, the firmware 120 obtains the master file table from the master file table address and obtains the file attributes from the master file table. The file attributes include standard attributes, file name attributes, file data attributes, etc., wherein the file name attributes include the file name and subname of the file to be written.

[0057] Then, subsequent processing is performed according to the obtained attributes, and the subsequent processing can be to determine whether the file extension is the same as one of a set of preset extensions. Step S403 obtains the extension of the file to be written from the attributes, and compares the file extension with one of a set of preset extensions to determine whether the two are the same. The preset extension can include common virus extensions, such as: .crypt file, .ECC file, .VVV file, .CCC file, .ZZZ file, .AAA file, .ABC file, .XYZ file, .Micro file, .XXX file, .TTT file, .MP3 file or .RSNSlocked file. If the file extension is the same as one of the preset extensions, for example, the file extension is .crypt file, the file to be written may be a virus file, so stop writing the file (step S404), if the extension is different from the preset extension, the file to be written is not a virus file, so write the file (step S405), so as to achieve the effect of preventing virus writing.

[0058] Figure 5 1 is a flowchart of a file protection method 5 of the firmware 120 in the solid state drive 12. The file protection method 5 of the solid state drive firmware 12 includes steps S501 to S506, which are used to protect files. Any reasonable technical changes or step adjustments fall within the scope of the present invention. Steps S501 to S506 are as follows:

[0059] Step S501 obtains the bit corresponding to the master file table address in the directory table ($MFT:bitmap);

[0060] Step S502 determines whether the address where the file is written is the address of the main file table; if so, proceed to step S503; if not, proceed to step S506;

[0061] Step S503 obtains the master file table from the master file table address, and obtains the file attribute from the master file table;

[0062] Step S504 determines whether the file name in the file attribute is the same as the preset file name. If yes, proceed to step S504; if not, proceed to step S505;

[0063] Step S505 stops writing files;

[0064] Step S506 writes the file.

[0065] Before writing the file, step S501 obtains the bit corresponding to the master file table address in the directory table ($MFT:bitmap), and then determines in step S502 whether the location where the file is written is the master file table address. The written file may belong to the master file table content or data content. If the file writing location is the master file table address, the written file may belong to the master file table content, so in step S503, the firmware 120 obtains the master file table from the master file table address, and obtains the file attributes from the master file table to determine whether to write the master file table content. File attributes include standard attributes, file name attributes, file data attributes, etc., wherein the file name attribute includes the file name and subfile name of the file to be written. If the address written is not the master file table address, the written file may belong to the data content, so in step S506, the firmware 120 writes the file to the write address.

[0066] Then, subsequent processing is performed according to the obtained attributes. The subsequent processing can be to compare whether the file name is the same as one of a set of preset file names. Step S504 obtains the file name of the file to be written from the attributes, and compares the file name with one of a set of preset file names to determine whether the two are the same. The file name to be protected can be transmitted to the firmware 120 as a protection list by a specific command. The files in the protection list are files that do not want to be modified. If the file name of the written file is the same as one of the preset file names, the file to be written is the file to be protected, so the firmware 120 stops writing the file (step S505), thereby achieving the effect of protecting the file. If the file name of the written file is different from the preset file name, the file to be written is not the file to be protected, so the file is written (step S506), and the written file can be the content of the main file table.

[0067] Figure 6 1 is a flow chart of a method 6 for analyzing storage data of the firmware 120 in the solid state drive 12. The method 3 for analyzing storage data of the solid state drive firmware includes steps S601 to S605, which are used to block virus file writing. Any reasonable technical changes or step adjustments fall within the scope disclosed by the present invention. Steps S601 to S605 are as follows:

[0068] Step S601 obtains the bit corresponding to the master file table address in the directory table ($MFT:bitmap), and determines whether to obtain the master file table from the master file table address according to the bit;

[0069] Step S602 obtains the master file table from the master file table address, and obtains the file extension from the master file table attributes;

[0070] Step S603 determines the file extension;

[0071] Step S604: performing data restoration;

[0072] In step S605, no data restoration operation is performed.

[0073] Step S601, before writing the file, obtains the bit corresponding to the master file table address in the directory table ($MFT:bitmap), and determines whether to obtain the master file table from the master file table address according to the bit. Each byte in the directory table represents whether the master file table has been used, so this step can be used to determine whether the written file is a new file. If it is not a new file, the data restoration action (step S605) is not performed. If it is a new file, step S602 is performed.

[0074] Step S602 obtains the master file table from the master file table address and obtains file attributes from the master file table. File attributes include standard attributes, file name attributes, file data attributes, etc., wherein the file name attributes include the file name and subname of the file to be written.

[0075] Step S603 determines the file extension of the file to be written. If the file extension is the same as the file extension of a record file created by the operating system when a system crash occurs (e.g., a .dmp file), a data restoration action is performed (step S604). The restoration action in step S604 includes combining automatic learning and other backup and restoration technologies for solid-state drive firmware. If they are not the same, the data restoration action is not performed (step S602). Through this method, when the customer encounters a blue screen, the firmware can be used to know and take corresponding measures.

[0076] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the claims of the present invention should fall within the scope of the present invention.

Claims

1. A method for firmware in a solid state drive, comprising: Before writing a file, obtaining a bit of a master file table address corresponding to the file in a directory table; Determine whether to obtain a master file table from the master file table address according to the bit; If the master file table is obtained, obtaining an attribute from the master file table; and A subsequent process is performed according to the attribute.

2. The method of claim 1, wherein the step of determining whether to obtain the master file table from the master file table address according to the bit comprises: If the bit indicates that the master file table address has been used, the master file table is not obtained from the master file table address and is written into the file.

3. The method of claim 1, wherein the step of determining whether to obtain the master file table from the master file table address according to the bit comprises: If the bit indicates that the master file table address is not used, the master file table is obtained from the master file table address. The method of claim 1 , wherein the attribute is a file name.

5. The method of claim 4, wherein performing the subsequent processing according to the attribute comprises: If the file extension is the same as one of a set of preset file extensions, stop writing the file.

6. The method of claim 4, wherein performing the subsequent processing according to the attribute comprises: If the file extension is different from each of a set of default file extensions, the file is written.

7. The method of claim 4, wherein performing the subsequent processing according to the attribute comprises: If the file extension is the same as a file extension (.dmp file) of a log file created by an operating system when a system crash occurs, a data restoration operation is performed.

8. A method for use in firmware of a solid state drive, comprising: Before writing a file, obtaining a bit in a directory table corresponding to a master file table address; Determine whether a write address of the file is the master file table address; If the write position is the master file table address, obtain a master file table from the master file table address, and obtain an attribute from the master file table; and A subsequent process is performed according to the attribute.

9. The method of claim 8, wherein the attribute is a file name.

10. The method of claim 9, wherein performing the subsequent processing according to the attribute comprises: If the file name is the same as one of a set of preset file names, stop writing the file.

11. The method of claim 9, wherein performing the subsequent processing according to the attribute comprises: If the file name is different from each of a set of default file names, the file is written.