A method for storing data in a solid state drive (SSD)

By classifying SSD data and optimizing storage area planning, the unreasonable utilization of storage resources caused by differences in data type characteristics in the prior art is solved, and efficient utilization, safe and reliable data storage and fast read and write access are achieved, which is suitable for diverse application scenarios.

CN119739338APending Publication Date: 2025-04-01HUIJU ELECTRONICS (DONGGUAN) IND CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411910695.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The existing SSD data storage methods fail to effectively manage the characteristics of different types of data, resulting in unreasonable utilization of storage resources and unbalanced data reading and writing speeds, which cannot meet the needs of diverse application scenarios.

Method used

The data to be stored is classified through the data identification module, divided into system key data, application data and user ordinary data, and optimization measures are taken in terms of storage area planning, data preprocessing, address mapping, storage management and data reading according to the data type.

Benefits of technology

It realizes efficient utilization of SSD storage resources, secure and reliable data storage, and fast read and write access, extends the service life of SSD and adapts to diverse application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739338A_ABST
    Figure CN119739338A_ABST
Patent Text Reader

Abstract

The present invention discloses an SSD solid state drive data storage method, which relates to the technical field of solid state drives, and comprises the following steps: a data receiving and classification step: receiving data to be stored from a host system, classifying the data based on a predefined data feature library through a data identification module, and dividing the data into system key data, application data and user common data, wherein the predefined data feature library contains typical file formats, data header information and access frequency feature information of each type of data; a storage area planning step: dividing the SSD solid state drive into a plurality of storage areas according to its internal architecture, including at least one high-speed and high-reliability core storage area for storing system key data, a plurality of medium-performance storage areas for storing application data and a large-capacity storage area for storing user common data; achieving significant beneficial effects such as efficient use of storage resources and safe and reliable data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solid state hard disks, and in particular to a method for storing data in an SSD solid state hard disk. Background Art

[0002] With the rapid development of information technology, the demand for data storage has exploded. Solid-state drives (SSDs), as a high-performance data storage device, have been widely used in various fields. Due to the limitations of their physical structure, traditional mechanical hard drives are gradually unable to meet the requirements of modern data storage in terms of data read and write speed, shock resistance, and energy consumption. SSDs, with their flash-based storage technology, have the advantages of fast read and write speeds, high random access performance, low power consumption, and small size, and have become one of the current research hotspots and mainstream application directions in the storage field.

[0003] In the process of SSD data storage, how to effectively manage data and improve storage efficiency, data security and reliability has become a key issue that needs to be solved. Early SSD data storage methods were relatively simple, often using a single storage mode, without fully considering the differences in the characteristics of different types of data, resulting in irrational use of storage resources, uneven data reading and writing speeds, and failure to meet the needs of diverse application scenarios.

[0004] On the one hand, with the continuous development of operating systems and various applications, system key data is crucial to the stable operation of the entire system, and has extremely high requirements for storage reliability and read and write speed; application data is of various types and sizes, and has different requirements for storage space optimization and data integrity protection; while user ordinary data focuses on large-capacity storage and basic data error processing. On the other hand, there are problems with wear leveling and bad block management in the flash memory chip inside the SSD. If reasonable area division and effective management strategy are not carried out, the service life and overall performance of the SSD will be affected.

[0005] In addition, traditional methods also have many shortcomings in data preprocessing, address mapping, storage management, etc. For example, simple data processing methods cannot fully guarantee the security and integrity of data, static address mapping mechanisms are difficult to adapt to dynamic changes in data access frequency, lack of flexible storage area adjustment mechanisms, and imperfect cache management strategies lead to low data reading efficiency.

[0006] In summary, in order to overcome the limitations of existing SSD data storage technology, improve the comprehensive performance of SSD, and meet the growing demand for complex data storage, a new data storage method is urgently needed that can be finely classified according to data types and take optimization measures in storage area planning, data preprocessing, address mapping, storage management, and data reading based on the characteristics of different types of data, so as to achieve efficient utilization of SSD storage resources, safe and reliable storage of data, and fast read and write access. Summary of the invention

[0007] In order to overcome the above-mentioned shortcomings, the present invention aims to provide a technical solution that can solve the above-mentioned problems.

[0008] A method for storing data in an SSD solid state hard disk comprises the following steps: Data receiving and classification step: receiving data to be stored from the host system, classifying the data into system key data, application data and user common data based on a predefined data feature library through a data identification module, wherein the predefined data feature library contains typical file formats, data header information and access frequency feature information of each type of data; Storage area planning step: according to the internal architecture of the SSD solid state drive, the SSD is divided into multiple storage areas, including at least one high-speed and high-reliability core storage area for storing key system data, multiple medium-performance storage areas for storing application data, and a large-capacity storage area for storing common user data. At the same time, an independent wear leveling management unit and a bad block management unit are established for each storage area; Data preprocessing steps: Different preprocessing operations are performed for different types of data. For system key data, a high-strength encryption algorithm is used for encryption processing, and a digital signature is added to ensure the integrity and authenticity of the data; for application data, data compression is performed to reduce storage space usage, and a checksum is generated by a cyclic redundancy check (CRC) algorithm and attached to the end of the data; for user ordinary data, simple error detection and correction coding (ECC) processing is performed; Data writing and address mapping step: writing the preprocessed data into the corresponding storage area according to the data type. In the writing process, a dynamic address mapping mechanism is used to assign a logical address to each data block, and the logical address is mapped to a physical address through an address conversion table, wherein the address conversion table is optimized and updated according to the access frequency and writing order of the data. For frequently accessed data, its logical address is mapped to a storage unit with a continuous physical address to improve the data reading speed; Data storage management steps: During the data storage process, the usage, performance indicators and number of bad blocks of each storage area are monitored in real time. When the remaining space of a storage area is lower than the preset threshold or the bad block ratio exceeds the safety threshold, the dynamic adjustment mechanism of the storage area is started to migrate some low-priority data to other suitable storage areas and update the address mapping information. At the same time, the integrity check and backup operations of the stored data are performed regularly. For the damaged data detected, it is restored from the backup or repaired according to the redundant information. Data reading steps: when receiving a data reading request from the host system, first query the cache area, if the cache hits, directly read the data from the cache and return it to the host system; if the cache misses, read the data from the corresponding storage area according to the data type and address mapping information, and before returning the data to the host system, perform corresponding decryption, decompression or error correction operations according to the data preprocessing method, and load the read data into the cache area at the same time, and use the LRU algorithm to update the data arrangement order in the cache area. The LRU algorithm is implemented by maintaining a data access sequence linked list, and the newly accessed data is inserted at the head of the linked list. When the cache area is full and new data needs to be inserted, the data at the end of the linked list is deleted.

[0009] As a further solution of the present invention: in the data receiving and classification step, the data identification module adopts a classification algorithm based on machine learning, continuously optimizes the accuracy of data classification by learning and analyzing historical data, and can automatically adapt to newly emerging data types and feature changes.

[0010] As a further solution of the present invention: in the storage area planning step, the core storage area is constructed using enterprise-level SLC (Single-Level Cell) flash memory chips, which have power-off protection function and redundant power supply design to ensure the security and reliability of key system data; the medium-performance storage area is constructed by combining MLC (Multi-Level Cell) flash memory chips with cache to balance performance and cost; the large-capacity storage area uses TLC (Triple-Level Cell) flash memory chips, and optimizes storage space utilization through dynamic storage technology.

[0011] As a further solution of the present invention: in the data preprocessing step, the high-strength encryption algorithm is the AES (Advanced Encryption Standard) algorithm, and the encryption key is generated and managed by a hardware encryption module to ensure the security of the key; the data compression algorithm adopts an adaptive lossless compression algorithm, which can automatically select the best compression algorithm and parameters according to the type and content of the data.

[0012] As a further solution of the present invention: in the data writing and address mapping steps, the dynamic address mapping mechanism adopts a hybrid mapping method, combining the advantages of page-level mapping and block-level mapping. For small data blocks, page-level mapping is used to improve space utilization, and for large data blocks, block-level mapping is used to improve writing performance; and the address conversion table adopts a distributed storage structure and is stored in multiple independent storage units to improve the efficiency and reliability of address conversion.

[0013] As a further solution of the present invention: in the data storage management step, the storage area dynamic adjustment mechanism adopts an intelligent decision-making algorithm to comprehensively consider the data access frequency, performance differences in storage areas, data correlation and the overall load of the SSD to determine the optimal data migration plan, and during the data migration process, an incremental data migration method is adopted to reduce the impact on the normal read and write operations of the SSD.

[0014] As a further solution of the present invention: in the data reading step, the cache area adopts a multi-level cache architecture, including a first-level cache and a second-level large-capacity cache, wherein the first-level cache adopts a static random access memory (SRAM) for storing the most commonly used data and instructions, and the second-level large-capacity cache adopts a dynamic random access memory (DRAM) for expanding the cache capacity, and the cache area is connected to the main control chip of the SSD using a high-speed data bus to increase the data transmission speed.

[0015] As a further solution of the present invention: it also includes a data aging management step: regularly performing aging analysis on the stored data, marking the data that has not been accessed for a long time as aged data according to the last access time of the data and the preset aging cycle, and for the aged data, choosing to migrate it to a storage medium with lower cost or directly delete it according to its data type and usage of the storage area, so as to free up storage space and optimize the storage performance of the SSD.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1) The data storage method of the SSD solid state drive brings many significant beneficial effects. In terms of storage resource utilization, through accurate data classification and storage area planning adapted to it, refined data storage is achieved. Data with different characteristics can be stored in a storage environment that meets their needs, avoiding resource waste and optimizing the storage resource allocation of the entire SSD. 2) In terms of data security, different security measures such as high-intensity encryption and digital signature, CRC checksum and ECC processing are adopted for system key data, application data and user general data, forming a multi-level security protection system to ensure the security and integrity of data during storage; 3) Regarding data reading and writing speed, on the one hand, the dynamic address mapping mechanism reduces data reading latency by optimizing the data reading path and taking advantage of the sequential reading of flash memory chips; on the other hand, the combination of the cache area and the LRU algorithm improves data reading efficiency, and writing data in order by data type also optimizes data writing performance; 4) In terms of extending the service life of SSD, the independent wear leveling management unit and bad block management unit of each storage area, as well as the dynamic adjustment mechanism of the storage area, can effectively avoid excessive wear of specific storage units, deal with bad block problems in a timely manner, and ensure the stability and reliability of SSD in long-term use. In addition, this method fully considers the characteristics of various types of data and the diverse application scenario requirements. Whether it is enterprise-level applications with high requirements for system stability and data security, or personal applications that focus on large-capacity storage and fast reading, it can be well adapted, greatly improving the applicability of SSD in various environments.

[0017] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] See also Figure 1 In an embodiment of the present invention, a method for storing data in an SSD solid state hard disk includes the following steps: Data receiving and classification step: receiving data to be stored from the host system, classifying the data into system key data, application data and user common data based on a predefined data feature library through a data identification module, wherein the predefined data feature library contains typical file formats, data header information and access frequency feature information of each type of data; Storage area planning step: according to the internal architecture of the SSD solid state drive, the SSD is divided into multiple storage areas, including at least one high-speed and high-reliability core storage area for storing key system data, multiple medium-performance storage areas for storing application data, and a large-capacity storage area for storing common user data. At the same time, an independent wear leveling management unit and a bad block management unit are established for each storage area; Data preprocessing steps: Different preprocessing operations are performed for different types of data. For system key data, a high-strength encryption algorithm is used for encryption processing, and a digital signature is added to ensure the integrity and authenticity of the data; for application data, data compression is performed to reduce storage space usage, and a checksum is generated by a cyclic redundancy check (CRC) algorithm and attached to the end of the data; for user ordinary data, simple error detection and correction coding (ECC) processing is performed; Data writing and address mapping step: writing the preprocessed data into the corresponding storage area according to the data type. In the writing process, a dynamic address mapping mechanism is used to assign a logical address to each data block, and the logical address is mapped to a physical address through an address conversion table, wherein the address conversion table is optimized and updated according to the access frequency and writing order of the data. For frequently accessed data, its logical address is mapped to a storage unit with a continuous physical address to improve the data reading speed; Data storage management steps: During the data storage process, the usage, performance indicators and number of bad blocks of each storage area are monitored in real time. When the remaining space of a storage area is lower than the preset threshold or the bad block ratio exceeds the safety threshold, the dynamic adjustment mechanism of the storage area is started to migrate some low-priority data to other suitable storage areas and update the address mapping information. At the same time, the integrity check and backup operations of the stored data are performed regularly. For the damaged data detected, it is restored from the backup or repaired according to the redundant information. Data reading steps: when receiving a data reading request from the host system, first query the cache area, if the cache hits, directly read the data from the cache and return it to the host system; if the cache misses, read the data from the corresponding storage area according to the data type and address mapping information, and before returning the data to the host system, perform corresponding decryption, decompression or error correction operations according to the data preprocessing method, and load the read data into the cache area at the same time, and use the LRU algorithm to update the data arrangement order in the cache area. The LRU algorithm is implemented by maintaining a data access sequence linked list, and the newly accessed data is inserted at the head of the linked list. When the cache area is full and new data needs to be inserted, the data at the end of the linked list is deleted.

[0022] In the technical solution of the present invention, the predefined data feature library is the core basis for data classification. The typical file format can help identify the data type. For example, operating system files usually have a specific format. By identifying this format, they can be classified as system critical data (operating system files may have formats such as .exe (executable file), .dll (dynamic link library), etc., which are typical characteristics of system critical data); the data header information contains the starting identifier and related attributes of the data, which can assist in determining the category to which the data belongs. The access frequency feature information reflects the frequency of data use. Frequently accessed data is often crucial to system operation. For example, system critical data may be called multiple times in a short period of time. Through comprehensive analysis of these features, the data recognition module can accurately classify the received data; The internal architecture of SSD solid state drives contains storage media of different performance levels. The core storage area usually uses high-performance and high-reliability flash memory chips, which takes into account the high requirements of system key data on storage and reading speed and data reliability; the medium-performance storage area is adapted to application data, because the performance requirements of application data are between system key data and user ordinary data. By reasonably selecting the type and configuration of flash memory chips, a balance can be achieved between cost and performance; the large-capacity storage area is used for user ordinary data, mainly considering the needs of user ordinary data for large-capacity storage, and generally uses flash memory chips with lower cost and larger storage capacity; Establishing independent wear leveling management units and bad block management units for each storage area is based on the physical characteristics of flash memory chips. Flash memory chips will have uneven wear and bad block problems after repeated write and erase operations. Independent wear leveling management units can evenly distribute write and erase operations in each area to reduce excessive wear in specific areas. Bad block management units can promptly detect and handle bad blocks in the storage area to ensure normal storage and reading of data. The application of high-strength encryption algorithms is to prevent the illegal acquisition and tampering of key data in the system during storage and transmission. The encryption process converts data into ciphertext, which can only be decrypted and viewed by the authorized party with the correct key. The addition of digital signatures uses asymmetric encryption technology to obtain digital signatures by performing hash operations on the data and encrypting them with a private key. The receiver can use the sender's public key to verify the digital signature, ensuring the integrity and authenticity of the data and ensuring the high security of key data in the storage process. Data compression is based on the diversity and scale of application data. Data generated by different applications may contain a large amount of redundant information. The adaptive lossless compression algorithm can reduce the storage space occupied by data without losing data information. The cyclic redundancy check (CRC) algorithm generates a check code attached to the end of the data because data errors may be caused by noise interference or storage medium failure during data storage and transmission. The receiver can verify whether the data is complete through the check code. If the data is found to be damaged, it can request retransmission or repair; Simple error detection and correction coding (ECC) processing is mainly based on the large-capacity storage characteristics of user common data. In large-scale data storage, occasional bit errors are difficult to avoid. ECC coding can detect and correct these errors to a certain extent by adding redundant information to the original data, ensuring the basic accuracy of user common data during storage. The dynamic address mapping mechanism is designed to adapt to the dynamic changes in data access frequency. When writing data, a logical address is assigned to each data block, and the logical address is mapped to a physical address through an address translation table. Since the access frequency of different data changes in different time periods, the address translation table is optimized and updated according to the access frequency and writing order of the data. For example, the logical address of frequently accessed data is mapped to a storage unit with a continuous physical address. This can take advantage of the sequential reading of the flash memory chip, reduce the seek time when reading data, and thus improve the data reading speed. During the data storage process, real-time monitoring of the usage, performance indicators, and number of bad blocks of each storage area is the key to ensuring the stable operation of the SSD. When the remaining space of a storage area is lower than the preset threshold or the bad block ratio exceeds the safety threshold, the dynamic adjustment mechanism of the storage area is activated. This mechanism determines the migration plan through an intelligent decision-making algorithm, migrates some low-priority data to other suitable storage areas, and updates the address mapping information to ensure the effective use of the storage area and the safe storage of data; Regular integrity checks and backups of stored data are performed to deal with possible data corruption. During data storage, data may be corrupted due to the physical characteristics of flash memory chips or other external factors. Regular checks can detect corrupted data in a timely manner. For detected corrupted data, restore it from backup or repair it based on redundant information to ensure long-term data reliability. In the process of data reading, the cache area is queried first, which is based on the principle of locality of data access. In a short period of time, data often has the characteristic of repeated access. Storing recently accessed data in the cache area can reduce direct access to the storage medium and improve data reading efficiency. If the cache hits, the data is directly read from the cache and returned to the host system. If the cache misses, the data is read from the corresponding storage area and decrypted, decompressed or error corrected according to the data preprocessing method to ensure that the data returned to the host system is correct and available; The LRU algorithm is used to update the order of data in the cache in order to optimize the use of the cache. By maintaining a data access order linked list, the newly accessed data is inserted into the head of the linked list. When the cache is full and new data needs to be inserted, the data at the end of the linked list is deleted, that is, the least recently used data is deleted, ensuring that the data stored in the cache are the data that are most likely to be accessed again in the near future, further improving cache utilization and data reading efficiency; In summary, the data storage method of the SSD solid state drive brings many significant beneficial effects. In terms of storage resource utilization, through accurate data classification and storage area planning adapted thereto, refined data storage is achieved. Data with different characteristics can be stored in a storage environment that meets their needs, thus avoiding resource waste and optimizing the storage resource allocation of the entire SSD. In terms of data security, different security measures such as high-intensity encryption and digital signature, CRC checksum and ECC processing are adopted for system key data, application data and user general data, forming a multi-level security protection system to ensure the security and integrity of data during storage; Regarding data reading and writing speed, on the one hand, the dynamic address mapping mechanism reduces data reading latency by optimizing the data reading path and taking advantage of the sequential reading of flash memory chips; on the other hand, the combination of the cache area and the LRU algorithm improves data reading efficiency, and writing data in order by data type also optimizes data writing performance; In terms of extending the service life of SSDs, the independent wear leveling management unit and bad block management unit in each storage area, as well as the dynamic adjustment mechanism of the storage area, can effectively avoid excessive wear of specific storage units, deal with bad block problems in a timely manner, and ensure the stability and reliability of SSDs in long-term use. In addition, this method fully considers the characteristics of various types of data and the needs of diverse application scenarios. It can be well adapted to both enterprise-level applications with high requirements for system stability and data security, and personal applications that focus on large-capacity storage and fast reading, greatly improving the applicability of SSDs in various environments.

[0023] In an embodiment of the present invention, in the data receiving and classification step, the data identification module adopts a classification algorithm based on machine learning, continuously optimizes the accuracy of data classification by learning and analyzing historical data, and can automatically adapt to newly emerging data types and feature changes.

[0024] The data identification module uses machine learning algorithms to build data classification models. First, a large amount of historical data is collected as training samples. These data contain typical features of various known data, such as file formats, data header information, and access frequency patterns of system key data, application data, and user general data. The machine learning algorithm extracts the key features and pattern rules of different types of data by learning from these samples, thereby building a classification model that can accurately distinguish different data types. As time goes by, new data is constantly generated, and its type and characteristics may also change. This module will continuously collect new data samples and incorporate them into the model training and optimization process. By continuously updating the model's parameters and feature weights, it can automatically adapt to newly emerging data types and feature changes, and maintain the accuracy and adaptability of data classification.

[0025] In the embodiment of the present invention, in the storage area planning step, the core storage area is constructed by enterprise-level SLC (Single-Level Cell) flash memory chips, which have power-off protection function and redundant power supply design to ensure the security and reliability of key system data; the medium-performance storage area is constructed by combining MLC (Multi-Level Cell) flash memory chips with cache to balance performance and cost; the large-capacity storage area uses TLC (Triple-Level Cell) flash memory chips, and optimizes storage space utilization through dynamic storage technology.

[0026] Each storage unit of the SLC flash memory chip stores only 1 bit of data, and has high read and write speed, durability and stability. It can well meet the frequent read and write operations and extremely high requirements for data reliability for key system data, such as operating system files and key configuration information. Considering that the system may encounter unexpected situations such as sudden power outages during operation, the power-off protection function can instantly write key data in the cache to the SLC flash chip to prevent data loss. The redundant power supply design further ensures that when the main power fails, the core storage area can still maintain power supply for a period of time to ensure data integrity and consistency, thereby ensuring the security and reliability of key system data; Each storage unit of MLC flash memory chip can store 2 bits of data, with relatively high storage density and lower cost than SLC flash memory chip, but its read / write speed and durability are slightly inferior. By combining with cache memory, the fast read / write characteristics of cache memory are used to make up for the shortcomings of MLC flash memory chip in read / write performance. For application data, this combination can not only meet its demand for a certain read / write speed, but also achieve a good balance in cost control, so that the cost performance of storage area is optimized; Each storage unit of TLC flash memory chip can store 3 bits of data, has a high storage density, and can provide large-capacity storage space at a low cost. It is suitable for storing common user data, such as documents, pictures, videos and other large amounts of non-critical data; Dynamic storage technology can dynamically adjust and optimize the storage location of data in the TLC flash memory chip based on factors such as data access frequency and storage time. For example, frequently accessed data can be migrated to storage areas with relatively fast read and write speeds, and infrequently used data can be stored in later locations, thereby improving the overall utilization of storage space and further optimizing storage performance based on large-capacity storage.

[0027] In an embodiment of the present invention, in the data preprocessing step, the high-strength encryption algorithm is the AES (Advanced Encryption Standard) algorithm, and the encryption key is generated and managed by a hardware encryption module to ensure the security of the key; the data compression algorithm adopts an adaptive lossless compression algorithm, which can automatically select the best compression algorithm and parameters according to the type and content of the data.

[0028] AES is a symmetric encryption algorithm designed based on mathematical permutation and substitution operations. It converts plaintext into ciphertext by performing multiple complex transformations on data. In SSD data storage, the AES algorithm is used to encrypt key system data, such as confidential files and user authentication information, which can effectively prevent unauthorized access and theft of data during storage. The hardware encryption module uses a dedicated encryption chip or circuit to generate encryption keys through a secure random number generation algorithm. Compared with software-generated keys, the hardware encryption module has higher security because it is independent of the operating system and other software environments and is not easily affected by software vulnerabilities, malware attacks or operating system failures. At the same time, the hardware encryption module strictly manages the storage, use and update process of the key to ensure the confidentiality, integrity and availability of the key, further enhancing the security of the encryption system; The adaptive lossless compression algorithm first analyzes the type of application data (such as text, image, audio, video, etc.) and specific content characteristics. Different types of data have different redundancy patterns and compressibility. For example, text data may contain a large number of repeated words, phrases, or character sequences, and image data may have similar color areas or pixel patterns. According to the data type and content analysis results, the algorithm automatically selects the most suitable compression algorithm from a predefined library of multiple lossless compression algorithms and dynamically adjusts the compression parameters. For example, for text data, a dictionary-based compression algorithm (such as LZ77, LZ78, etc.) may be selected, and parameters such as the dictionary size and matching length may be adjusted according to the degree of repetitiveness of the text; for image data, a compression algorithm based on predictive coding or transform coding (such as the prediction method and discrete cosine transform in the PNG lossless compression algorithm) is selected, and parameters such as the quantization step size and encoding method are adjusted according to the image's resolution, color depth and other characteristics to achieve the best compression effect.

[0029] In an embodiment of the present invention, in the data writing and address mapping steps, the dynamic address mapping mechanism adopts a hybrid mapping method, combining the advantages of page-level mapping and block-level mapping. Page-level mapping is used for small data blocks to improve space utilization, and block-level mapping is used for large data blocks to improve writing performance; and the address conversion table adopts a distributed storage structure and is stored in multiple independent storage units to improve the efficiency and reliability of address conversion.

[0030] Page-level mapping divides the storage space of SSD into pages of fixed size, usually several KB to tens of KB. For small data blocks (such as small files in the file system, metadata records in the database, etc.), address mapping is performed in pages. When writing small data blocks, the data is stored in the corresponding page, and the storage location of the data is recorded through the mapping relationship between the logical page number and the physical page number. This method can make full use of the storage space, avoid the fragmentation and waste of storage space caused by too small data blocks, and improve space utilization; Block-level mapping divides the storage space into larger blocks, usually from several hundred KB to several MB. For large data blocks (such as large video files, table data in databases, etc.), block-level mapping is used. When writing large data blocks, the entire data block is stored in continuous physical blocks, which reduces the seek time and address conversion times when writing data, thereby improving the writing performance. Since the continuous storage requirements of large data blocks are high, block-level mapping can better meet this requirement and improve the efficiency of data writing; By judging the size of data blocks, page-level mapping or block-level mapping is dynamically selected to give full play to the advantages of both. In the actual storage process, according to the characteristics of the data and application scenarios, the most appropriate mapping method is flexibly allocated to data blocks of different sizes to achieve a balance between space utilization and write performance; The address translation table is divided into multiple parts and stored in multiple independent storage units inside the SSD. These storage units can be different flash chip areas or special storage modules. Each storage unit is responsible for storing a part of the address translation information. For example, the address translation table is divided according to a certain logical range (such as a specific address segment, data type or storage area), and then the parts are distributed and stored; This distributed storage structure can reduce the single access time of the address translation table, because multiple storage units can respond to address query requests in parallel, improving the efficiency of address translation. At the same time, since the data of the address translation table is stored in a decentralized manner, even if a storage unit fails, it will not cause the failure of the entire address translation table. Other storage units can still continue to provide partial address translation information, thereby improving the reliability of the address translation table and the stability of the entire SSD storage system.

[0031] In an embodiment of the present invention, in the data storage management step, the storage area dynamic adjustment mechanism adopts an intelligent decision-making algorithm to comprehensively consider the data access frequency, performance differences in storage areas, data correlation and the overall load of the SSD to determine the optimal data migration plan, and during the data migration process, an incremental data migration method is adopted to reduce the impact on the normal read and write operations of the SSD.

[0032] By collecting statistics and analyzing the access records of data over a period of time, frequently accessed data and data that has not been accessed for a long time can be identified. For example, a counter or timestamp can be used to record the most recent access time and access count of each data block, and data with high access frequency can be considered "hot data", while data with low access frequency can be considered "cold data"; Different storage areas have different performance characteristics. For example, the core storage area is fast but expensive, while the large-capacity storage area has large capacity but relatively slow read and write speeds. When formulating a migration strategy, the algorithm will determine whether the data is in the storage area that best suits its performance requirements based on the importance and performance requirements of the data and the performance parameters of each area. Analyze the logical relationship and correlation between data. For example, in database applications, if there are related queries between certain table data, store related data in adjacent or the same storage area as much as possible to reduce cross-area access when reading data and improve query efficiency. Real-time monitoring of various SSD performance indicators, such as read and write bandwidth, IOPS (input and output operations per second), queue depth, etc., to understand the current workload status of the SSD. When the overall load is high, the timing and scale of data migration will be carefully selected to avoid excessively increasing the system burden; when the load is low, the data migration process can be appropriately accelerated to optimize the storage layout; Divide the data to be migrated into smaller blocks and migrate them in a certain order and batches. For example, select a certain number of blocks to copy from the source storage area to the target storage area each time instead of migrating a large amount of data at one time. The data migration process is carried out in the background of the normal read and write operations of the SSD, using the idle time slices of the system to perform the migration task. By combining with the scheduling mechanism of the operating system, it ensures that the migration operation does not preempt the resources of normal read and write operations, avoiding significant delays in ongoing user data read and write requests.

[0033] In an embodiment of the present invention, in the data reading step, the cache area adopts a multi-level cache architecture, including a first-level cache and a second-level large-capacity cache, wherein the first-level cache adopts a static random access memory (SRAM) for storing the most commonly used data and instructions, and the second-level large-capacity cache adopts a dynamic random access memory (DRAM) for expanding the cache capacity, and the cache area is connected to the main control chip of the SSD using a high-speed data bus to increase the data transmission speed.

[0034] SRAM has the characteristics of high-speed reading and writing and low latency, and is very suitable for storing the most commonly used data and instructions. Based on the principle of locality of data access, that is, the program will frequently access certain specific data and instructions in a short period of time, these hot data and instructions are stored in the first-level cache, which can respond to CPU requests at an extremely fast speed. For example, during the operation of the operating system kernel, frequently called system functions and key data structures can be stored in the first-level cache. When these data are needed again, they can be directly obtained from the first-level cache without having to read from the relatively slow SSD storage medium or the second-level cache, which greatly improves the data access speed; Although DRAM has a slower read and write speed than SRAM, it has the advantages of low cost and large storage capacity. The L2 large-capacity cache is used to supplement the L1 cache to expand the overall capacity of the cache and store data and instructions that are not the most frequently accessed but still have a certain access probability. When the L1 cache misses, the data can be found from the L2 cache, thereby reducing the number of direct accesses to the SSD storage medium. For example, in a multi-tasking environment, some commonly used data and code segments generated by multiple applications running can be stored in the L2 cache to meet the system's demand for cache capacity. The cache area is connected to the main control chip of the SSD with a high-speed data bus, which ensures that data can be transmitted at a high rate between the cache and the main control chip. The high-speed data bus has a high bandwidth and low transmission delay, and can quickly read data from the cache and transmit it to the main control chip for subsequent processing, or quickly write data read from the SSD storage medium to the cache, giving full play to the role of the cache and avoiding the impact of data transmission bottlenecks on cache performance.

[0035] In an embodiment of the present invention, a data aging management step is also included: regularly performing aging analysis on the stored data, marking data that has not been accessed for a long time as aged data based on the last access time of the data and a preset aging cycle, and for the aged data, choosing to migrate it to a storage medium with a lower cost or directly delete it based on its data type and usage of the storage area, so as to free up storage space and optimize the storage performance of the SSD.

[0036] By recording the last access time of each data block and combining it with the preset aging cycle parameters, the system can monitor the activity of the data. For example, in the data storage management system, a timestamp is maintained for each data block. Whenever the data is accessed, the timestamp is updated. These timestamps are scanned regularly (such as weekly or monthly) to filter out the data that has not been accessed for more than the aging cycle and further processed as potential aging data; After determining the aging data, its data type and the usage of the current storage area will be comprehensively considered. Different data types have different requirements for storage performance and security, so the processing methods are also different. For example, for some outdated common user data (such as old versions of documents, cached web page images, etc.), if the storage area where they are located has tight capacity and the performance requirements of this data are not high, they will be given priority for migration or deletion; while for some data that has not been accessed for a long time but belongs to the key data type of the system, a more cautious processing method is adopted, such as further evaluating its potential value before making a decision; When deciding to migrate aging data, a choice is made based on the characteristics and availability of the target storage medium. For example, a low-cost, large-capacity storage medium specifically used for storing infrequently accessed data (such as a large-capacity mechanical hard disk or a specific low-performance flash memory area) is used as an auxiliary storage medium. Migrating aging data to these areas can reduce storage costs while ensuring data availability, while freeing up valuable high-performance storage space in the SSD to meet the storage needs of data with higher performance requirements.

[0037] For some aged data that is determined to be no longer valuable or has been backed up, the deletion operation will be directly performed to immediately reclaim the storage space. Before executing the deletion operation, it will be ensured that the relevant data references and dependencies have been properly handled to avoid system errors or data loss caused by the deletion operation. At the same time, the deletion operation will also follow certain security specifications, such as completely erasing sensitive data to prevent information leakage caused by data recovery.

[0038] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.

Claims

1. A method for storing data in an SSD solid state hard disk, characterized in that: The following steps are involved: Data receiving and classification step: receiving data to be stored from the host system, classifying the data into system key data, application data and user common data based on a predefined data feature library through a data identification module, wherein the predefined data feature library contains typical file formats, data header information and access frequency feature information of each type of data; Storage area planning step: according to the internal architecture of the SSD solid state drive, the SSD is divided into multiple storage areas, including at least one high-speed and high-reliability core storage area for storing key system data, multiple medium-performance storage areas for storing application data, and a large-capacity storage area for storing common user data. At the same time, an independent wear leveling management unit and a bad block management unit are established for each storage area; Data preprocessing steps: Different preprocessing operations are performed for different types of data. For system key data, a high-strength encryption algorithm is used for encryption processing, and a digital signature is added to ensure the integrity and authenticity of the data; for application data, data compression is performed to reduce storage space usage, and a checksum is generated by a cyclic redundancy check (CRC) algorithm and attached to the end of the data; for user ordinary data, simple error detection and correction coding (ECC) processing is performed; Data writing and address mapping step: writing the preprocessed data into the corresponding storage area according to the data type. In the writing process, a dynamic address mapping mechanism is used to assign a logical address to each data block, and the logical address is mapped to a physical address through an address conversion table, wherein the address conversion table is optimized and updated according to the access frequency and writing order of the data. For frequently accessed data, its logical address is mapped to a storage unit with a continuous physical address to improve the data reading speed; Data storage management steps: During the data storage process, the usage, performance indicators and number of bad blocks of each storage area are monitored in real time. When the remaining space of a storage area is lower than the preset threshold or the bad block ratio exceeds the safety threshold, the dynamic adjustment mechanism of the storage area is started to migrate some low-priority data to other suitable storage areas and update the address mapping information. At the same time, the integrity check and backup operations of the stored data are performed regularly. For the damaged data detected, it is restored from the backup or repaired according to the redundant information. Data reading steps: when receiving a data reading request from the host system, first query the cache area, if the cache hits, directly read the data from the cache and return it to the host system; if the cache misses, read the data from the corresponding storage area according to the data type and address mapping information, and before returning the data to the host system, perform corresponding decryption, decompression or error correction operations according to the data preprocessing method, and load the read data into the cache area at the same time, and use the LRU algorithm to update the data arrangement order in the cache area. The LRU algorithm is implemented by maintaining a data access sequence linked list, and the newly accessed data is inserted at the head of the linked list. When the cache area is full and new data needs to be inserted, the data at the end of the linked list is deleted.

2. The method for storing data in an SSD solid state hard disk according to claim 1, characterized in that: In the data receiving and classification step, the data identification module adopts a classification algorithm based on machine learning, continuously optimizes the accuracy of data classification by learning and analyzing historical data, and can automatically adapt to new data types and feature changes.

3. The SSD solid state hard disk data storage method according to claim 1, characterized in that: In the storage area planning step, the core storage area is constructed using enterprise-level SLC (Single-Level Cell) flash memory chips, which have power-off protection function and redundant power supply design to ensure the security and reliability of key system data; the medium-performance storage area is constructed by combining MLC (Multi-Level Cell) flash memory chips with cache to balance performance and cost; the large-capacity storage area uses TLC (Triple-Level Cell) flash memory chips and optimizes storage space utilization through dynamic storage technology.

4. The method for storing data in an SSD solid state drive according to claim 1, wherein: In the data preprocessing step, the high-strength encryption algorithm is the AES (Advanced Encryption Standard) algorithm, and the encryption key is generated and managed by a hardware encryption module to ensure the security of the key; the data compression algorithm adopts an adaptive lossless compression algorithm, which can automatically select the best compression algorithm and parameters according to the type and content of the data.

5. The method for storing data in an SSD solid state hard disk according to claim 1, characterized in that: In the data writing and address mapping steps, the dynamic address mapping mechanism adopts a hybrid mapping method, combining the advantages of page-level mapping and block-level mapping. Page-level mapping is used for small data blocks to improve space utilization, and block-level mapping is used for large data blocks to improve writing performance; and the address conversion table adopts a distributed storage structure and is stored in multiple independent storage units to improve the efficiency and reliability of address conversion.

6. The SSD solid state hard disk data storage method according to claim 1, characterized in that: In the data storage management step, the storage area dynamic adjustment mechanism adopts an intelligent decision-making algorithm to comprehensively consider the data access frequency, performance differences in storage areas, data correlation and the overall load of the SSD to determine the optimal data migration plan. During the data migration process, an incremental data migration method is adopted to reduce the impact on the normal read and write operations of the SSD.

7. The SSD solid state hard disk data storage method according to claim 1, characterized in that: In the data reading step, the cache area adopts a multi-level cache architecture, including a first-level cache and a second-level large-capacity cache, wherein the first-level cache adopts a static random access memory (SRAM) for storing the most commonly used data and instructions, and the second-level large-capacity cache adopts a dynamic random access memory (DRAM) for expanding the cache capacity, and the cache area is connected to the main control chip of the SSD using a high-speed data bus to increase the data transmission speed.

8. The method for storing data in an SSD solid state hard disk according to claim 1, characterized in that: It also includes data aging management steps: regularly perform aging analysis on stored data, mark data that has not been accessed for a long time as aged data based on the last access time of the data and the preset aging cycle, and choose to migrate the aged data to lower-cost storage media or delete it directly based on its data type and storage area usage to free up storage space and optimize the storage performance of the SSD.

Citation Information

Cited By

  • Secure storage method and device for flash memory data, electronic equipment and storage medium

    CN120803370A

  • Solid state disk management system

    CN121050658A

  • Data format self-recognition verification method for solid state disk

    CN122240385A

  • A data format self-recognition checking method for a solid state disk

    CN122240385B

  • Compression algorithm type identification method and test equipment

    CN122451397A