Data storage method, device, system and computer-readable storage medium
By detecting cache instructions and obtaining relevant information in the cache chip of the solid-state drive, cache application layer data into the cache chip, and expanding the data transmission protocol, the problem that the solid-state drive cache chip cannot be used to cache host application layer data is solved, and the effect of increasing host memory and reducing usage costs is achieved.
Patent Information
- Application Number
- CN202111593929.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-12-23
AI Technical Summary
The cache chips in the solid-state drive cannot be used to cache data from the host application layer, resulting in waste of resources and increased usage costs.
By obtaining application layer data information, host memory usage information and data transmission protocol of the cache chip when detecting cache instructions, the application layer data is cached in the cache chip based on these information, and the cache chip can process data of different data transmission protocols by extending the data transmission protocol.
It increases the memory capacity of the host, reduces the waste of solid-state drive resources, and reduces the cost of use.
Smart Images

Figure CN114356799B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a data storage method, apparatus, system and computer-readable storage medium. Background Art
[0002] At present, the cache chips in solid-state drives can only read and write data that needs to be stored in the solid-state drives, and cannot be used to cache data in the host application layer. When more memory is needed to cache data in the host application layer, only the memory of the host can be replaced, and the cache chips in the solid-state drive cannot be used to increase the memory of the host, which results in waste of resources and increased usage costs. Therefore, how to increase the memory of the host, reduce waste of solid-state drive resources and lower usage costs is an urgent problem to be solved. Summary of the Invention
[0003] The main object of the present invention is to provide a data storage method, apparatus, system and computer-readable storage medium, aiming to solve the problem of how to increase the memory of the host, reduce waste of solid-state drive resources and lower usage costs.
[0004] To achieve the above object, the present invention provides a data storage method, which includes the following steps:
[0005] When a cache instruction is detected, obtain the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtain the data transfer protocol corresponding to the cache chip in the host solid-state drive;
[0006] Based on the application layer data information, the usage information and the data transfer protocol, cache the application layer data information in the cache chip.
[0007] Preferably, before the step of, when a cache instruction is detected, obtaining the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtaining the data transfer protocol corresponding to the cache chip in the host solid-state drive, the data storage method further includes:
[0008] Obtain the life information of the host solid-state drive;
[0009] Based on the life information, expand the data transfer protocol of the cache chip of the host solid-state drive, so that the cache chip can cache data with different data transfer protocols.
[0010] Preferably, the step of, based on the life information, expanding the data transfer protocol of the cache chip of the host solid-state drive includes:
[0011] Based on the life information, determine whether the host solid-state drive has reached the end of its life;
[0012] If it is determined that the host solid-state drive has reached the end of its life, the data transfer protocol of the cache chip of the host solid-state drive is automatically extended, or when a setting instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the setting instruction;
[0013] If it is determined that the host solid-state drive has not reached the end of its life, when a setting instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the setting instruction.
[0014] Preferably, the step of extending the data transfer protocol of the cache chip of the host solid-state drive includes:
[0015] Obtain the data transfer protocol of the host memory, and add the data transfer protocol of the host memory to the data transfer protocol of the cache chip of the host solid-state drive to extend the data transfer protocol of the cache chip of the host solid-state drive.
[0016] Preferably, the step of caching the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transfer protocol includes:
[0017] Determine the memory capacity required by the application layer data information, determine the remaining memory capacity of the host memory according to the usage information, and compare the memory capacity with the remaining memory capacity;
[0018] If the memory capacity is greater than the remaining memory capacity, it is determined to call the cache chip, and the application layer data information is cached in the cache chip according to the data transfer protocol.
[0019] Preferably, after the step of comparing the memory capacity with the remaining memory capacity, the data storage method further includes:
[0020] If the memory capacity is less than the remaining memory capacity, obtain the first memory capacity threshold of the host memory, and compare the remaining memory capacity with the first memory capacity threshold;
[0021] If the remaining memory capacity is less than the first memory capacity threshold, it is determined to call the cache chip, and the application layer data information is cached in the cache chip according to the data transfer protocol.
[0022] Preferably, the step of caching the application layer data information in the cache chip according to the data transfer protocol includes:
[0023] Detect whether the host solid-state drive has reached the end of its life;
[0024] If the host solid-state drive has reached the end of its life, the application layer data information is cached in the cache chip according to the data transmission protocol;
[0025] If the host solid-state drive has not reached the end of its life, a second memory capacity threshold is obtained, and the application layer data information is cached in the cache chip according to the data transmission protocol and the second memory capacity threshold.
[0026] In addition, to achieve the above object, the present invention further provides a data storage device, and the data storage device includes:
[0027] A detection module, configured to, when detecting a cache instruction, obtain the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtain the data transmission protocol corresponding to the cache chip in the host solid-state drive;
[0028] A cache module, configured to cache the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transmission protocol.
[0029] Further, the detection module further includes an acquisition module, and the acquisition module is configured to:
[0030] Obtain the life information of the host solid-state drive;
[0031] Based on the life information, expand the data transmission protocol of the cache chip of the host solid-state drive so that the cache chip can cache data of different data transmission protocols.
[0032] Further, the detection module further includes a determination module, and the determination module is configured to:
[0033] Based on the life information, determine whether the host solid-state drive has reached the end of its life;
[0034] If it is determined that the host solid-state drive has reached the end of its life, automatically expand the data transmission protocol of the cache chip of the host solid-state drive, or when receiving a set instruction, obtain the data transmission protocol of the cache chip in the host solid-state drive, and expand the data transmission protocol according to the set instruction;
[0035] If it is determined that the host solid-state drive has not reached the end of its life, when receiving a set instruction, obtain the data transmission protocol of the cache chip in the host solid-state drive, and expand the data transmission protocol according to the set instruction.
[0036] Further, the detection module further includes an expansion module, and the expansion module is configured to:
[0037] A data transfer protocol for obtaining data from the host memory is added to the data transfer protocol of the cache chip of the host solid-state drive to expand the data transfer protocol of the cache chip of the host solid-state drive.
[0038] Further, the cache module is further configured to:
[0039] Determine the memory capacity required by the application layer data information, determine the remaining memory capacity of the host memory according to the usage information, and compare the memory capacity with the remaining memory capacity;
[0040] If the memory capacity is greater than the remaining memory capacity, determine to call the cache chip and cache the application layer data information in the cache chip according to the data transfer protocol.
[0041] Further, the cache module is further configured to:
[0042] If the memory capacity is less than the remaining memory capacity, obtain a first memory capacity threshold of the host memory and compare the remaining memory capacity with the first memory capacity threshold;
[0043] If the remaining memory capacity is less than the first memory capacity threshold, determine to call the cache chip and cache the application layer data information in the cache chip according to the data transfer protocol.
[0044] Further, the cache module is further configured to:
[0045] Detect whether the host solid-state drive has reached the end of its life;
[0046] If the host solid-state drive has reached the end of its life, cache the application layer data information in the cache chip according to the data transfer protocol;
[0047] If the host solid-state drive has not reached the end of its life, obtain a second memory capacity threshold and cache the application layer data information in the cache chip according to the data transfer protocol and the second memory capacity threshold.
[0048] In addition, to achieve the above object, the present invention further provides a data storage system, which includes: a memory, a processor, and a data storage program stored on the memory and executable on the processor. When the data storage program is executed by the processor, the steps of the data storage method described above are implemented.
[0049] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium. The readable storage medium is a computer-readable storage medium, and a data storage program is stored on the readable storage medium. When the data storage program is executed by a processor, the steps of the data storage method described above are implemented.
[0050] In the data storage method proposed by the present invention, when a cache instruction is detected, application layer data information corresponding to the cache instruction and usage information of the host memory are obtained, and a data transmission protocol corresponding to a cache chip in the host solid-state drive is obtained; based on the application layer data information, the usage information, and the data transmission protocol, the application layer data information is cached in the cache chip; the present invention caches the application layer data information in the cache chip based on the application layer data information, the usage information of the host memory, and the data transmission protocol corresponding to the cache chip in the host solid-state drive, so that the application layer data can be cached in the cache chip of the host solid-state drive, thereby improving the memory of the host, reducing waste of resources, and reducing usage costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment solution of the present invention;
[0052] Figure 2 is a schematic flowchart of the first embodiment of the data storage method of the present invention.
[0053] The implementation, functional features, and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] As Figure 1 shown, Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment solution of the present invention.
[0056] The device in the embodiment of the present invention may be a PC or a server device.
[0057] As Figure 1As shown in the figure, the device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to implement the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0058] Those skilled in the art can understand that Figure 1 the device structure shown in the figure does not constitute a limitation on the device, and it may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0059] As Figure 1 shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a data storage program.
[0060] Among them, the operating system is a program for managing and controlling the portable storage device and software resources, and supports the operation of the network communication module, the user interface module, the data storage program, and other programs or software; the network communication module is used to manage and control the network interface 1002; the user interface module is used to manage and control the user interface 1003.
[0061] In Figure 1 the storage device shown, the storage device calls the data storage program stored in the memory 1005 through the processor 1001 and executes the operations in each embodiment of the following data storage method.
[0062] Based on the above hardware structure, an embodiment of the data storage method of the present invention is proposed.
[0063] Referring to Figure 2 , Figure 2 which is a schematic flowchart of the first embodiment of the data storage method of the present invention, the method includes:
[0064] Step S10, when a cache instruction is detected, obtain the application layer data information and the usage information of the host memory corresponding to the cache instruction, and obtain the data transfer protocol corresponding to the cache chip in the host solid-state drive;
[0065] Step S20: Based on the application layer data information, the usage information, and the data transmission protocol, cache the application layer data information in the cache chip.
[0066] The data storage method of this embodiment is applied to an intelligent host device, which can be a PC, a mobile phone, a mobile terminal, etc.; the intelligent host device includes, but is not limited to, a memory chip and a solid-state drive, and the solid-state drive includes, but is not limited to, a cache chip; for the convenience of description, the host is taken as an example for description; when the host detects a cache instruction, it obtains the application layer data information corresponding to the cache instruction and the usage information of the host's memory chip, and obtains the data transmission protocol corresponding to the cache chip in the host's solid-state drive; the host determines the memory capacity required by the application layer data information, determines the remaining memory capacity of the host's memory chip according to the usage information, and compares the memory capacity with the remaining memory capacity; if the host obtains a comparison result that the memory capacity is greater than the remaining memory capacity, it determines to call the cache chip and detects whether the host's solid-state drive has reached the end of its life; if the host detects that the host's solid-state drive has reached the end of its life, it caches the application layer data information in the cache chip according to the data transmission protocol; if the host detects that the host's solid-state drive has not reached the end of its life, it obtains a second memory capacity threshold and caches the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold. It should be noted that generally, the cache chip in the host's solid-state drive cannot cache the application layer data information. In the present invention, by expanding the data transmission protocol corresponding to the cache chip in the solid-state drive, the cache chip in the host's solid-state drive can cache the application layer data information.
[0067] The data storage method of this embodiment, when detecting a cache instruction, obtains the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtains the data transmission protocol corresponding to the cache chip in the host solid-state drive; based on the application layer data information, the usage information, and the data transmission protocol, cache the application layer data information in the cache chip; the present invention caches the application layer data information in the cache chip based on the application layer data information, the usage information of the host memory, and the data transmission protocol corresponding to the cache chip in the host solid-state drive, so that the application layer data can be cached in the cache chip of the host solid-state drive, thereby improving the memory of the host and reducing the waste of solid-state drive resources and the usage cost.
[0068] The following will explain each step in detail:
[0069] Step S10: When detecting a cache instruction, obtain the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtain the data transmission protocol corresponding to the cache chip in the host solid-state drive;
[0070] In this embodiment, when the user uses the host operating system or an application program, a lot of application layer data information that needs to be cached in the memory chip of the host will be generated. Correspondingly, cache instructions will be generated. When the host detects the cache instructions, it obtains the application layer data information corresponding to the cache instructions, obtains the usage information of the host's memory chip, and obtains the data transfer protocol corresponding to the cache chip in the host's solid-state drive.
[0071] Step S20: Based on the application layer data information, the usage information, and the data transfer protocol, cache the application layer data information in the cache chip.
[0072] In this embodiment, after the host obtains the application layer data information, the usage information of the memory chip, and the data transfer protocol corresponding to the cache chip, the host caches the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transfer protocol. Optionally, the host can also cache the application layer data information on the memory chip of the host based on the application layer data information and the usage information.
[0073] Specifically, step S20 includes:
[0074] Step a: Determine the memory capacity required by the application layer data information, determine the remaining memory capacity of the host memory according to the usage information, and compare the memory capacity with the remaining memory capacity.
[0075] In this step, after the host obtains the application layer data information, the usage information of the memory chip, and the data transfer protocol corresponding to the cache chip, it determines the memory capacity required by the application layer data according to the application layer data information, determines the remaining memory capacity of the host's memory chip according to the usage information of the memory chip, and compares the memory capacity required by the application layer data with the remaining memory capacity of the memory chip.
[0076] Step b: If the memory capacity is greater than the remaining memory capacity, determine to call the cache chip, and cache the application layer data information in the cache chip according to the data transfer protocol.
[0077] In this step, the host compares the memory capacity required by the application layer data with the remaining memory capacity of the memory chip. If the comparison result shows that the memory capacity required by the application layer data is greater than the remaining memory capacity of the memory chip, it is determined to call the cache chip, and the application layer data information is cached in the cache chip according to the data transmission protocol. For example, if the host determines that the memory capacity required by the application layer data is 1GB and the remaining memory capacity of the memory chip is 0.8GB, the host compares the memory capacity required by the application layer data with the remaining memory capacity of the memory chip, and the comparison result shows that the memory capacity required by the application layer data is greater than the remaining memory capacity of the memory chip. Therefore, it is determined that the cache chip in the solid-state drive needs to be called as memory, and the application layer data information is cached in the cache chip according to the data transmission protocol of the cache chip.
[0078] Furthermore, the host can also cache a part of the application layer data in the memory chip of the host and a part in the cache chip of the solid-state drive to reasonably use the memory capacities of the memory chip and the cache chip.
[0079] Furthermore, after the step of comparing the memory capacity with the remaining memory capacity, it includes:
[0080] Step c, if the memory capacity is less than the remaining memory capacity, obtain the first memory capacity threshold of the host memory, and compare the remaining memory capacity with the first memory capacity threshold;
[0081] In this step, the host compares the memory capacity required by the application layer data with the remaining memory capacity of the memory chip. If the comparison result shows that the memory capacity required by the application layer data is less than the remaining memory capacity of the memory chip, obtain the first memory capacity threshold corresponding to the memory chip of the host, and compare the remaining memory capacity of the memory chip with the first memory capacity threshold.
[0082] Step d, if the remaining memory capacity is less than the first memory capacity threshold, determine to call the cache chip, and cache the application layer data information in the cache chip according to the data transmission protocol.
[0083] In this step, if the host obtains a comparison result that the remaining memory capacity of the memory chip is less than the first memory capacity threshold, it determines to call the cache chip and caches the application layer data information in the cache chip according to the data transmission protocol. For example, if the host determines that the remaining memory capacity of the memory chip is 1 GB and the first memory capacity threshold of the memory chip is 1.5 GB, the host compares the remaining memory capacity of the memory chip with the first memory capacity threshold and obtains a comparison result that the remaining memory capacity of the memory chip is less than the first memory capacity threshold. Therefore, it determines that it is necessary to call the cache chip in the solid-state drive as memory and caches the application layer data information in the cache chip according to the data transmission protocol of the cache chip. It should be noted that since the memory chip needs to cache the data of the host operating system during operation, it is necessary to set the first memory capacity threshold, thereby reserving part of the memory capacity of the memory chip for emergencies and ensuring the operation of the host operating system.
[0084] Further, the step of caching the application layer data information in the cache chip according to the data transmission protocol includes:
[0085] Step e, detecting whether the host solid-state drive is at the end of its life;
[0086] In this step, when the host determines to call the cache chip, it detects whether the host solid-state drive is at the end of its life. It should be noted that when the host solid-state drive is at the end of its life, the function of the cache chip is still normal, but only the flash memory life in the solid-state drive has ended.
[0087] Step f, if the host solid-state drive has reached the end of its life, cache the application layer data information in the cache chip according to the data transmission protocol;
[0088] In this step, if the host detects that the solid-state drive has reached the end of its life, it caches the application layer data information in the cache chip according to the data transmission protocol of the cache chip.
[0089] Step g, if the host solid-state drive has not reached the end of its life, obtain the second memory capacity threshold, and cache the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold.
[0090] In this step, if the host detects that the solid-state drive has not reached the end of its life, it obtains the second memory capacity threshold of the cache chip, and caches the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold. For example, the memory capacity of the cache chip is 16GB, and the second memory capacity threshold of the cache chip is 5GB. If the host detects that the solid-state drive has not reached the end of its life and needs to call the cache chip, at this time, according to the second memory capacity threshold of 5GB, it is determined that the memory capacity that can be called by the host as memory in the cache chip is 11GB, and then the application layer data information is cached in the cache chip according to the data transmission protocol. It should be noted that since the solid-state drive has not reached the end of its life, the solid-state drive still needs to store the data that the host needs to store. At this time, the cache chip in the solid-state drive needs to be used, so the second memory capacity threshold is set to ensure the normal operation of the solid-state drive.
[0091] When the host in this embodiment detects a cache instruction, it obtains the application layer data information corresponding to the cache instruction and the usage information of the host's memory chip, and obtains the data transmission protocol corresponding to the cache chip in the host's solid-state drive; the host determines the memory capacity required by the application layer data information, determines the remaining memory capacity of the host's memory chip according to the usage information, and compares the memory capacity with the remaining memory capacity; if the host obtains a comparison result that the memory capacity is greater than the remaining memory capacity, it determines to call the cache chip and detects whether the host's solid-state drive has reached the end of its life; if the host detects that the host's solid-state drive has reached the end of its life, it caches the application layer data information in the cache chip according to the data transmission protocol; if the host detects that the host's solid-state drive has not reached the end of its life, it obtains the second memory capacity threshold, and caches the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold. This enables the application layer data to be cached in the cache chip of the host's solid-state drive, thereby reducing resource waste and lowering usage costs.
[0092] Furthermore, based on the first embodiment of the data storage method of the present invention, a second embodiment of the data storage method of the present invention is proposed.
[0093] The difference between the second embodiment of the data storage method and the first embodiment of the data storage method is that before step S10, the data storage method further includes:
[0094] Step h, obtaining the life information of the host's solid-state drive;
[0095] Step i, based on the life information, expanding the data transmission protocol of the cache chip of the host's solid-state drive so that the cache chip can cache data with different data transmission protocols.
[0096] In this embodiment, the host obtains the lifespan information of the solid-state drive of the host, and based on the lifespan information, determines whether the solid-state drive of the host has reached the end of its life; if it is determined that the solid-state drive of the host has reached the end of its life, the data transfer protocol of the cache chip of the host solid-state drive is automatically extended, or when a set instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the set instruction; if it is determined that the solid-state drive of the host has not reached the end of its life, when a set instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the set instruction. By extending the data transfer protocol of the cache chip, the cache chip can be used by the host to cache application layer data information, thereby improving the memory of the host.
[0097] The following is a detailed description of each step:
[0098] Step h, obtaining the lifespan information of the host solid-state drive;
[0099] In this embodiment, the host obtains the lifespan information of the solid-state drive of the host when receiving a detection instruction from the user or according to a preset period.
[0100] Step i, based on the lifespan information, extending the data transfer protocol of the cache chip of the host solid-state drive so that the cache chip can cache data with different data transfer protocols.
[0101] In this embodiment, the host determines whether the solid-state drive has reached the end of its life based on the lifespan information of the solid-state drive, and then automatically extends the data transfer protocol of the cache chip of the host solid-state drive, or when a set instruction is received, obtains the data transfer protocol of the cache chip in the host solid-state drive, and extends the data transfer protocol according to the set instruction.
[0102] Specifically, step i includes:
[0103] Step i1, based on the lifespan information, determining whether the host solid-state drive has reached the end of its life;
[0104] In this step, the host determines whether the solid-state drive has reached the end of its life based on the lifespan information of the solid-state drive. For example, the host determines whether the flash chip in the solid-state drive has reached the end of its life according to the lifespan information of the solid-state drive. If it is determined that the flash chip in the solid-state drive has reached the end of its life, it is further determined that the solid-state drive has reached the end of its life. If it is determined that the flash chip in the solid-state drive has not reached the end of its life, it is further determined that the solid-state drive has not reached the end of its life.
[0105] Step i2, if it is determined that the host solid-state drive has reached the end of its life, automatically extending the data transfer protocol of the cache chip of the host solid-state drive, or when a set instruction is received, obtaining the data transfer protocol of the cache chip in the host solid-state drive, and extending the data transfer protocol according to the set instruction;
[0106] In this step, if the host determines that the host solid-state drive has reached the end of its life, it automatically expands the data transfer protocol of the cache chip of the host solid-state drive, or when receiving a setting instruction, obtains the data transfer protocol of the cache chip in the host solid-state drive and expands the data transfer protocol according to the setting instruction. For example, if the host determines that the host solid-state drive has reached the end of its life, at this time, the host can automatically expand the data transfer protocol of the cache chip of the solid-state drive according to its own needs, so that the storage chip can be used by the host to cache application layer data information, thereby improving the memory of the host. Or, the host displays a prompt message on the display screen "The solid-state drive has reached the end of its life. Do you want to use the cache chip as the host memory?" When the user selects to use the cache chip as the host memory, the host generates a setting instruction according to the user's selection, obtains the data transfer protocol of the cache chip in the host solid-state drive, and expands the data transfer protocol according to the setting instruction.
[0107] Step i3, if it is determined that the host solid-state drive has not reached the end of its life, when receiving a setting instruction, obtain the data transfer protocol of the cache chip in the host solid-state drive and expand the data transfer protocol according to the setting instruction.
[0108] In this step, if the host determines that the host solid-state drive has not reached the end of its life, when receiving a setting instruction, obtain the data transfer protocol of the cache chip in the host solid-state drive and expand the data transfer protocol according to the setting instruction. For example, if the host determines that the host solid-state drive has not reached the end of its life, it will not automatically expand the data transfer protocol of the cache chip of the solid-state drive. When the user needs to improve the host memory, the user will input a setting instruction to the host, or when the host needs more memory capacity to cache application layer data information, it will prompt the user to select to use the cache chip as the host memory, obtain the setting instruction input by the user, and when receiving the setting instruction, obtain the data transfer protocol of the cache chip in the host solid-state drive and expand the data transfer protocol according to the setting instruction.
[0109] Further, the step of expanding the data transfer protocol of the cache chip of the host solid-state drive includes:
[0110] Step j, obtain the data transfer protocol of the host memory, and add the data transfer protocol of the host memory to the data transfer protocol of the cache chip of the host solid-state drive to expand the data transfer protocol of the cache chip of the host solid-state drive.
[0111] In this step, since the cache chip can only cache data in the solid-state drive, that is, the data transfer protocol corresponding to the cache chip is only applicable to the solid-state drive. When the cache chip needs to be used as the host memory, the host obtains the data transfer protocol corresponding to the memory chip of the host and adds the data transfer protocol of the memory chip to the data transfer protocol of the cache chip of the solid-state drive to expand the data transfer protocol of the cache chip of the host solid-state drive, so that the cache chip can be used by the host to cache application layer data information, thereby improving the host memory.
[0112] In this embodiment, the host obtains the lifespan information of the host solid-state drive and determines whether the host solid-state drive has reached the end of its lifespan based on the lifespan information. If it is determined that the host solid-state drive has reached the end of its lifespan, the data transfer protocol of the cache chip of the host solid-state drive is automatically expanded, or when a set instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained and the data transfer protocol is expanded according to the set instruction. If it is determined that the host solid-state drive has not reached the end of its lifespan, when a set instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained and the data transfer protocol is expanded according to the set instruction. By expanding the data transfer protocol of the cache chip, the cache chip can be used by the host to cache application layer data information, thereby improving the host memory.
[0113] The present invention also provides a device. The device of the present invention includes:
[0114] A detection module, configured to obtain the application layer data information and the usage information of the host memory corresponding to the cache instruction when detecting the cache instruction, and obtain the data transfer protocol corresponding to the cache chip in the host solid-state drive;
[0115] A cache module, configured to cache the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transfer protocol.
[0116] Further, the detection module further includes an acquisition module, and the acquisition module is configured to:
[0117] Obtain the lifespan information of the host solid-state drive;
[0118] Based on the lifespan information, expand the data transfer protocol of the cache chip of the host solid-state drive so that the cache chip can cache data with different data transfer protocols.
[0119] Further, the detection module further includes a determination module, and the determination module is configured to:
[0120] Based on the lifespan information, determine whether the host solid-state drive has reached the end of its lifespan;
[0121] If it is determined that the host solid-state drive has reached the end of its life, the data transfer protocol of the cache chip of the host solid-state drive is automatically extended, or when a setting instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the setting instruction;
[0122] If it is determined that the host solid-state drive has not reached the end of its life, when a setting instruction is received, the data transfer protocol of the cache chip in the host solid-state drive is obtained, and the data transfer protocol is extended according to the setting instruction.
[0123] Further, the detection module further includes an extension module, and the extension module is used for:
[0124] Obtain the data transfer protocol of the host memory, and add the data transfer protocol of the host memory to the data transfer protocol of the cache chip of the host solid-state drive to extend the data transfer protocol of the cache chip of the host solid-state drive.
[0125] Further, the cache module is further used for:
[0126] Determine the memory capacity required by the application layer data information, determine the remaining memory capacity of the host memory according to the usage information, and compare the memory capacity with the remaining memory capacity;
[0127] If the memory capacity is greater than the remaining memory capacity, it is determined to call the cache chip, and the application layer data information is cached in the cache chip according to the data transfer protocol.
[0128] Further, the cache module is further used for:
[0129] If the memory capacity is less than the remaining memory capacity, obtain the first memory capacity threshold of the host memory, and compare the remaining memory capacity with the first memory capacity threshold;
[0130] If the remaining memory capacity is less than the first memory capacity threshold, it is determined to call the cache chip, and the application layer data information is cached in the cache chip according to the data transfer protocol.
[0131] Further, the cache module is further used for:
[0132] Detect whether the host solid-state drive has reached the end of its life;
[0133] If the host solid-state drive has reached the end of its life, the application layer data information is cached in the cache chip according to the data transfer protocol;
[0134] If the host solid-state drive is not at the end of its life, obtain a second memory capacity threshold, and cache the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold.
[0135] The present invention also provides a data storage system.
[0136] The data storage system includes: a memory, a processor, and a data storage program stored on the memory and executable on the processor. When the data storage program is executed by the processor, it implements the steps of the data storage method as described above.
[0137] Among them, the method implemented when the data storage program running on the processor is executed can refer to the various embodiments of the data storage method of the present invention, which will not be elaborated here.
[0138] The present invention also provides a computer-readable storage medium.
[0139] The readable storage medium is a computer-readable storage medium. A data storage program is stored on the computer-readable storage medium. When the data storage program is executed by the processor, it implements the steps of the data storage method as described above.
[0140] Among them, the method implemented when the data storage program running on the processor is executed can refer to the various embodiments of the data storage method of the present invention, which will not be elaborated here.
[0141] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including that element.
[0142] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0143] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0144] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A data storage method, characterized in that, the data storage method includes the following steps: Obtain the lifespan information of the host solid-state drive; Based on the lifespan information, determine whether the host solid-state drive has reached the end of its lifespan; If it is determined that the host solid-state drive has reached the end of its lifespan, automatically expand the data transfer protocol of the cache chip of the host solid-state drive, or when a set instruction is received, obtain the data transfer protocol of the cache chip in the host solid-state drive, and expand the data transfer protocol according to the set instruction; If it is determined that the host solid-state drive has not reached the end of its lifespan, when a set instruction is received, obtain the data transfer protocol of the cache chip in the host solid-state drive, and expand the data transfer protocol according to the set instruction; When a cache instruction is detected, obtain the application layer data information corresponding to the cache instruction and the usage information of the host memory, and obtain the data transfer protocol corresponding to the cache chip in the host solid-state drive; Based on the application layer data information, the usage information, and the data transfer protocol, cache the application layer data information in the cache chip.
2. The data storage method according to claim 1, characterized in that, the step of expanding the data transfer protocol of the cache chip of the host solid-state drive includes: Obtain the data transfer protocol of the host memory, and add the data transfer protocol of the host memory to the data transfer protocol of the cache chip of the host solid-state drive to expand the data transfer protocol of the cache chip of the host solid-state drive.
3. The data storage method according to claim 1, characterized in that, the step of caching the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transfer protocol includes: Determine the memory capacity required by the application layer data information, determine the remaining memory capacity of the host memory according to the usage information, and compare the memory capacity with the remaining memory capacity; If the memory capacity is greater than the remaining memory capacity, determine to call the cache chip, and cache the application layer data information in the cache chip according to the data transfer protocol.
4. The data storage method according to claim 3, characterized in that, after the step of comparing the memory capacity with the remaining memory capacity, the data storage method further includes: If the memory capacity is less than the remaining memory capacity, obtain the first memory capacity threshold of the host memory, and compare the remaining memory capacity with the first memory capacity threshold; If the remaining memory capacity is less than the first memory capacity threshold, determine to call the cache chip, and cache the application layer data information in the cache chip according to the data transfer protocol.
5. The data storage method according to any one of claims 3-4, characterized in that, the step of caching the application layer data information in the cache chip according to the data transfer protocol includes: Detect whether the host solid-state drive has reached the end of its lifespan; If the host solid-state drive has reached the end of its life, cache the application layer data information in the cache chip according to the data transmission protocol; If the host solid-state drive has not reached the end of its life, obtain a second memory capacity threshold, and cache the application layer data information in the cache chip according to the data transmission protocol and the second memory capacity threshold.
6. A data storage device, characterized in that the data storage device includes: an acquisition module for acquiring the life information of the host solid-state drive; a determination module for determining whether the host solid-state drive has reached the end of its life based on the life information; an expansion module for automatically expanding the data transmission protocol of the cache chip of the host solid-state drive if it is determined that the host solid-state drive has reached the end of its life, or for acquiring the data transmission protocol of the cache chip in the host solid-state drive and expanding the data transmission protocol according to the set instruction when receiving the set instruction; if it is determined that the host solid-state drive has not reached the end of its life, acquire the data transmission protocol of the cache chip in the host solid-state drive and expand the data transmission protocol according to the set instruction when receiving the set instruction; a detection module for acquiring the application layer data information and the usage information of the host memory corresponding to the cache instruction, and acquiring the data transmission protocol corresponding to the cache chip in the host solid-state drive when detecting the cache instruction; a cache module for caching the application layer data information in the cache chip based on the application layer data information, the usage information, and the data transmission protocol.
7. A data storage system, characterized in that the data storage system includes: a memory, a processor, and a data storage program stored on the memory and executable on the processor, and when the data storage program is executed by the processor, the steps of the data storage method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that a data storage program is stored on the computer-readable storage medium, and when the data storage program is executed by a processor, the steps of the data storage method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Computer system based on solid state disc as cache and cache accelerating method
CN103744611A
Storage system and reading / writing method adopting storage system
CN105630405A