Energy-saving time-sharing control method for storageTechnical Field
The invention relates to the technical field of data storage, in particular to an energy-saving time-sharing control method for storage.
Background
In the era of high-speed development of the internet, the information output speed is increased by exponential multiplying power, the corresponding storage requirements are more and more increased, the existing storage Hard disks are divided into two types, namely a Hard Disk Drive (HDD) and a fixed Hard Disk Drive (SSD), and the HDD generally has large storage capacity, is low in unit capacity price, but is high in power consumption and low in read-write speed; compared to HDDs, SSDs have low power consumption and fast read and write rates, but have lower capacity and higher price per unit capacity.
In the background of the prior art, one or two parallel modes are mostly selected for writing data, and in the actual working process, the power consumption at different time intervals is different, and the data writing is performed by adopting different modes at different time intervals of the power consumption, so that not only can the energy consumption be increased, but also the waste of hard disk data is caused, and therefore, an energy-saving time-sharing control method for storage is provided so as to solve the problems provided in the prior art.
Disclosure of Invention
The invention aims to provide an energy-saving time-sharing control method for storage, which aims to solve the problems that in the prior art, in the actual working process, the power consumption at different time intervals is different, and data writing is carried out in different modes at different time intervals, so that the energy consumption is increased and the hard disk data is wasted.
In order to achieve the purpose, the invention provides the following technical scheme: a power-saving time-sharing control method for storage, the storage control method comprising the steps of:
the method comprises the following steps: firstly, controlling the writing of data through an algorithm;
step two: when data is written, the data is directly written into an SSD (solid state disk);
step three: detecting whether the storage space of the SSD is full;
step four: in the third step, if the storage space of the SSD disk is full, the SSD disk transfers certain spatial data content to an HDD disk (mechanical hard disk);
step five: if the SSD disk storage space is not full in the step three, continuing to wait for data writing;
step six: detecting the peak and valley of the power consumption by detecting a time-sharing power rate system in a timing manner;
step seven: detecting in step six that if the data is in a valley period (low electricity charge), transferring the data of the SSD disk to the HDD disk;
step eight: if the detection in the sixth step is in a peak period (high electric charge), the data is directly written into the SSD disc;
step nine: after the data transfer in the step seven is finished, stopping or reducing the running state of the HDD disk;
step ten: and repeating the second step to the ninth step.
Preferably, the capacities (Tb) of the SSD disk (solid state disk) and the HDD disk (mechanical hard disk) are in accordance with 5: the ratio of 200.
Preferably, in the seventh step, when the power consumption peak and valley occur, the SSD disk data is migrated to the HDD disk by the time-sharing control algorithm.
Preferably, in the step eight, during the peak period of power consumption, data is written into the SSD disk, and the mechanical hard disk is in a sleep state or a low-speed operation state at this time.
Preferably, in the third step, the storage space of the SSD disk is dynamically detected in a full load state based on the memory space detection unit.
Preferably, the data transfer priority detected by the SSD disk full load state in the fourth step is higher than the data transfer priority detected by the power state in the seventh step.
Compared with the prior art, the invention has the beneficial effects that: according to the energy-saving time-sharing control method for storage, the content in the SSD is transferred to the HDD during the peak-valley period of power consumption and when the power fee is low, meanwhile, the advantages of the HDD and the SSD are combined, the policy of the state during the peak-valley period of power consumption is responded, the power cost of a user is reduced, and the energy-saving effect is achieved;
1. according to the scheme, the storage condition of the SSD can be detected in real time by dynamically detecting the full-load state of the space of the SSD, so that the data can be transferred in time, and the data cannot be written in;
2. in the scheme, the data migration of the SSD is carried out by using the electric quantity, so that the energy consumption in the peak period of power utilization can be reduced, and meanwhile, when the data do not move forwards, the HDD disk keeps dormant or runs at a low speed, thereby being beneficial to reducing the power cost and ensuring energy conservation.
Drawings
FIG. 1 is a flow chart of the data storage control operation of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a technical solution: a power-saving time-sharing control method for storage, wherein storage control is operated by the steps of:
1. firstly, controlling the writing of data through an algorithm;
2. when data are written, the data are directly written into an SSD (solid state disk) through algorithm control;
3. detecting the full load state of the SSD disk storage space through a memory space detection unit;
4. if the detection result of the storage space of the SSD disk is full, transferring the internal data of the SSD disk to a certain space data content to an HDD disk (mechanical hard disk);
if the detection result of the storage space of the SSD disk is not full, continuing to wait for the write algorithm to control the data to be written into the SSD disk;
5. detecting the peak and valley of the power consumption by detecting a time-sharing power rate system in a timing manner;
6. if the electricity consumption detection structure is in a low valley period (low electricity charge), transferring certain spatial data content of the internal data of the SSD disk to the HDD disk;
if the electricity consumption detection structure is in a peak period (high electricity charge), continuing to wait for the writing algorithm to control the data to be written into the SSD disk, and meanwhile, enabling the HDD disk to be in a dormant state or a low-speed running state;
7. repeatedly carrying out the steps to ensure the operation of the storage writing system;
the data transfer priority of the SSD disk full load state detection is higher than the data transfer priority of the electric quantity state detection in step seven, that is, when the SSD disk data is detected to be full load state, the data transfer is directly performed, so that the SDD disk can be ensured to continuously and stably perform data writing, and data omission is avoided, which is the whole working process of the energy-saving time-sharing control method for storage.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and all the changes or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.