A write cache space management method, device, medium and computer program product
By monitoring the battery capacity and battery change curve, evaluating the battery status and adjusting the write cache space size, the problem of low availability caused by the fixed write cache space size in the storage device is solved, and the effective utilization of battery capacity and efficient operation of the storage device is achieved.
Patent Information
- Application Number
- CN202411179688.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The write cache space size in existing storage devices is fixed, and the battery aging and power changes are not considered, resulting in excessive battery reserves or inability to meet the power reserve requirements, reducing the availability of storage devices.
By monitoring the current battery power and power change curve, evaluating the battery status, and adjusting the write cache space size according to the battery capacity, using the positive correlation between the battery power and the write cache size, dynamically adjusting the write cache space size to avoid battery reservation The power reserve requirement cannot be met when the power is too high or the aging is accelerated.
Improves the availability of storage devices, ensures that the battery can meet power reserve requirements during the aging process, extends battery life and improves overall system performance.
Smart Images

Figure CN118708125B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a write cache space management method, device, medium and computer program product. Background Art
[0002] In storage devices such as array storage, various types of write caches are key components for improving data writing efficiency and overall system performance. Limited by the fixed battery power, in order to prevent data loss in the event of an unexpected power outage, especially when the battery power is insufficient to support writing all cached data back to persistent storage, the write cache space generally has a maximum value to match the maximum backup power. This fixed write cache space size strategy fails to take into account battery aging and actual power changes, which may cause the battery to reserve too much power or fail to meet the system backup power requirements under accelerated aging conditions, resulting in low availability of the storage device.
[0003] Therefore, how to improve the availability of storage devices is a technical problem that those skilled in the art need to solve. Summary of the invention
[0004] The purpose of the present application is to provide a write cache space management method, device, medium and computer program product, which improves the availability of storage devices.
[0005] To achieve the above objectives, the present application provides a write cache space management method, comprising:
[0006] Monitor the current power and power change curve of the battery in the storage device; wherein the power change curve includes the charge and discharge fluctuation curve and the battery aging and attenuation fluctuation curve;
[0007] Evaluate the state of the battery according to the charge-discharge fluctuation curve and the battery aging attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state;
[0008] The size of the write cache space in the storage device is set according to the current power; wherein the size of the write cache space is positively correlated with the current power.
[0009] Wherein, evaluating the state of the battery according to the charge and discharge fluctuation curve and the battery aging attenuation fluctuation curve includes:
[0010] Determine the current use state of the battery, and obtain a standard charge and discharge fluctuation curve and a standard battery aging attenuation fluctuation curve corresponding to the current use state;
[0011] Determine whether the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve is greater than or equal to a preset value, or whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a preset value;
[0012] If any one of the items is yes, it is determined that the battery is in an unhealthy state;
[0013] If both are negative, it is determined that the battery is in a healthy state.
[0014] Wherein, determining the current usage status of the battery includes:
[0015] The current temperature information of the battery is obtained, and the temperature range in which the current temperature information is located is determined, and the corresponding current use state is determined according to the temperature range.
[0016] Wherein, if the battery is in a healthy state, setting the size of the write cache space in the storage device according to the current power level includes:
[0017] An adjustment strategy is determined, and a write cache space size in the storage device is set according to the current power using the adjustment strategy.
[0018] Wherein, if the adjustment strategy is an availability priority strategy, using the adjustment strategy to set the size of the write cache space in the storage device according to the current power includes:
[0019] Determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a first preset percentage;
[0020] If yes, setting the write cache space size in the storage device to a second preset percentage of the maximum space size; wherein the maximum space size is the data size allowed to be flushed when the battery is fully charged;
[0021] If not, the write cache space size in the storage device is set to a third preset percentage of the maximum space size; wherein the third preset percentage is smaller than the second preset percentage.
[0022] After setting the write cache space size in the storage device to a second preset percentage of the maximum space size, the method further includes:
[0023] The battery is charged in the fast charge mode until the power of the battery satisfies the flush operation of data of the write cache space size.
[0024] Wherein, after setting the write cache space size in the storage device to a third preset percentage of the maximum space size, the method further includes:
[0025] The battery is charged in the fast charging mode until the battery is slowly fully charged.
[0026] Wherein, if the adjustment strategy is a performance priority strategy, using the adjustment strategy to set the size of the write cache space in the storage device according to the current power includes:
[0027] Determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a fourth preset percentage;
[0028] If so, setting the write cache space size in the storage device to a fifth preset percentage of the maximum space size;
[0029] If not, the write cache space size in the storage device is set to a sixth preset percentage of the maximum space size; wherein the sixth preset percentage is smaller than the fifth preset percentage.
[0030] The first preset percentage is smaller than the fourth preset percentage, and the second preset percentage is smaller than the sixth preset percentage.
[0031] After setting the write cache space size in the storage device to a fifth preset percentage of the maximum space size, the method further includes:
[0032] The charging mode of the battery is set to the standard mode.
[0033] After setting the write cache space size in the storage device to a sixth preset percentage of the maximum space size, the method further includes:
[0034] The charging mode of the battery is set to the standard mode.
[0035] Wherein, if the battery is in an unhealthy state, setting the size of the write cache space in the storage device according to the current power level includes:
[0036] Determining the abnormality level according to the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve and / or the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve; wherein the abnormality level is positively correlated with the degree of deviation;
[0037] The write cache space size in the storage device is set to a target percentage of the maximum space size; wherein the maximum space size is the data size allowed to be flushed when the battery is fully charged, and the target percentage is negatively correlated with the abnormality level.
[0038] To achieve the above objectives, the present application provides an electronic device, including:
[0039] Memory for storing computer programs;
[0040] A processor is used to implement the steps of the write cache space management method as described above when executing the computer program.
[0041] To achieve the above objectives, the present application provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the write cache space management method as described above are implemented.
[0042] To achieve the above objectives, the present application provides a computer program product, including a computer program, which implements the steps of the above write cache space management method when executed by a processor.
[0043] It can be seen from the above scheme that a write cache space management method provided by the present application includes: monitoring the current power and power change curve of the battery in the storage device; wherein the power change curve includes a charge and discharge fluctuation curve and a battery aging and attenuation fluctuation curve; evaluating the state of the battery according to the charge and discharge fluctuation curve and the battery aging and attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state; setting the write cache space size in the storage device according to the current power; wherein the write cache space size is positively correlated with the current power.
[0044] The write cache space management method provided by the present application monitors the current power and power change curve of the battery in the storage device in real time, and can evaluate the health status of the battery according to the power change curve. The positive correlation between the battery power and the write cache size is used to adjust the write cache space size according to the current power, thereby avoiding the battery reserving too much power or failing to meet the backup power requirements of the storage device under accelerated aging conditions, and improving the availability of the storage device. The present application also discloses a write cache space management device, an electronic device, a non-volatile storage medium, and a computer program product, which can also achieve the above technical effects.
[0045] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:
[0047] Figure 1 It is a flowchart of a write cache space management method according to an exemplary embodiment;
[0048] Figure 2 is a flow chart of another write cache space management method according to an exemplary embodiment;
[0049] Figure 3 The figure is a functional topology diagram of a storage device according to an exemplary embodiment;
[0050] Figure 4 is a structural diagram of a write cache space management device according to an exemplary embodiment;
[0051] Figure 5 The figure is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0053] The embodiment of the present application discloses a write cache space management method, which improves the availability of storage devices.
[0054] See also Figure 1 , according to an exemplary embodiment, a flowchart of a write cache space management method is shown, such as Figure 1 As shown, including:
[0055] S101: monitoring the current power and power change curve of the battery in the storage device; wherein the power change curve includes a charge and discharge fluctuation curve and a battery aging and attenuation fluctuation curve;
[0056] In this step, the battery power and its change curve in the storage device are monitored, that is, the remaining power of the battery is tracked in real time, and its fluctuations during the charging and discharging process and aging and attenuation over time are observed. Specifically, the charge and discharge fluctuation curve shows the instantaneous changes in the battery power during the charging and discharging process, which helps to understand the battery's efficiency and instant status. The battery aging and attenuation fluctuation curve reflects the trend of the battery's performance gradually declining as the battery is used for a longer time, which helps to predict the battery's service life and replacement time. Through the analysis of these two curves, a more comprehensive understanding of the battery's health and performance can be obtained.
[0057] S102: Evaluate the state of the battery according to the charge-discharge fluctuation curve and the battery aging attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state;
[0058] In this step, by analyzing the battery charge and discharge fluctuation curve and the battery aging attenuation fluctuation curve, the current state of the battery can be evaluated to determine whether it is in a healthy state. A healthy state means that the battery's performance is as expected, without significant degradation or failure; an unhealthy state may indicate that the battery has performance degradation, capacity reduction, or other potential problems.
[0059] As a feasible implementation manner, the state of the battery is evaluated according to the charge and discharge fluctuation curve and the battery aging attenuation fluctuation curve, including: determining the current usage state of the battery, obtaining the standard charge and discharge fluctuation curve and the standard battery aging attenuation fluctuation curve corresponding to the current usage state; judging whether the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve is greater than or equal to a preset value, or whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a preset value; if any one of the items is yes, it is judged that the battery is in an unhealthy state; if both are no, it is judged that the battery is in a healthy state.
[0060] In a specific implementation, first, determine the current usage status of the battery, and obtain the standard charge and discharge fluctuation curve and the standard battery aging attenuation fluctuation curve corresponding to the current usage status. Then, the health status of the battery is evaluated by comparing the actual charge and discharge fluctuation curve of the battery with the standard charge and discharge fluctuation curve, and the actual aging attenuation fluctuation curve of the battery with the standard aging attenuation fluctuation curve. If the degree of deviation between the actual curve and the standard curve reaches or exceeds the preset threshold, the battery will be judged to be in an unhealthy state. If the degree of deviation between the actual curve and the standard curve does not exceed the preset threshold, the battery is judged to be in a healthy state.
[0061] As a feasible implementation, determining the current use state of the battery includes: obtaining current temperature information of the battery, determining the temperature range in which the current temperature information is located, and determining the corresponding current use state according to the temperature range. In a specific implementation, it is first necessary to obtain the real-time temperature data of the battery, and then determine which predefined temperature range the battery is in according to the data, and each temperature range corresponds to a different use state.
[0062] S103: Setting a write cache space size in the storage device according to the current power; wherein the write cache space size is positively correlated with the current power.
[0063] In a specific implementation, the write cache space size is dynamically adjusted according to the current power level. The positive correlation between the battery power and the write cache size is utilized to automatically adjust the write cache size according to the current power level. That is, the higher the current power level, the larger the write cache space size. Conversely, the lower the current power level, the smaller the write cache space size.
[0064] As a feasible implementation, if the battery is in a healthy state, the size of the write cache space in the storage device is set according to the current power, including: determining an adjustment strategy, and using the adjustment strategy to set the size of the write cache space in the storage device according to the current power. In a specific implementation, the adjustment strategy may include an availability priority strategy and a performance priority strategy, and different adjustment strategies correspond to different write cache space size adjustment methods, but the general principle is that the write cache space size is positively correlated with the current power.
[0065] As a feasible implementation mode, if the battery is in an unhealthy state, the size of the write cache space in the storage device is set according to the current power level, including: determining the abnormality level according to the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve, and / or the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve; wherein the abnormality level is positively correlated with the degree of deviation; setting the write cache space size in the storage device to a target percentage of the maximum space size; wherein the maximum space size is the data size allowed to be refreshed when the battery is fully charged, and the target percentage is negatively correlated with the abnormality level.
[0066] In a specific implementation, when the battery is in an unhealthy state, it means that the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve is greater than or equal to a preset value, or the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a preset value, or both conditions are met. If only the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve is greater than or equal to a preset value, the abnormal level is determined according to the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve, and the abnormal level is positively correlated with the degree of deviation, that is, the greater the degree of deviation, the higher the abnormal level, and vice versa, the smaller the degree of deviation, the lower the abnormal level. If only the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a preset value, the abnormal level is determined according to the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve, and the abnormal level is positively correlated with the degree of deviation, that is, the greater the degree of deviation, the higher the abnormal level, and vice versa, the smaller the degree of deviation, the lower the abnormal level. If both conditions are met, the first abnormality level can be determined according to the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve, and the second abnormality level can be determined according to the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve. Then, the first abnormality level and the second abnormality level are weightedly averaged to obtain the final abnormality level, thereby improving the accuracy of determining the abnormality level.
[0067] Furthermore, the maximum capacity of the write cache space is defined as the amount of data that can be safely written to the battery when it is fully charged. Then, based on the determined abnormality level, the size of the write cache space is set to a certain percentage of this maximum space size, which is called the target percentage. Importantly, the target percentage is negatively correlated with the abnormality level, meaning that the higher the abnormality level, the lower the target percentage is set, thereby reducing the size of the write cache space to adapt to the current health state of the battery. It should be noted that the number of abnormality levels and the target percentage corresponding to each abnormality level can be flexibly set by those skilled in the art according to actual conditions.
[0068] The write cache space management method provided in the embodiment of the present application monitors the current power level and power change curve of the battery in the storage device in real time. The health status of the battery can be evaluated based on the power change curve. The positive correlation between the battery power level and the write cache size is used to adjust the write cache space size according to the current power level, thereby avoiding the battery reserving too much power or being unable to meet the backup power demand of the storage device under accelerated aging conditions, thereby improving the availability of the storage device.
[0069] The embodiment of the present application discloses a write cache space management method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
[0070] See also Figure 2 , a flowchart of another write cache space management method according to an exemplary embodiment is shown, such as Figure 2 As shown, including:
[0071] S201: monitoring the current power and power change curve of the battery in the storage device; wherein the power change curve includes a charge and discharge fluctuation curve and a battery aging and attenuation fluctuation curve;
[0072] S202: Evaluate the state of the battery according to the charge-discharge fluctuation curve and the battery aging attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state;
[0073] S203: If the battery is in a healthy state, determining an adjustment strategy;
[0074] S204: If the adjustment strategy is an availability priority strategy, determine whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a first preset percentage; if so, set the write cache space size in the storage device to a second preset percentage of the maximum space size, and charge the battery in the fast charging mode until the battery power meets the write cache space size for the data flushing operation; wherein the maximum space size is the data size allowed to be flushed when the battery is fully charged; if not, set the write cache space size in the storage device to a third preset percentage of the maximum space size, and charge the battery in the fast charging mode until the battery is slowly fully charged; wherein the third preset percentage is less than the second preset percentage.
[0075] In a specific implementation, the availability priority strategy has a more flexible strategy adjustment window than the performance priority strategy. Under the availability priority strategy, when the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to the first preset percentage, the write cache space size is set to the second preset percentage of the maximum space size, and the current charging mode is adjusted to the fast charging mode until the battery power meets the data flushing operation of the current write cache space size, that is, the data flushing operation of the second preset percentage of the maximum space size. When the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is less than the first preset percentage, the write cache space size is set to the third preset percentage of the maximum space size, the third preset percentage is less than the second preset percentage, and the current charging mode is adjusted to the fast charging mode until the battery is fully charged.
[0076] S205: If the adjustment strategy is a performance priority strategy, determine whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a fourth preset percentage; if so, set the write cache space size in the storage device to a fifth preset percentage of the maximum space size, and set the charging mode of the battery to a standard mode; if not, set the write cache space size in the storage device to a sixth preset percentage of the maximum space size, and set the charging mode of the battery to a standard mode; wherein the sixth preset percentage is less than the fifth preset percentage.
[0077] In a specific implementation, under the performance priority strategy, when the battery aging attenuation fluctuation curve deviates from the standard battery aging attenuation fluctuation curve by a degree greater than or equal to the fourth preset percentage, the write cache space size is set to the fifth preset percentage of the maximum space size, and the current charging mode is adjusted to the standard mode. When the battery aging attenuation fluctuation curve deviates from the standard battery aging attenuation fluctuation curve by a degree less than the fourth preset percentage, the write cache space size is set to the sixth preset percentage of the maximum space size, the sixth preset percentage is less than the fifth preset percentage, and the current charging mode is adjusted to the standard mode.
[0078] As a feasible implementation, the first preset percentage is less than the fourth preset percentage, and the second preset percentage is less than the sixth preset percentage. That is, the third preset percentage is less than the second preset percentage, the second preset percentage is less than the sixth preset percentage, and the sixth preset percentage is less than the fifth preset percentage.
[0079] S206: If the battery is in an unhealthy state, determine the abnormality level according to the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve, and / or the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve; wherein, the abnormality level is positively correlated with the degree of deviation; set the write cache space size in the storage device to a target percentage of the maximum space size; wherein, the maximum space size is the data size allowed to be refreshed when the battery is fully charged, and the target percentage is negatively correlated with the abnormality level.
[0080] It can be seen that this embodiment dynamically adjusts the size of the write cache space according to the real-time monitoring results of the battery power, and uses the positive correlation between the battery power and the write cache size to automatically optimize the write cache size according to the change of the battery power. In particular, the different strategy adjustments in the two differentiated scenarios of high availability and high performance avoid abnormal problems such as the inability of the cluster to respond to front-end services in a timely manner in some extreme scenarios, thereby improving the availability of the storage system.
[0081] An application example provided by the present application is described below. Figure 3 As shown, the storage device includes a battery power and cache space linkage management module, a battery power monitoring module, a battery module, a cache module, a battery status analysis module, a battery charging strategy adjustment module, and a parameter module. The battery power and cache space linkage management module is located on the board, and is mainly used for programmable logic devices such as ARM (Advanced RISC Machines). The battery power and cache space linkage management module can dynamically manage the battery power monitoring module, the battery status analysis module, the battery charging strategy adjustment module, and the cache module in high availability mode and high performance mode respectively. The battery power monitoring module is responsible for real-time monitoring of the current power and power changes of the battery, including normal charging and discharging fluctuations and attenuation fluctuations caused by battery aging, and is embedded with charging and discharging theoretical curves and aging attenuation fluctuation theoretical curves under various battery usage conditions. The battery status analysis module evaluates the health status and charging requirements of the battery. The battery charging strategy adjustment module is controlled by the battery power and cache space linkage management module. It adjusts the charging strategy according to the strategy information of the battery power and cache space linkage management module. It uses fast charging technology when the power is below a certain critical point and disables fast charging when the power is above the threshold. It adopts the standard charging mode to extend the battery life. The cache module, that is, various types of high-speed cache, is a key component to improve data writing efficiency and overall system performance. The parameter module can be used to exchange information between the outside world and the battery power and cache space linkage management module, preset parameters, and enable related functions. The battery module is used to flush dirty data in the write cache space to the persistent storage medium when the storage loses power.
[0082] The battery power and cache space linkage management module dynamically adjusts the size of the write cache space according to the real-time monitoring results of the battery power, and uses the positive correlation between the battery power and the write cache size to automatically optimize the write cache size according to the change of the battery power, that is, as the power increases, the write cache space becomes larger. In the high-availability mode, there is a more sensitive policy adjustment window compared with the high-performance mode. When the battery power and cache space linkage management module monitors the battery aging and attenuation real-time fluctuation curve through the battery power monitoring module and does not deviate from the theoretical curve by 10% under the current use state, the battery power and cache space linkage management module adjusts the embedded minimum write cache space to 15% of the maximum space, and adjusts the current charging mode to fast charging until it is full through the battery charging strategy adjustment module; when the battery power and cache space linkage management module monitors the battery aging and attenuation real-time fluctuation curve through the battery power monitoring module and deviates from the theoretical curve by 10% under the current use state, the battery power and cache space linkage management module adjusts the embedded minimum write cache space to 20% of the maximum space, and the charging mode is fast charging mode until it is full to meet the power of 20% space. In high-performance mode, when the battery power and cache space linkage management module detects through the battery power monitoring module that the real-time fluctuation curve of battery aging attenuation does not deviate from the theoretical curve by 15% under the current use state, the battery power and cache space linkage management module adjusts the embedded minimum write cache space to 25% of the maximum space, and adjusts the current charging mode to the standard mode through the battery charging strategy adjustment module; when the battery power and cache space linkage management module detects through the battery power monitoring module that the real-time fluctuation curve of battery aging attenuation deviates from the theoretical curve by 15% under the current use state, the battery power and cache space linkage management module adjusts the embedded minimum write cache space to 30% of the maximum space, and the charging mode is the standard mode. Regardless of high-availability mode or high-performance mode, when the current battery state obtained by the battery power and cache space linkage management module through the battery state analysis module is not in the expected healthy state, according to the determined abnormal level, there are a total of 6 levels, level 1 is the healthiest state, level 6 is the worst state, and the write cache space size is locked to the maximum space percentage F. The larger the level, the smaller F, for example, level 1 corresponds to 100% and level 6 corresponds to 50%.
[0083] It can be seen that the battery power and cache space linkage management module dynamically adjusts the size of the write cache space according to the real-time monitoring results of the battery power, and uses the positive correlation between the battery power and the write cache size to automatically optimize the write cache size according to the change of the battery power. In particular, the different strategy adjustments in the two differentiated scenarios of high availability and high performance avoid abnormal problems such as the inability of the cluster to respond to front-end business in a timely manner in some extreme scenarios, thereby improving the availability of the entire system.
[0084] A write cache space management device provided in an embodiment of the present application is introduced below. The write cache space management device described below and the write cache space management method described above can be referenced to each other.
[0085] See also Figure 4 , according to an exemplary embodiment, a structural diagram of a write cache space management device is shown, such as Figure 4 As shown, including:
[0086] The monitoring unit 401 is used to monitor the current power and power change curve of the battery in the storage device; wherein the power change curve includes a charge and discharge fluctuation curve and a battery aging attenuation fluctuation curve;
[0087] An evaluation unit 402, configured to evaluate the state of the battery according to the charge-discharge fluctuation curve and the battery aging attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state;
[0088] The setting unit 403 is used to set the size of the write cache space in the storage device according to the current power; wherein the size of the write cache space is positively correlated with the current power.
[0089] The write cache space management device provided in the embodiment of the present application monitors the current power level and power change curve of the battery in the storage device in real time. The health status of the battery can be evaluated based on the power change curve. The positive correlation between the battery power and the write cache size is used to adjust the write cache space size according to the current power level, thereby avoiding the battery reserving too much power or being unable to meet the backup power demand of the storage device under accelerated aging conditions, thereby improving the availability of the storage device.
[0090] On the basis of the above embodiments, as a preferred implementation mode, the evaluation unit 402 is specifically used to: determine the current usage status of the battery, obtain the standard charge and discharge fluctuation curve and the standard battery aging and attenuation fluctuation curve corresponding to the current usage status; determine whether the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve is greater than or equal to a preset value, or whether the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve is greater than or equal to a preset value; if any one of the items is yes, it is determined that the battery is in an unhealthy state; if both are no, it is determined that the battery is in a healthy state.
[0091] Based on the above embodiment, as a preferred implementation, the evaluation unit 402 is specifically used to: obtain current temperature information of the battery, determine a temperature range where the current temperature information is located, and determine the corresponding current usage state according to the temperature range.
[0092] Based on the above embodiment, as a preferred implementation, if the battery is in a healthy state, the setting unit 403 is specifically used to: determine an adjustment strategy, and use the adjustment strategy to set the size of the write cache space in the storage device according to the current power.
[0093] On the basis of the above embodiments, as a preferred implementation mode, the setting unit 403 is specifically used for: if the adjustment strategy is an availability priority strategy, then determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a first preset percentage; if so, setting the write cache space size in the storage device to a second preset percentage of the maximum space size; wherein the maximum space size is the data size allowed to be refreshed when the battery is fully charged; if not, setting the write cache space size in the storage device to a third preset percentage of the maximum space size; wherein the third preset percentage is less than the second preset percentage.
[0094] Based on the above embodiments, as a preferred implementation, the setting unit 403 is also used to: after setting the write cache space size in the storage device to a second preset percentage of the maximum space size, charge the battery in a fast charging mode until the battery power satisfies the flush operation of data of the write cache space size.
[0095] Based on the above embodiments, as a preferred implementation, the setting unit 403 is also used to: after setting the write cache space size in the storage device to a third preset percentage of the maximum space size, charge the battery in a fast charging mode until the battery is slowly fully charged.
[0096] On the basis of the above embodiments, as a preferred implementation mode, the setting unit 403 is specifically used for: if the adjustment strategy is a performance priority strategy, determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a fourth preset percentage; if so, setting the write cache space size in the storage device to a fifth preset percentage of the maximum space size; if not, setting the write cache space size in the storage device to a sixth preset percentage of the maximum space size; wherein the sixth preset percentage is less than the fifth preset percentage.
[0097] Based on the above embodiment, as a preferred implementation manner, the first preset percentage is smaller than the fourth preset percentage, and the second preset percentage is smaller than the sixth preset percentage.
[0098] Based on the above embodiment, as a preferred implementation, the setting unit 403 is also used to: after setting the write cache space size in the storage device to the fifth preset percentage of the maximum space size, set the charging mode of the battery to the standard mode.
[0099] Based on the above embodiment, as a preferred implementation mode, the setting unit 403 is also used to: after setting the write cache space size in the storage device to the sixth preset percentage of the maximum space size, set the charging mode of the battery to the standard mode.
[0100] On the basis of the above embodiments, as a preferred implementation mode, if the battery is in an unhealthy state, the setting unit 403 is specifically used to: determine the abnormality level according to the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve, and / or the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve; wherein, the abnormality level is positively correlated with the degree of deviation; set the write cache space size in the storage device to a target percentage of the maximum space size; wherein, the maximum space size is the data size allowed to be refreshed when the battery is fully charged, and the target percentage is negatively correlated with the abnormality level.
[0101] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0102] Based on the hardware implementation of the above program module, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, Figure 5 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 5 As shown, the electronic equipment includes:
[0103] Communication interface 1, capable of exchanging information with other devices such as network devices;
[0104] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices, and is used to execute the write cache space management method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 3.
[0105] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 4 .
[0106] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0107] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0108] The method disclosed in the above embodiment of the present application can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 2 or the instruction in the form of software. The above processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 3, and the processor 2 reads the program in the memory 3 and completes the steps of the above method in combination with its hardware.
[0109] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented, which will not be repeated here for the sake of brevity.
[0110] In an exemplary embodiment, the embodiment of the present application further provides a non-volatile storage medium storing a computer program, which can be executed by the processor 2 to complete the steps of the aforementioned method.
[0111] In an exemplary embodiment, the present application also provides a computer program product, including a computer program, which is executed by the processor 2 to complete the steps of the aforementioned method.
[0112] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to computer program instructions, and the aforementioned computer program can be stored in a non-volatile storage medium. When the computer program is executed, it executes the steps of the above-mentioned method embodiment. Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product, which is stored in a non-volatile storage medium and includes a number of instructions for an electronic device (which can be a personal computer, a server, a network device, etc.) to execute all or part of the methods described in each embodiment of the present application.
[0113] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A write cache space management method, characterized in that: include: Monitor the current power and power change curve of the battery in the storage device; wherein the power change curve includes the charge and discharge fluctuation curve and the battery aging and attenuation fluctuation curve; Evaluate the state of the battery according to the charge-discharge fluctuation curve and the battery aging attenuation fluctuation curve; wherein the state includes a healthy state and an unhealthy state; Setting the size of the write cache space in the storage device according to the current power; wherein the size of the write cache space is positively correlated with the current power; Wherein, setting the size of the write cache space in the storage device according to the current power includes: If the battery is in a healthy state, determining an adjustment strategy, and using the adjustment strategy to set the size of the write cache space in the storage device according to the current power; If the battery is in an unhealthy state, the abnormality level is determined according to the degree of deviation of the charge and discharge fluctuation curve from the standard charge and discharge fluctuation curve, and / or the degree of deviation of the battery aging and attenuation fluctuation curve from the standard battery aging and attenuation fluctuation curve; wherein, the abnormality level is positively correlated with the degree of deviation; the write cache space size in the storage device is set to a target percentage of the maximum space size; wherein, the maximum space size is the data size allowed to be refreshed when the battery is fully charged, and the target percentage is negatively correlated with the abnormality level.
2. The write cache space management method according to claim 1, characterized in that: Evaluating the state of the battery according to the charge and discharge fluctuation curve and the battery aging attenuation fluctuation curve includes: Determine the current use state of the battery, and obtain a standard charge and discharge fluctuation curve and a standard battery aging attenuation fluctuation curve corresponding to the current use state; Determine whether the degree of deviation of the charge-discharge fluctuation curve from the standard charge-discharge fluctuation curve is greater than or equal to a preset value, or whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a preset value; If any one of the items is yes, it is determined that the battery is in an unhealthy state; If both are negative, it is determined that the battery is in a healthy state.
3. The write cache space management method according to claim 2, characterized in that: Determining the current usage status of the battery includes: The current temperature information of the battery is obtained, and the temperature range in which the current temperature information is located is determined, and the corresponding current use state is determined according to the temperature range.
4. The write cache space management method according to claim 1, characterized in that: If the adjustment strategy is an availability priority strategy, using the adjustment strategy to set the size of the write cache space in the storage device according to the current power includes: Determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a first preset percentage; If yes, setting the write cache space size in the storage device to a second preset percentage of the maximum space size; wherein the maximum space size is the data size allowed to be flushed when the battery is fully charged; If not, the write cache space size in the storage device is set to a third preset percentage of the maximum space size; wherein the third preset percentage is smaller than the second preset percentage.
5. The write cache space management method according to claim 4, characterized in that: After setting the write cache space size in the storage device to a second preset percentage of the maximum space size, the method further includes: The battery is charged in the fast charge mode until the power of the battery satisfies the flush operation of data of the write cache space size.
6. The write cache space management method according to claim 4, characterized in that: After setting the write cache space size in the storage device to a third preset percentage of the maximum space size, the method further includes: The battery is charged in the fast charging mode until the battery is fully charged.
7. The write cache space management method according to claim 4, characterized in that: If the adjustment strategy is a performance priority strategy, using the adjustment strategy to set the size of the write cache space in the storage device according to the current power includes: Determining whether the degree of deviation of the battery aging attenuation fluctuation curve from the standard battery aging attenuation fluctuation curve is greater than or equal to a fourth preset percentage; If so, setting the write cache space size in the storage device to a fifth preset percentage of the maximum space size; If not, the write cache space size in the storage device is set to a sixth preset percentage of the maximum space size; wherein the sixth preset percentage is smaller than the fifth preset percentage.
8. The write cache space management method according to claim 7, characterized in that: The first preset percentage is smaller than the fourth preset percentage, and the second preset percentage is smaller than the sixth preset percentage.
9. The write cache space management method according to claim 7, characterized in that: After setting the write cache space size in the storage device to a fifth preset percentage of the maximum space size, the method further includes: The charging mode of the battery is set to the standard mode.
10. The write cache space management method according to claim 7, characterized in that: After setting the write cache space size in the storage device to a sixth preset percentage of the maximum space size, the method further includes: The charging mode of the battery is set to the standard mode.
11. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the write cache space management method as claimed in any one of claims 1 to 10 when executing the computer program.
12. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed, the steps of the write cache space management method according to any one of claims 1 to 10 are implemented.
13. A computer program product, characterized in that It comprises a computer program, which implements the steps of the write cache space management method according to any one of claims 1 to 10 when being executed.
