Method and device for refreshing cache data, electronic equipment and storage medium

By setting flag bits in the cache module to control the IO write mode, the storage performance degradation caused by the silence of the cache module switching to the IO mode when the snapshot service is started is solved, and the data is flushed to the backend without switching to the IO mode. The disk ensures data security and performance stability.

CN119201769APending Publication Date: 2024-12-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411147097.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

When the snapshot service is started, the cache module switches to the IO mode silent process, resulting in a degradation of storage performance, and may even cause a drop in IO zero. This problem cannot be avoided while ensuring data security.

Method used

By setting flag bits in the cache module, the IO write mode is controlled. Without switching the cache write IO mode, the data that has not fallen in the cache is down to the backend disk, and the flag bits are used to determine whether to perform the down-down operation. , ensure data security and performance stability.

Benefits of technology

On the premise of ensuring data security, the storage performance fluctuations caused by the start of the snapshot service are reduced, the performance decline and IO drop caused by switching to the write IO mode of the cache module is avoided, and the stability and performance of the storage system are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201769A_ABST
    Figure CN119201769A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method for refreshing cache data, which comprises the following steps that: a configuration end receives a cache data refreshing request initiated by a snapshot module, updates the value of a first field into a new value, assigns the value of the first field to a second field if the value of the first field is different from the value of the second field, and notifies a service end; the service end updates the value of the flag bit to a specific value, executes cache data refreshing, and notifies a snapshot module after cache data refreshing is completed; the configuration end receives the reset value of the first field, if the reset value of the first field is different from the value of the second field, the value of the second field is updated to be an initial value, and the reset value of the first field is notified to the service end; and the service end clears the flag bit, and cancels execution of lower refreshing of the cache data. According to the embodiment of the invention, the problem that the storage performance is reduced and even the IO is dropped due to the fact that the cache module switches the IO writing mode silently is solved, and the storage performance fluctuation caused by the snapshot service starting is reduced on the premise of ensuring the data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for refreshing cache data, an electronic device, and a storage medium. Background Art

[0002] As the performance requirements for storage products continue to increase, the impact of the silent process of switching the cache write input and output operation (IO, Input / Output) mode on performance is becoming less and less acceptable. In order to adapt to the local replication snapshot service, the existing technology will initiate a task to request data flushing to the cache module when the snapshot service is started. After receiving the task, the cache module will switch the write IO mode from the original write-back mode to the write-through mode. In the process of switching the write mode, all the IO being processed will be processed. After the mode is converted, the data that has not been written to the disk by the cache module will be flushed to the back-end disk, and the new host IO will be processed in the write-through mode. The advantage of the existing technology is that it can ensure the security of data. The disadvantage is that the silent process of switching the cache mode will have a great impact on performance.

[0003] In the prior art, during the startup of the snapshot service, the snapshot service initiates a request to the cache module to flush data to the backend disk. After receiving the task request, the cache module triggers the silent process of switching the volume write IO mode. During the silent processing, the IO newly submitted by the host is added to the silent linked list of the volume. The IO being processed by the cache module must be completely processed before it can switch from the silent state to the host IO processing state. After switching to the IO state, the host IO previously added to the silent linked list is re-driven for processing.

[0004] After the cache module receives the data flushing request task, it triggers the silent process to switch the volume cache mode. During the silent process, the read and write IO requests submitted by the host cannot be processed. All read and write IO are added to the silent linked list of the volume. Only after the volume silent state ends and is converted to the IO processing state can the IO mounted on the volume silent linked list be re-driven, and the host can be responded to after the cache has processed the IO. Since IO cannot be processed during the silent process, the following situations will occur: 1. If the silent time is very short, the read and write IO performance of the storage will be reduced; 2. If the silent time is very long, the host performance will be greatly reduced, and even a long period of IO drop to zero may occur. This is obviously unacceptable for customers with increasingly higher storage performance requirements.

[0005] How to ensure data security without switching the cache write IO mode and at the same time flush the data in the cache that has not been written to the disk to the backend disk is the problem that this patent aims to solve. Summary of the invention

[0006] In view of the above problems, the present invention proposes a method and device for refreshing cache data, an electronic device, and a storage medium.

[0007] In a first aspect of the present invention, a method for flushing cache data is first provided, which is applied to a cache module, wherein the cache module is arranged in a storage system, wherein the storage system further comprises a snapshot module, and wherein the cache module comprises a service end and a configuration end, wherein the method comprises:

[0008] The configuration end receives the request for flushing cache data initiated by the snapshot module, and updates the initial value of the first field to a new value; the first field is used to record whether the request for flushing cache data initiated by the snapshot module is currently received, and the initial value of the first field indicates that the request for flushing cache data initiated by the snapshot module is not received;

[0009] If the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the service end of the value of the first field; the second field is used to record whether the request for flushing cache data initiated by the snapshot module has been received in history, and the initial value of the second field indicates that the request for flushing cache data initiated by the snapshot module has not been received;

[0010] The service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation;

[0011] When the service end detects that the value of the flag bit is a specific value, the cache data is flushed;

[0012] After the business end completes flushing the cache data, it notifies the snapshot module; the snapshot module is used to reset the value of the first field to an initial value;

[0013] The configuration end receives the value of the first field after the snapshot module is reset;

[0014] If the value of the first field after reset is different from the value of the second field, the configuration end updates the value of the second field to the initial value, and notifies the business end of the value of the first field after reset; the business end clears the flag bit according to the value of the first field after reset and cancels the execution of flushing cache data.

[0015] Optionally, if the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the service end of the value of the first field, including:

[0016] If the value of the first field is different from the value of the second field, triggering a state change notification function;

[0017] The state change notification function notifies the service end of the value of the first field;

[0018] If the value of the first field is the same as the value of the second field, triggering the state change notification function is prohibited.

[0019] Optionally, the service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field, including:

[0020] The service end receives the value of the first field;

[0021] If the value of the first field is a new value, updating the value of the flag bit to a specific value for executing a flush of cache data, and executing a flush of cache data;

[0022] If the value of the first field is an initial value, clear the flag bit.

[0023] Optionally, the configuration end receives the value of the first field after the snapshot module is reset, including:

[0024] After the service end completes flushing the cached data, it notifies the snapshot module that the flushing of the cached data is completed; the snapshot module is used to cancel the request to flush the cached data and reset the value of the first field to the initial value;

[0025] The configuration end receives the value of the first field after the snapshot module is reset.

[0026] Optionally, if the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to an initial value, and notifies the service end of the value of the reset first field, including:

[0027] The configuration end receives the value of the first field after the snapshot module is reset; the value of the first field after the reset is an initial value;

[0028] Comparing the value of the reset first field with the value of the second field;

[0029] If the value of the reset first field is different from the value of the second field, updating the value of the second field to an initial value according to the value of the reset first field;

[0030] The configuration end triggers a state change notification function to notify the service end of the value of the reset first field.

[0031] Optionally, the service end clears a flag bit according to the value of the reset first field and cancels the flushing of cache data, further comprising:

[0032] The service end receives the reset value of the first field;

[0033] The service end clears the flag bit according to the reset value of the first field being the initial value;

[0034] The service end cancels the flushing of cache data according to the cleared flag bit.

[0035] Optionally, the method further comprises:

[0036] The cache module receives input and output operations submitted by the host;

[0037] Determine whether the value of the flag bit detected by the service end is a specific value;

[0038] If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations received by the cache module;

[0039] The cache data is flushed in response to the input / output operation received by the cache module, and the input / output operation processing of the host is completed;

[0040] If the service end detects that the flag bit is empty, the input and output operations are written into the cache module;

[0041] After the input / output operation is written into the cache module, judging whether the input / output operation written into the cache module performs a cache data flushing operation according to the value of the flag bit detected by the service end;

[0042] If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations written into the cache module;

[0043] The flushing of cached data under the input / output operation written into the cache module is completed, and the processing of the input / output operation of the host is completed;

[0044] If the service end detects that the flag bit is empty, after writing the input / output operation into the cache module, it directly responds to the host that the input / output operation processing is completed.

[0045] In a second aspect of the present invention, a device for flushing cache data is also provided, the device comprising:

[0046] A request receiving module, used for the configuration end to receive the request for flushing cache data initiated by the snapshot module, and to update the initial value of the first field to a new value; the first field is used to record whether the request for flushing cache data initiated by the snapshot module is currently received, and the initial value of the first field indicates that the request for flushing cache data initiated by the snapshot module is not received;

[0047] a first assignment module, configured to assign the value of the first field to the second field by the configuration end if the value of the first field is different from the value of the second field, and notify the service end of the value of the first field; the second field is used to record whether the request for flushing cache data initiated by the snapshot module has been received in history, and the initial value of the second field indicates that the request for flushing cache data initiated by the snapshot module has not been received;

[0048] A flag bit updating module, used for the service end to update the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation;

[0049] An execution module, configured to execute flushing of cache data when the service end detects that the value of the flag bit is a specific value;

[0050] A notification module, configured to notify the snapshot module after the service end completes flushing cache data; the snapshot module is configured to reset the value of the first field to an initial value;

[0051] A receiving module, used for the configuration end to receive the value of the first field after the snapshot module is reset;

[0052] A second assignment module, configured to update the value of the second field to an initial value by the configuration end if the value of the reset first field is different from the value of the second field, and notify the service end of the value of the reset first field;

[0053] The flag clearing module is used for the service end to clear the flag according to the value of the first field after the reset, and cancel the execution of flushing the cache data.

[0054] In the third aspect of the implementation of the present invention, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a method for flushing cache data as described above.

[0055] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method for flushing cache data as described above is implemented.

[0056] The embodiments of the present invention have the following advantages:

[0057] In an embodiment of the present invention, the configuration end receives a request for flushing cache data initiated by a snapshot module, and updates the initial value of the first field to a new value; if the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the value of the first field to the service end; the service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation; when the service end detects that the value of the flag bit is a specific value, the cache data is flushed; after the service end flushes the cache data, it notifies the snapshot module; the snapshot module resets the value of the first field to the initial value; the configuration end receives the value of the first field reset by the snapshot module; if the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to the initial value, and notifies the service end of the reset value of the first field; the service end clears the flag bit according to the reset value of the first field, and cancels the flushing of cache data. The present snapshot module service startup request cache flushing data solves the problem that the storage performance is reduced or even IO drops to zero due to the silent switching of the cache module to the write IO mode, and reduces the storage performance fluctuation caused by the startup of the snapshot service under the premise of ensuring data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0059] Figure 1 This is a flowchart of a method for flushing cache data provided by an embodiment of the present invention;

[0060] Figure 2 is a flowchart of steps for a configuration end to notify a service end provided by an embodiment of the present invention;

[0061] Figure 3 is a flowchart of the steps of processing input and output operations by a service end provided by an embodiment of the present invention;

[0062] Figure 4 It is a structural block diagram of a device for refreshing cache data provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0064] The problem to be solved by the present invention is how, after receiving a request to flush cache data from a snapshot module, the cache module can ensure data security and storage performance, and, under the premise of not switching the cache write input / output operation (IO, Input / Output) mode, flush the data that is not written to the disk in the cache, and after the data in the cache is flushed, notify the snapshot module that the cache module is ready to continue with subsequent processes.

[0065] It should be noted that in write-back mode, IO can respond to the host's write completion after it is written to the cache module; in write-through mode, IO needs to be written to the backend disk before it can respond to the host's write completion.

[0066] In the embodiment of the present invention, the core concept is to control the IO write mode according to the volume data flush flag during the IO processing. If there is a flag, the IO is written through, and if there is no flag, the IO is written back. A method is proposed to flush the data in the cache to the backend disk without switching the cache write IO mode. It is suitable for storage systems and solves the problem that the storage performance decreases or even IO drops to zero due to the silent switching of the cache module write IO mode when the current snapshot module service starts to request the cache to flush data. Under the premise of ensuring data security, the storage performance fluctuation caused by the startup of the snapshot service is reduced.

[0067] Reference Figure 1 , shows a flowchart of a method for flushing cache data provided by an embodiment of the present invention, which may specifically include the following steps:

[0068] Step 101: The configuration end receives a request for flushing cache data initiated by the snapshot module, and updates the initial value of the first field to a new value.

[0069] In an embodiment of the present invention, the first field is recorded as new_value, which is set at the cache module configuration end, indicating the new value of the latest request for cache refresh data by the snapshot module. It is assigned a value of false during initialization, indicating that the cache data refresh request initiated by the snapshot module has not been received, that is, there is no new data to be refreshed at present, or the latest data status has been processed.

[0070] Specifically, when the snapshot module service is started, the snapshot module sends a request to flush cache data to the cache module through a predefined interface or protocol. This request may contain a specific identifier, data range or other relevant information so that the cache module can accurately perform the flush operation. After receiving the request to flush cache data, the cache module updates the initial value of new_value to the new value, that is, assigns new_value to true, indicating that the cache module has received a request to flush the data in the cache (that is, write it to a persistent storage device, such as a hard disk).

[0071] Step 102: If the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the service end of the value of the first field.

[0072] In the embodiment of the present invention, the second field is recorded as old_value, and is set together with the first field new_value at the cache module configuration end, indicating the old value of the last time the snapshot module requested to cache the refresh data. It is assigned a value of false during initialization, that is, no request for refreshing the cache data initiated by the snapshot module has been received in history, and no snapshot module has requested to cache the refresh data in history.

[0073] Specifically, when the snapshot module initiates a request to refresh cache data to the cache module, the value of new_value has been updated to true, and the value of old_value is false. At this time, old_value is not equal to new_value, so old_value is assigned to new_value, that is, old_value is assigned to true, and the state change notification function is triggered to notify the business end of the changed state, that is, the latest value new_value is notified to the business end.

[0074] In an embodiment of the present invention, by comparing new_value with old_value, the cache module can detect changes in the data state and ensure that old_value records the previous data state; and when old_value and new_value are not equal, old_value is updated to new_value, ensuring that old_value always records the previous data state, thereby maintaining the consistency of the data state.

[0075] Step 103: The service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation.

[0076] In an embodiment of the present invention, after the business end receives the new_value value, it will first record the value of new_value in the log to facilitate subsequent location and analysis of the problem. After that, if it is determined that the value of new_value is true, the business end will set a flag for the volume to request a flush of cached data, and update the value of the flag to a specific value of true, that is, the business end has received the latest data status and needs to perform a flush data operation.

[0077] If the value of new_value is false, the business end will cancel the flag bit of the volume request to flush data, indicating that the business end has not received the latest data status, or the latest data status has not changed, so there is no need to flush data.

[0078] Step 104: When the service end detects that the value of the flag bit is a specific value, it executes a flush of cache data.

[0079] In the embodiment of the present invention, when the value of the flag is a specific value of true, the service end triggers a cache data flushing process to flush the data in the cache to a persistent storage device to ensure data persistence and consistency.

[0080] By controlling the IO write mode according to the volume data flushing flag during IO processing, data that is not stored in the cache can be flushed to the back-end disk without switching the cache write IO mode, thus avoiding the problem of storage performance degradation or even IO dropping to zero caused by the cache module silently switching the write IO mode.

[0081] Step 105: After the business end completes flushing the cache data, it notifies the snapshot module; the snapshot module is used to reset the value of the first field to an initial value.

[0082] In an embodiment of the present invention, after the cache module business end completes flushing the cache data, it will send a notification to the snapshot module to inform the snapshot module that the data flushing operation has been completed. This notification ensures that the snapshot module can timely understand the changes in the data status and perform corresponding processing. After receiving the notification from the cache module, the snapshot module will cancel the previously initiated data flushing request, that is, reset the value of new_value to false, indicating that the snapshot module already knows that the data has been safely written to the back-end storage and no longer needs to be repeated, thereby avoiding repeated operations and unnecessary resource consumption.

[0083] Step 106: The configuration end receives the value of the first field after the snapshot module is reset.

[0084] Specifically, if the configuration end receives a new_value value of false, it indicates that there is currently no demand for refreshing data or the request has been processed, which helps the configuration end to update the system status and ensure the consistency and accuracy of the system status.

[0085] Step 107: If the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to an initial value, and notifies the service end of the value of the reset first field.

[0086] In an embodiment of the present invention, the configuration end compares the values ​​of new_value and old_value. At this time, if new_value is false and old_value is true, and the two are not the same, old_value is updated to new_value to ensure that old_value always records the last data status. After updating old_value, the configuration end triggers the subscription function to notify the business end of the change in data status.

[0087] Step 108: The service end clears the flag bit according to the value of the reset first field, and cancels the flushing of cached data.

[0088] In an embodiment of the present invention, after receiving the new_value value of false, the business end will clear the flag of the volume request to flush data, indicating that there is currently no pending request to flush cached data and there is no need to perform the operation of flushing cached data, thereby ensuring the normal operation of the system and the consistency of data status.

[0089] Without switching the cache write IO mode, flushing the data in the cache that has not been written to the disk to the backend disk can also be achieved by maintaining a queue of data that has not been written to the disk. The system periodically or in real time detects whether there is data in the cache that has not been written to the disk. When it detects that there is data in the cache that has not been written to the disk, the system can trigger a flush operation. This operation can be automatic or triggered by external events (such as system load reduction, specific time points, etc.). In the flush operation, the system will write the data in the cache that has not been written to the disk to the backend disk; after the data is written to the backend disk, the system needs to update the cache status, mark the relevant data as written to the disk, and remove the data from the queue of data that has not been written to the disk. The system can effectively flush the data in the cache that has not been written to the disk to the backend disk without switching the cache write IO mode, ensuring data consistency and system stability. At the same time, through a reasonable flushing strategy, the system performance and resource utilization efficiency can be optimized.

[0090] Further, in the embodiment of the present invention, step 102 may include the following steps:

[0091] Step 1021: If the value of the first field is different from the value of the second field, trigger a state change notification function.

[0092] In the embodiment of the present invention, two fields are added to monitor the snapshot business request cache module to flush, which are the first field and the second field, namely new_value and old_value, and both fields are assigned false when initialized. When the snapshot module initiates a request to flush cache data to the cache module, the value of new_value has been updated to true, while the value of old_value is false, and old_value is not equal to new_value, and new_value is assigned to old_value, that is, old_value is assigned to true, and the state change notification function is triggered.

[0093] Specifically, a state change notification function is a predefined processing logic used in a system or software application to respond to a specific state change. When the system detects a change in a state field (such as new_value), this function is triggered to perform a series of operations. The following are the specific operations that a state change notification function may include:

[0094] 1. Logging:

[0095] Record state change events, including state values ​​before and after the change, timestamps, and trigger information, to facilitate subsequent troubleshooting and performance analysis.

[0096] 2. Notify the business end:

[0097] Notify the business end or other related components of state changes through message queues, API calls, event buses, or other communication mechanisms.

[0098] 3. Update cache strategy:

[0099] According to the new status value, the operation strategy of the cache module is adjusted, such as switching to a write-through mode (Write-Through) or a delayed write mode (Write-Back).

[0100] 4. Monitoring and alarm:

[0101] If the status change triggers certain preset conditions, the monitoring system may issue an alarm, notify relevant personnel, or automatically perform certain actions.

[0102] 5. Trigger subsequent operations:

[0103] According to the status changes, related subsequent operations are triggered, such as data synchronization, task scheduling, resource allocation, etc.

[0104] 6. User interface update:

[0105] If the state change affects the user interface, the notification function may update the user interface, display new state information, or perform other interface-related operations.

[0106] 7. Data persistence:

[0107] Persist the relevant data of state changes to the database or file system to ensure the security and recoverability of the data.

[0108] 8. Event broadcasting:

[0109] Broadcast the state change as an event to other components or services that subscribe to the event to implement an event-driven architecture.

[0110] 9. Performance optimization:

[0111] According to the status changes, adjust the system's performance parameters, such as adjusting the thread pool size, cache size, etc., to optimize system performance.

[0112] 10. Safety inspection:

[0113] Perform security checks when the state changes to ensure that the system operation complies with security policies and compliance requirements. The design and implementation of the state change notification function depends on the specific system requirements and business logic. Through an effective state change processing mechanism, the system can respond to state changes in real time, ensure data consistency, improve system stability and flexibility, and support troubleshooting and performance optimization.

[0114] Step 1022: The state change notification function notifies the service end of the value of the first field.

[0115] Specifically, the state change notification function notifies the service end that the value of new_value is true.

[0116] Step 1023: If the value of the first field is the same as the value of the second field, the triggering state change notification function is prohibited.

[0117] Specifically, if old_value is equal to new_value, it means that the system state has not changed, there is no need to trigger the state change notification function, and no processing is required.

[0118] Furthermore, in the embodiment of the present invention, step 103 further includes the following steps:

[0119] Step 1031: The service end receives the value of the first field.

[0120] Specifically, after receiving the value of new_value, the service end records the value of new_value, including the receiving time, source, current system status and other information, so as to facilitate subsequent problem location and analysis. Check whether the value of new_value is true or false.

[0121] Step 1032: If the value of the first field is a new value, update the value of the flag bit to a specific value for flushing cache data, and flush cache data.

[0122] Specifically, the business end checks that the value of new_value is true, then gives the volume device a flag requesting data flushing, and updates the value of the flag to a specific value of true, indicating that the data in the cache needs to be written to the back-end storage (such as a hard disk). Then, the cache data flushing process is triggered to flush the data in the cache to the persistent storage hard disk to ensure data consistency and persistence.

[0123] Step 1033: If the value of the first field is an initial value, clear the flag bit.

[0124] Specifically, if the business end detects that the value of new_value is false, the flag bit of the volume request to flush data is cleared, indicating that there is currently no demand to flush data or the request has been processed.

[0125] Further, in the embodiment of the present invention, step 106 may specifically include the following steps:

[0126] Step 1061, after the business end completes flushing the cache data, it notifies the snapshot module that the flushing of the cache data is completed; the snapshot module is used to cancel the request to flush the cache data and reset the value of the first field to the initial value.

[0127] Specifically, when the business end needs to perform a flush operation, after the flush is completed, the business end sends a notification to the snapshot module to inform that the data has been safely written to the backend storage. After receiving the notification, the snapshot module cancels the previous flush request to avoid repeated operations and unnecessary resource consumption. When the snapshot module cancels the flush request, the value of new_value is reset to false.

[0128] Step 1062: The configuration end receives the value of the first field after the snapshot module is reset.

[0129] Specifically, the configuration end will receive the value of new_value as false, indicating that there is currently no demand for refreshing data or the request has been processed.

[0130] Furthermore, in the embodiment of the present invention, step 107 further includes the following steps:

[0131] Step 1071: The configuration end receives the value of the first field after the snapshot module is reset; the value of the first field after the reset is an initial value.

[0132] Specifically, the value of new_value received by the configuration end is false.

[0133] Step 1072: Compare the value of the reset first field with the value of the second field.

[0134] Specifically, the configuration end compares new_value with old_value, and the value of new_value is false, and the value of old_value is true.

[0135] Step 1073: If the value of the reset first field is different from the value of the second field, update the value of the second field to an initial value according to the value of the reset first field.

[0136] Specifically, the value false of new_value is different from the value true of old_value. In this case, according to the value false of new_value, the value of old_value is updated to false.

[0137] Step 1074: the configuration end triggers a subscription function notification to notify the service end of the value of the reset first field.

[0138] Specifically, when old_value is updated, the system triggers the subscription function notification to notify the relevant subscribers of the change in system status, that is, notifying the business end that the value of new_value is false.

[0139] Furthermore, in the embodiment of the present invention, step 108 further includes the following steps:

[0140] Step 1081: The service end receives the value of the reset first field.

[0141] Specifically, the value of new_value received by the business end is false.

[0142] Step 1082: The service end clears the flag bit according to the value of the reset first field being the initial value.

[0143] Specifically, when the business end receives the value of new_value as false, it will clear the data flush flag under the volume request, indicating that the system has returned to normal operation mode and no longer requires write-through mode.

[0144] Step 1083: the business end cancels the flushing of cached data according to the cleared flag.

[0145] Specifically, after the business end clears the flag bit, the system returns to the normal operation mode and no longer executes the operation of refreshing the cached data.

[0146] Through the above operations, the IO write mode is controlled according to the volume data flushing flag. If there is a flag, IO write-through is performed, and if there is no flag, IO write-back is performed. This solves the problem that the current snapshot module service startup requests the cache to flush data, and the storage performance degrades or even IO drops to zero due to the silent switching of the cache module to the write IO mode. Under the premise of ensuring data security, the storage performance fluctuation caused by the startup of the snapshot service is reduced.

[0147] Furthermore, in the embodiment of the present invention, the following steps are also included:

[0148] Step 1: The cache module receives input and output operations submitted by the host.

[0149] Specifically, if the host submits new write IOs to the cache module during the process of flushing cache data, the cache module receives and processes these requests.

[0150] Step 2: Determine whether the value of the flag bit detected by the service end is a specific value.

[0151] Specifically, when processing write IO, the cache module checks whether the volume has set a request flush flag during the cache flush process, and whether the value of the flag is a specific value of true.

[0152] Step 3: If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations received by the cache module.

[0153] Specifically, if the business end receives a value of true for requesting cache to flush data, then the volume of the write IO operation has a flag for requesting cache to flush data, and the flag value is a specific value of true. At this time, the cache cannot be notified of the state of data that has not been written to the disk, because after the flag for requesting cache to flush data is set, the cache module is in write-through mode. If this is not done, after the cache module completes the flush, it will notify the configuration end of clearing the system cache. At this time, if there happens to be a new write IO notification with data that has not been written to the disk, operating the same field of the volume in a short period of time may cause message transmission errors, and the snapshot module will not receive the message to clear the system cache.

[0154] During the IO processing, because the volume request flush data flag is true, the cache module cannot respond to the host write completion after receiving the new write IO submitted by the host and completing the write. It needs to write to the backend disk in the write-through mode before it can respond to the host write completion, that is, it needs to perform a flush cache data operation.

[0155] Step 4: flushing cached data upon receipt of the input / output operation by the cache module, and responding to the completion of the host input / output operation processing.

[0156] Specifically, after the data is written to the backend storage, that is, after the cache data is flushed, the cache module will respond to the host writing completion, informing the host that the IO request has been processed.

[0157] Step 5: If the service end detects that the flag bit is empty, the input and output operations are written into the cache module.

[0158] Specifically, if the volume of the write IO operation does not have a cache flush data flag, the cache module will write the data requested by the host write IO into the cache module, that is, temporarily store it in the cache module.

[0159] Step 6: After the input / output operation is written into the cache module, it is determined whether the input / output operation written into the cache module executes a cache data flush operation according to the value of the flag bit detected by the service end.

[0160] Specifically, after writing the data of the host write IO request to the cache module, it is determined whether the volume is set with a cache data flush flag. If there is a flag, the cache module cannot respond to the host completion after the cache module completes the IO write. It is necessary to wait until the back-end disk is successfully written to notify the cache module, and then the cache module responds to the host write success; if the volume does not have a flush data flag, the host can be notified of the completion after the cache write is completed. The purpose of doing this is: the cache flush scans the hash table and records the current scan position, and does not start from the beginning every time. If the write IO happens to fall on the position that the hash table has scanned before, and this IO does not have a write-through flag set, it will cause this IO to be written to the cache module and then responded to the host completion.

[0161] Step 7: If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations written into the cache module.

[0162] Specifically, after temporarily saving the data of the host write IO request in the cache module, if it is checked that the value of the volume flush cache data flag is a specific value true, it is necessary to perform a flush cache data operation on the data of the host write IO request written into the cache module, that is, write the data to the backend storage (such as a hard disk).

[0163] Step 8, flushing cached data under the input / output operation written into the cache module is completed, and responding to the host input / output operation processing completion.

[0164] Specifically, after the data is written to the backend storage, that is, after the cache data is flushed, the cache module will respond to the host that the write is complete, informing the host that the IO request has been processed.

[0165] Step 9: If the service end detects that the flag bit is empty, after writing the input / output operation into the cache module, it directly responds to the host that the input / output operation processing is completed.

[0166] Specifically, after temporarily storing the data of the host write IO request in the cache module, if it is checked that the volume cache data flush flag is empty, that is, there is no request for the cache flush data flag, the cache module directly responds to the host write completion, informing the host that the IO request has been processed and there is no need to perform the cache data flush operation.

[0167] Through the above operations, after receiving the cache data flushing request task, the cache module can process the write IO request submitted by the host while processing the cache data flushing request task, thereby avoiding the problem of storage performance degradation or even IO dropping to zero caused by the cache module switching to write IO mode silently, and reducing the storage performance fluctuation caused by the startup of the snapshot service while ensuring data security.

[0168] Further, in an embodiment of the present invention, if Figure 2 As shown in the figure, a flowchart of the configuration end notifying the business end is provided. The specific process is as follows:

[0169] 1. The snapshot module requests the cache to refresh data;

[0170] 2. The cache module configuration end receives the request;

[0171] 3. Determine whether the values ​​of the two fields new_value and old_value on the configuration side are equal. If they are the same, it means that the new and old values ​​have not changed and no processing is performed;

[0172] 4. If the values ​​of new_value and old_value are not equal, the new and old values ​​have changed, and the changed status is notified to the cache module business end;

[0173] 5. The cache module business end executes the data flushing operation according to the received status value.

[0174] Through the above operations, the configuration end notifies the business end in real time to ensure that the cached data can be updated in a timely manner. Through the notification mechanism of the configuration end, the business end can immediately flush the cache to ensure that the cached data is consistent with the database data, avoiding problems caused by expired or inconsistent cached data.

[0175] Further, in an embodiment of the present invention, if Figure 3 As shown, a flowchart of the steps for the business end to process input and output operations is provided. The specific process is as follows:

[0176] 1. The host writes IO and submits new IO;

[0177] 2. The cache module receives the new IO submitted by the host and determines whether the volume of the write IO operation has a flag bit for requesting cache to flush data;

[0178] 3. If there is a flag bit, the cache module needs to flush the cache data for the new IO, that is, write the IO to the backend disk before responding to the host completion;

[0179] 4. If there is no flag bit, the IO submitted by the host is written to the system cache, that is, it is temporarily saved in the cache module;

[0180] 5. After the IO submitted by the host is written into the system cache, if the cache module service end receives the value of "request cache flush data" as true, it determines whether the volume of the write IO operation has the flag bit of "request cache flush data";

[0181] 6. If there is a flag bit, the IO written in the cache module will continue to be written to the backend disk and then respond to the host to complete the write;

[0182] 7. If there is no flag bit, the IO submitted by the host is written to the system cache and then the host write is responded to as completed.

[0183] Through the above operations, by judging whether the volume has a request to flush data from the cache, it is ensured that if there is a flag, the data is directly written to the back-end disk, avoiding the problem of inconsistent data between the cache and the back-end disk. In addition, if there is a flag, the cache module will not immediately respond to the host write completion after the write operation is completed, but wait until the data is actually written to the back-end disk before responding. This ensures that the host obtains an accurate write completion status and avoids the problem of inaccurate response time caused by the cache not being written to the disk.

[0184] In an embodiment of the present invention, the configuration end receives a request for flushing cache data initiated by a snapshot module, and updates the initial value of the first field to a new value; if the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the value of the first field to the service end; the service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation; when the service end detects that the value of the flag bit is a specific value, the cache data is flushed; after the service end flushes the cache data, it notifies the snapshot module; the snapshot module resets the value of the first field to the initial value; the configuration end receives the value of the first field reset by the snapshot module; if the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to the initial value, and notifies the service end of the reset value of the first field; the service end clears the flag bit according to the reset value of the first field, and cancels the flushing of cache data. The present snapshot module service startup request cache flushing data solves the problem that the storage performance is reduced or even IO drops to zero due to the silent switching of the cache module to the write IO mode, and reduces the storage performance fluctuation caused by the startup of the snapshot service under the premise of ensuring data security.

[0185] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0186] Reference Figure 4 , shows a schematic diagram of the structure of a device for flushing cache data provided by an embodiment of the present invention, which may specifically include the following modules:

[0187] A request receiving module 201 is used for the configuration end to receive a request for flushing cache data initiated by the snapshot module, and to update the initial value of the first field to a new value; the first field is used to record whether the request for flushing cache data initiated by the snapshot module is currently received, and the initial value of the first field indicates that the request for flushing cache data initiated by the snapshot module is not received;

[0188] The first assignment module 202 is used for, if the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the service end of the value of the first field; the second field is used to record whether the request for flushing cache data initiated by the snapshot module has been received in history, and the initial value of the second field indicates that the request for flushing cache data initiated by the snapshot module has not been received;

[0189] The flag bit updating module 203 is used for the service end to update the value of the flag bit to a specific value for executing the flushing of cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation;

[0190] An execution module 204 is configured to execute flushing of cache data when the service end detects that the value of the flag bit is a specific value;

[0191] Notification module 205, used for notifying the snapshot module after the service end completes flushing cache data; the snapshot module is used for resetting the value of the first field to an initial value;

[0192] A receiving module 206, configured for the configuration end to receive the value of the first field after the snapshot module is reset;

[0193] A second value assignment module 207, configured to update the value of the second field to an initial value by the configuration end if the value of the reset first field is different from the value of the second field, and notify the service end of the value of the reset first field;

[0194] The flag clearing module 208 is used for the service end to clear the flag according to the value of the reset first field and cancel the execution of flushing cache data.

[0195] Optionally, the first assignment module 202 includes:

[0196] a trigger module, configured to trigger a state change notification function if the value of the first field is different from the value of the second field;

[0197] A first notification module, used for the state change notification function to notify the value of the first field to the service end;

[0198] The trigger prohibition module is used to prohibit the triggering of the state change notification function if the value of the first field is the same as the value of the second field.

[0199] Optionally, the flag bit updating module 203 includes:

[0200] A first receiving module, configured for the service end to receive a value of the first field;

[0201] A first flag bit updating module, configured to update the value of the flag bit to a specific value for flushing cache data if the value of the first field is a new value, and flush the cache data;

[0202] The first flag clearing module is used to clear the flag if the value of the first field is an initial value.

[0203] Optionally, the receiving module 206 includes:

[0204] A second notification module is used to notify the snapshot module of the completion of flushing the cached data after the service end completes flushing the cached data; the snapshot module is used to cancel the request for flushing the cached data and reset the value of the first field to an initial value;

[0205] The second receiving module is used for the configuration end to receive the value of the first field after the snapshot module is reset.

[0206] Optionally, the second assignment module 207 further includes:

[0207] A third receiving module, configured to receive, at the configuration end, a value of the first field after the snapshot module is reset; the value of the first field after the reset is an initial value;

[0208] a comparison module, configured to compare the value of the reset first field with the value of the second field;

[0209] A second field updating module, configured to update the value of the second field to an initial value according to the value of the first field after the reset if the value of the first field after the reset is different from the value of the second field;

[0210] A third notification module is used for the configuration end to trigger a state change notification function to notify the service end of the value of the reset first field.

[0211] Optionally, the flag clearing module 208 includes:

[0212] A fourth receiving module, configured for the service end to receive the value of the reset first field;

[0213] A second flag clearing module, configured for the service end to clear the flag according to the reset value of the first field being the initial value;

[0214] The cancellation module is used for the service end to cancel the execution of flushing cache data according to the cleared flag bit.

[0215] In an embodiment of the present invention, the configuration end receives a request for flushing cache data initiated by a snapshot module, and updates the initial value of the first field to a new value; if the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the value of the first field to the service end; the service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation; when the service end detects that the value of the flag bit is a specific value, the cache data is flushed; after the service end flushes the cache data, it notifies the snapshot module; the snapshot module resets the value of the first field to the initial value; the configuration end receives the value of the first field reset by the snapshot module; if the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to the initial value, and notifies the service end of the reset value of the first field; the service end clears the flag bit according to the reset value of the first field, and cancels the flushing of cache data. The present snapshot module service startup request cache flushing data solves the problem that the storage performance is reduced or even IO drops to zero due to the silent switching of the cache module to the write IO mode, and reduces the storage performance fluctuation caused by the startup of the snapshot service under the premise of ensuring data security.

[0216] An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, a method for flushing cache data is implemented.

[0217] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a method for flushing cache data is implemented.

[0218] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0219] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0220] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0221] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0222] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0223] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0224] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0225] The above provides a detailed introduction to a method and device for flushing cache data, an electronic device, and a storage medium. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. Although the implementation methods of the present invention are described above, the above description content and definitions are only for the convenience of understanding the implementation methods of the present invention, and are not intended to limit the present invention. Any modifications and changes made without departing from the spirit and scope of the present invention are within the scope of protection of the present invention. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for flushing cache data, applied to a cache module, wherein the cache module is arranged in a storage system, wherein the storage system further comprises a snapshot module, and wherein the cache module comprises a service end and a configuration end, wherein: The method comprises: The configuration end receives the request for flushing cache data initiated by the snapshot module, and updates the initial value of the first field to a new value; the first field is used to record whether the request for flushing cache data initiated by the snapshot module is currently received, and the initial value of the first field indicates that the request for flushing cache data initiated by the snapshot module is not received; If the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field, and notifies the service end of the value of the first field; the second field is used to record whether the request for flushing cache data initiated by the snapshot module has been received in history, and the initial value of the second field indicates that the request for flushing cache data initiated by the snapshot module has not been received; The service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation; When the service end detects that the value of the flag bit is a specific value, the cache data is flushed; After the business end completes flushing the cache data, it notifies the snapshot module; the snapshot module is used to reset the value of the first field to an initial value; The configuration end receives the value of the first field after the snapshot module is reset; If the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to the initial value, and notifies the business end of the value of the reset first field; the business end clears the flag bit according to the value of the reset first field and cancels the execution of flushing cache data.

2. The method according to claim 1, characterized in that If the value of the first field is different from the value of the second field, the configuration end assigns the value of the first field to the second field and notifies the service end of the value of the first field, including: If the value of the first field is different from the value of the second field, triggering a state change notification function; The state change notification function notifies the service end of the value of the first field; If the value of the first field is the same as the value of the second field, triggering the state change notification function is prohibited.

3. The method according to claim 1, characterized in that The service end updates the value of the flag bit to a specific value for flushing cache data according to the value of the first field, including: The service end receives the value of the first field; If the value of the first field is a new value, updating the value of the flag bit to a specific value for executing a flush of cache data, and executing a flush of cache data; If the value of the first field is an initial value, clear the flag bit.

4. The method according to claim 1, characterized in that: The configuration end receives the value of the first field after the snapshot module is reset, including: After the service end completes flushing the cached data, it notifies the snapshot module that the flushing of the cached data is completed; the snapshot module is used to cancel the request to flush the cached data and reset the value of the first field to the initial value; The configuration end receives the value of the first field after the snapshot module is reset.

5. The method according to claim 1 or 4, characterized in that: If the value of the reset first field is different from the value of the second field, the configuration end updates the value of the second field to an initial value, and notifies the service end of the value of the reset first field, including: The configuration end receives the value of the first field after the snapshot module is reset; the value of the first field after the reset is an initial value; Comparing the value of the reset first field with the value of the second field; If the value of the reset first field is different from the value of the second field, updating the value of the second field to an initial value according to the value of the reset first field; The configuration end triggers a state change notification function to notify the service end of the value of the reset first field.

6. The method according to claim 1, characterized in that The service end clears the flag bit according to the value of the reset first field, and cancels the flushing of cache data, further comprising: The service end receives the reset value of the first field; The service end clears the flag bit according to the reset value of the first field being the initial value; The service end cancels the flushing of cache data according to the cleared flag bit.

7. The method according to claim 1, characterized in that The method further comprises: The cache module receives input and output operations submitted by the host; Determine whether the value of the flag bit detected by the service end is a specific value; If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations received by the cache module; The cache data is flushed in response to the input / output operation received by the cache module, and the input / output operation processing of the host is completed; If the service end detects that the flag bit is empty, the input and output operations are written into the cache module; After the input / output operation is written into the cache module, judging whether the input / output operation written into the cache module performs a cache data flushing operation according to the value of the flag bit detected by the service end; If the service end detects that the value of the flag bit is a specific value, a cache data flushing operation is performed on the input and output operations written into the cache module; The flushing of cached data under the input / output operation written into the cache module is completed, and the processing of the input / output operation of the host is completed; If the service end detects that the flag bit is empty, after writing the input / output operation into the cache module, it directly responds to the host that the input / output operation processing is completed.

8. A device for refreshing cache data, characterized in that: The device comprises: A request receiving module, used for the configuration end to receive the request for flushing cache data initiated by the snapshot module, and to update the initial value of the first field to a new value; the first field is used to record whether the request for flushing cache data initiated by the snapshot module is currently received, and the initial value of the first field indicates that the request for flushing cache data initiated by the snapshot module is not received; a first assignment module, configured to assign the value of the first field to the second field by the configuration end if the value of the first field is different from the value of the second field, and notify the service end of the value of the first field; the second field is used to record whether the request for flushing cache data initiated by the snapshot module has been received in history, and the initial value of the second field indicates that the request for flushing cache data initiated by the snapshot module has not been received; A flag bit updating module, used for the service end to update the value of the flag bit to a specific value for flushing cache data according to the value of the first field; the flag bit is set in the volume of the input and output operation; An execution module, configured to execute flushing of cache data when the service end detects that the value of the flag bit is a specific value; A notification module, configured to notify the snapshot module after the service end completes flushing cache data; the snapshot module is configured to reset the value of the first field to an initial value; A receiving module, used for the configuration end to receive the value of the first field after the snapshot module is reset; A second assignment module, configured to update the value of the second field to an initial value by the configuration end if the value of the reset first field is different from the value of the second field, and notify the service end of the value of the reset first field; The flag clearing module is used for the service end to clear the flag according to the value of the first field after the reset, and cancel the execution of flushing the cached data.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for flushing cache data as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for flushing cache data according to any one of claims 1 to 7 is implemented.