Method and system for optimizing cache dirty brushing data of file storage gateway

By dynamically monitoring and classifying dirty data IO in the file storage system, using balanced binary tree and aggregation/slicing slice brushing strategies, the problems of low efficiency of brushing disks and dirty data accumulation in traditional systems are solved, and efficient brushing disks and adaptive optimization are achieved.

CN119806397AActive Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411773107.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

When traditional file storage systems deal with complex I/O models, the brushing efficiency is low and dirty data is accumulated, resulting in system performance bottlenecks.

Method used

By dynamically monitoring the dirty data IO operations in the cache, identify the model and size of the IO, use a balanced binary tree to convert the unordered random IO model into an ordered IO, and divide it into small IO and large IO categories according to the IO size. Aggregate brushing strategy or segmented slice concurrent brushing strategy is adopted, and the threshold is dynamically adjusted in combination with the cache and disk usage.

Benefits of technology

It improves the efficiency of disk brushing, reduces the number of disk I/O times, improves the processing speed of large IO operations, and realizes adaptive optimization of disk brushing strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806397A_ABST
    Figure CN119806397A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for optimizing and caching dirty data by a file storage gateway. The method comprises the following steps: dynamically monitoring a dirty data IO (Input / Output) operation in a cache, and identifying a model and a size of IO; according to the model and the size of the IO, using balanced binary tree data to convert dirty data IO generated by a disordered random IO model into ordered dirty data IO; dividing the dirty data IO into a small IO class and a large IO class according to the size sequence and the classification threshold value of the dirty data IO; and aggregating or splitting the dirty data IO by applying an aggregation threshold value and a splitting threshold value according to the category, and distributing the dirty data IO to a flush thread. And adjusting a classification threshold value, an aggregation threshold value and a splitting threshold value according to the utilization rate of the query memory block and the disk. The method has the advantages that the disk brushing efficiency is improved, and the IO operation processing speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to the field of file storage technology, and more particularly to a method, system, electronic device and storage medium for optimizing cache flushing of dirty data in a file storage gateway. Background Art

[0002] Cache is a user-mode memory-based technology that accelerates IO operations. In storage systems, cache effectively alleviates the access pressure of backend storage in terms of large-scale data processing, low latency, and high concurrent access, but its disk flushing mechanism exposes performance bottlenecks when dealing with complex I / O models.

[0003] Traditional disk flushing strategies, such as scheduled disk flushing and full disk flushing, often cannot effectively cope with complex and changeable IO patterns, resulting in reduced disk flushing efficiency and accumulation of dirty data. The so-called dirty data refers to data that has been modified in memory but has not yet been written back to the disk. The small IO model is prone to frequent calls to system resources due to its small data volume and high frequency, thereby reducing system performance. The large IO model has a large amount of data, but improper handling may also lead to long-term occupation of system resources, causing performance bottlenecks.

[0004] Therefore, how to provide a method, system, electronic device and storage medium for optimizing cache flushing of dirty data in a file storage gateway has become a technical problem that urgently needs to be solved in the field. Summary of the invention

[0005] The object of the present invention is to provide a method, system, electronic device and storage medium for optimizing cache flushing of dirty data in a file storage gateway.

[0006] According to a first aspect of the present invention, there is provided a file storage gateway optimized cache flushing dirty data, comprising:

[0007] According to the model and size of the dirty data IO, the dirty data IO generated by the disordered random dirty data IO model is converted into ordered dirty data IO by applying balanced binary tree data;

[0008] Copy the dirty data IO to the memory block, use the index value as the sorting key value, and insert it sequentially into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO;

[0009] Step S3: According to the obtained ordered dirty data IO size sequence, the dirty data IO is divided into two categories: small IO category and large IO category according to the preset classification threshold; according to the category, the aggregation threshold and the splitting threshold are applied to aggregate or split the dirty data IO, and distribute them to the flush thread.

[0010] In step S3, the dirty data IO is divided into two categories: small IO category and large IO category according to the preset classification threshold, specifically:

[0011] When the size of the dirty data IO is between 1B and 256K, it is identified as a small IO; when the size of the dirty data IO is greater than 256K, it is identified as a large IO;

[0012] The aggregation threshold is between 2M and 16M;

[0013] The split threshold is between 1M and 8M.

[0014] Step S4: adjusting the classification threshold, aggregation threshold and splitting threshold according to the usage of the query memory block and the disk;

[0015] According to the method of the first aspect of the present invention, in step S1, the method further includes:

[0016] The starting index of the memory block is calculated according to the offset of the dirty data IO, and the number of required memory blocks and the ending index are calculated according to the size of the dirty data IO.

[0017] According to the method of the first aspect of the present invention, in step S2, applying balanced binary tree data to convert dirty data IO generated by an unordered random IO model into ordered dirty data IO according to the model and size of the IO includes:

[0018] The dirty data IO is copied to the memory block, the index value is used as the sorting key value, and it is sequentially inserted into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO.

[0019] According to the method of the first aspect of the present invention, in step S3, applying the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO according to the category includes:

[0020] If the dirty data IO is a small IO class, the dirty data IO is aggregated using the aggregation threshold and distributed to the flush thread; if the dirty data IO is a large IO class, the dirty data IO is split using the split threshold and distributed to the flush thread.

[0021] A second aspect of the present invention discloses a file storage gateway optimized cache dirty data flushing system, the system comprising:

[0022] A first processing module is configured to dynamically monitor dirty data IO operations in the cache and identify the model and size of dirty data IO;

[0023] A second processing module is configured to convert the dirty data IO generated by the disordered random dirty data IO model into ordered dirty data IO by applying balanced binary tree data according to the model and size of the dirty data IO;

[0024] Copy the dirty data IO to the memory block, use the index value as the sorting key value, and insert it sequentially into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO;

[0025] The third processing module is configured to classify the dirty data IO into two categories, small IO category and large IO category, according to the obtained ordered dirty data IO size sequence and the preset classification threshold; according to the category, apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO, and distribute them to the flush thread;

[0026] According to the preset classification threshold, the dirty data IO is divided into two categories: small IO category and large IO category. Specifically:

[0027] When the size of the dirty data IO is between 1B and 256K, it is identified as a small IO; when the size of the dirty data IO is greater than 256K, it is identified as a large IO;

[0028] The aggregation threshold is between 2M and 16M;

[0029] The split threshold is between 1M and 8M.

[0030] The fourth processing module is configured to adjust the classification threshold, the aggregation threshold and the splitting threshold according to the usage of the query memory block and the disk;

[0031] According to the system of the second aspect of the present invention, the first processing module is specifically configured as follows:

[0032] The starting index of the memory block is calculated according to the offset of the dirty data IO, and the number of required memory blocks and the ending index are calculated according to the size of the dirty data IO.

[0033] According to the system of the second aspect of the present invention, the second processing module is specifically configured to convert dirty data IO generated by the disordered random IO model into ordered dirty data IO by applying balanced binary tree data according to the model and size of the IO, including:

[0034] The dirty data IO is copied to the memory block, the index value is used as the sorting key value, and it is sequentially inserted into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO.

[0035] According to the system of the second aspect of the present invention, the third processing module is specifically configured to, according to the category, apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO, including:

[0036] If the dirty data IO is a small IO class, the dirty data IO is aggregated using the aggregation threshold and distributed to the flush thread; if the dirty data IO is a large IO class, the dirty data IO is split using the split threshold and distributed to the flush thread.

[0037] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the steps of any one of the methods for optimizing cache flushing of dirty data in a file storage gateway in the first aspect of the present disclosure.

[0038] In a fifth aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.

[0039] The technical solution provided by this application may have the following beneficial effects:

[0040] In the file storage gateway optimized cache dirty data flushing solution provided by the present application, when the IO of dirty data is a small IO operation, an aggregated disk flushing strategy is adopted, and a certain number of small IO operations are collected through the buffer before the disk is flushed, which can reduce the number of disk I / Os, thereby improving the efficiency of disk flushing. When the IO of dirty data is a large IO operation, a split slice concurrent disk flushing strategy is adopted, which can make full use of the concurrent read and write capabilities of the disk and improve the processing speed of large IO operations. The biggest advantage of this application is that the disk flushing threshold can be adaptively adjusted: by combining the use of cache resources and disk utilization, the threshold for small IO merged disk flushing and the concurrency of large IO concurrent disk flushing can be dynamically adjusted, thereby realizing adaptive optimization of the disk flushing strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a method for optimizing cache flushing of dirty data in a file storage gateway provided according to an embodiment;

[0042] Figure 2 It is an overall architecture diagram provided according to an embodiment;

[0043] Figure 3 The front-end write IO processing flow provided according to the embodiment;

[0044] Figure 4 A back-end dirty data flushing process according to an embodiment;

[0045] Figure 5A structural diagram of a file storage gateway optimization cache dirty data flushing system according to an embodiment of the present invention;

[0046] Figure 6 is a structural diagram of an electronic device according to an embodiment of the present invention;

[0047] Figure 7 A structural diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0049] The present invention discloses a method for optimizing cache dirty data flushing in a file storage gateway, aiming at optimizing the problem of low efficiency of multi-model IO dirty data flushing in a high-speed cache system and system performance degradation caused by untimely dirty data processing. The method dynamically monitors IO operations in the cache, identifies the model and size of IO, and dynamically adjusts the IO classification standard to ensure accurate distinction of IO and avoid performance loss caused by misclassification. IO is collected through a buffer, and then the collected IO requests are sorted by means of a balanced binary tree data organization form, so that the dirty data generated by the disordered random IO model is converted into ordered IO. According to the monitoring results, the dirty data IO operations are divided into two categories, small IO and large IO, and different flushing methods are adopted respectively. Small IO operations adopt an aggregated disk flushing strategy through a buffer. At the same time, a certain number of small IO operations are collected before disk flushing, which reduces the number of disk I / O times and improves disk flushing efficiency. Large IO operations adopt a split-slice concurrent disk flushing strategy to fully utilize the concurrent read and write capabilities of the disk and improve the processing speed of large IO operations. In addition, the threshold for small IO merged disk flushing and the concurrency of large IO concurrent disk flushing are dynamically adjusted in combination with cache resource usage and disk utilization, to achieve adaptive optimization of the disk flushing strategy.

[0050] The following specific embodiments are used to illustrate the method for optimizing cache dirty data flushing for the file storage gateway provided by the present application.

[0051] Embodiment 1:

[0052] According to a first aspect of the present invention, the present invention discloses a method for optimizing cache flushing of dirty data in a file storage gateway. Figure 1 The flowchart of a method for optimizing cache flushing of dirty data in a file storage gateway according to an embodiment of the present invention is as follows Figure 1 and Figure 2As shown, the method includes:

[0053] Step S1, dynamically monitor dirty data IO operations in the cache and identify the model and size of the IO;

[0054] IO (Input / Output) is a basic concept in computer science, which refers to the process of exchanging data between a computer system and external devices. IO operations include data input and output. Specifically, input operations are the transfer of data from external devices (such as keyboards, mice, etc.) to the computer's memory, while output operations are the transfer of data from the memory to external devices.

[0055] In step S1, dirty data IO operations in the cache are dynamically monitored to identify the model and size of the IO. The IO classification standard is dynamically adjusted to ensure accurate distinction of IO and avoid performance loss caused by misclassification.

[0056] In some embodiments, in step S1, the method further includes: calculating a start index of a memory block according to an offset of the dirty data IO, and calculating a required number of memory blocks and an end index according to a size of the dirty data IO.

[0057] Specifically, Figure 3 As shown in the figure, when data is written, the IO model recognition module is first entered to identify the IO model and size by counting the IO data within a certain period; when data is written, the starting index of the memory block is calculated according to the offset of the IO, and the required number of memory blocks and the ending index are calculated according to the size.

[0058] Step S2: according to the model and size of the IO, using balanced binary tree data to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO;

[0059] In some embodiments, in step S2, Figure 3 As shown, according to the model and size of the IO, applying balanced binary tree data to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO includes: copying the dirty data IO to a memory block, using the index value as a sorting key value, sequentially inserting it into a self-balancing binary tree search, and converting the dirty data IO generated by the disordered random IO model into ordered dirty data IO.

[0060] The method of converting dirty data IO generated by the disordered random IO model into ordered dirty data IO by using balanced binary tree data is as follows:

[0061] When writing dirty data IO generated by the disordered random IO model, the starting index of the memory block is calculated according to the IO offset, the number of memory blocks required and the ending index are calculated according to the size, and the data is copied to the memory block. The index value is used as the sorting key value and sequentially inserted into the self-balancing binary tree search, thereby obtaining ordered dirty data IO;

[0062] Step S3: Divide the dirty data IO into two categories: small IO category and large IO category according to the size order of the dirty data IO and the classification threshold;

[0063] In step S3, the dirty data IO is divided into two categories: small IO category and large IO category according to the preset classification threshold, specifically:

[0064] When the size of the dirty data IO is between 1B and 256K (including 1B and 256K), it is identified as a small IO; when the size of the dirty data IO is greater than 256K, it is identified as a large IO;

[0065] According to the category, an aggregation threshold and a splitting threshold are applied to aggregate or split the dirty data IOs, and distribute them to flush threads.

[0066] Flush: refers to clearing or refreshing the cache so that fixed data can be read or written more quickly.

[0067] Flush threads: refers to the threads in the cache system that are responsible for writing back dirty pages. These threads are named with "flush-" plus the device name. Their main function is to periodically write back dirty pages in the system to disk to ensure data persistence and consistency.

[0068] Application scenarios of flush threads: flush threads are mainly used to ensure data persistence and consistency. In file system operations, when data is modified, it may be temporarily stored in the memory buffer instead of being written directly to the disk. The flush thread ensures data integrity and consistency by periodically writing back these dirty pages to the disk. In addition, the flush thread can also help optimize system performance by reducing the number of disk accesses and increasing the rate of flushing dirty data to improve system response speed.

[0069] It should be noted that the numerical range of the aggregation threshold mentioned here is only a preferred method provided by the present application. Similarly, the numerical value of the splitting threshold is also only a preferred method provided by the present application. Neither should be understood as a limitation of the present application. In practical applications, reasonable selection can be made according to specific circumstances.

[0070] In step S3, if Figure 4As shown, according to the size order and classification threshold of dirty data IO, dirty data IO is divided into two categories: small IO category and large IO category; according to the category, the aggregation threshold and splitting threshold are applied to aggregate or split the dirty data IO and distribute it to the flush thread.

[0071] In some embodiments, in step S3, applying an aggregation threshold and a splitting threshold to aggregate or split the dirty data IO according to the category includes:

[0072] If the dirty data IO is a small IO type, the aggregation threshold is used to aggregate the dirty data IO, that is, a certain number of small IO operations are collected through the buffer before flushing the disk, reducing the number of disk I / O times, improving the flushing efficiency, and distributing it to the flush thread; if the dirty data IO is a large IO type, the split threshold is used to split the dirty data IO and distribute it to the flush thread, making full use of the concurrent read and write capabilities of the disk and improving the processing speed of large IO operations.

[0073] Among them, the general aggregation threshold is between 2M and 16M (including 2M and 16M); the splitting threshold is between 1M and 8M (including 1M and 8M).

[0074] Specifically, after the dirty data is written to disk, the memory block resources are released and the statistical information is updated.

[0075] Step S4: adjusting the classification threshold, aggregation threshold and splitting threshold according to the usage of the query memory block and the disk;

[0076] In step S4, the classification threshold, aggregation threshold, and split threshold are adjusted according to the usage of the query memory block and disk. Combined with the cache resource usage and disk usage, the threshold for small IO merge disk flushing and the concurrency of large IO concurrent disk flushing are dynamically adjusted to achieve adaptive optimization of the disk flushing strategy.

[0077] In summary, the solution proposed in the present invention enables small IO operations to adopt an aggregated disk flushing strategy, which collects a certain number of small IO operations through the buffer before flushing the disk, reducing the number of disk I / O times and improving the disk flushing efficiency; large IO operations adopt a split-slice concurrent disk flushing strategy, which makes full use of the concurrent read and write capabilities of the disk and improves the processing speed of large IO operations; combined with the use of cache resources and disk utilization, the threshold for small IO merged disk flushing and the concurrency of large IO concurrent disk flushing are dynamically adjusted to achieve adaptive optimization of the disk flushing strategy.

[0078] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, 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 optional embodiments, and the actions involved are not necessarily required by the present application.

[0079] Corresponding to the method embodiment in Example 1, the present application discloses a file storage gateway optimized cache dirty data flushing system. The file storage gateway optimized cache dirty data flushing system provided by the present application is described below.

[0080] Embodiment 2:

[0081] See also Figure 5 , is a structural diagram of a file storage gateway optimization cache dirty data flushing system according to an embodiment of the present invention; Figure 5 As shown, the system 100 includes: a first processing module 101 , a second processing module 102 , a third processing module 103 and a fourth processing module 104 .

[0082] The first processing module 101 is configured to dynamically monitor dirty data IO operations in the cache and identify the model and size of the IO;

[0083] The second processing module 102 is configured to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO by applying balanced binary tree data according to the model and size of the IO;

[0084] The third processing module 103 is configured to classify the dirty data IO into two categories, small IO category and large IO category, according to the size order of the dirty data IO and the classification threshold; according to the category, apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO, and distribute it to the flush thread;

[0085] The fourth processing module 104 is configured to adjust the classification threshold, the aggregation threshold and the splitting threshold according to the usage of the query memory block and the disk.

[0086] In one implementation, the first processing module 101 is specifically configured to calculate the start index of the memory block according to the offset of the dirty data IO, and calculate the required number of memory blocks and the end index according to the size of the dirty data IO.

[0087] Specifically, Figure 3As shown, when data is written in the foreground, the IO model identification module can be entered first to identify the IO model and size by counting the IO data within a certain period; and when data is written, the starting index of the memory block is calculated according to the IO offset, and the required number of memory blocks and the end index are calculated according to the size.

[0088] In one implementation, the second processing module 102 is specifically configured as follows: Figure 3 As shown, according to the model and size of the IO, applying balanced binary tree data to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO includes: copying the dirty data IO to a memory block, using the index value as a sorting key value, sequentially inserting it into a self-balancing binary tree search, and converting the dirty data IO generated by the disordered random IO model into ordered dirty data IO.

[0089] In one implementation, the third processing module 103 is specifically configured to, according to the category, apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO, including: if the dirty data IO is a small IO category, use the aggregation threshold to aggregate the dirty data IO, that is, collect a certain number of small IO operations through the buffer and then flush the disk, reduce the number of disk I / O times, improve the disk flushing efficiency, and distribute it to the flush thread; if the dirty data IO is a large IO category, use the splitting threshold to split the dirty data IO and distribute it to the flush thread, make full use of the concurrent read and write capabilities of the disk, and improve the processing speed of large IO operations.

[0090] Furthermore, after the dirty data is written to the disk, the memory block resources can be released and the statistical information can be updated.

[0091] In the file storage gateway optimized cache dirty data flushing solution provided by the present application, when the IO of dirty data is a small IO operation, an aggregated disk flushing strategy is adopted, and a certain number of small IO operations are collected through the buffer before the disk is flushed, which can reduce the number of disk I / Os, thereby improving the efficiency of disk flushing. When the IO of dirty data is a large IO operation, a split slice concurrent disk flushing strategy is adopted, which can make full use of the concurrent read and write capabilities of the disk and improve the processing speed of large IO operations. The biggest advantage of this application is that the disk flushing threshold can be adaptively adjusted: by combining the use of cache resources and disk utilization, the threshold for small IO merged disk flushing and the concurrency of large IO concurrent disk flushing can be dynamically adjusted, thereby realizing adaptive optimization of the disk flushing strategy.

[0092] As for the system 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.

[0093] The electronic device and storage medium provided by this application are described below.

[0094] Embodiment 3:

[0095] The present application discloses an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method for optimizing cache flushing of dirty data in a file storage gateway in any one of the embodiments 1 disclosed in the present invention are implemented.

[0096] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0097] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0098] Figure 6 The present application shows a block diagram of an electronic device 800. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0099] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0100] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0101] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0102] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0103] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0104] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0105] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0106] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0107] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0108] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0109] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0110] Embodiment 4:

[0111] Figure 719 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.

[0112] Reference Figure 7 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0113] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0114] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or 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 device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0116] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0117] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0119] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0122] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for optimizing cache flushing of dirty data in a file storage gateway, characterized in that: include: Dynamically monitor dirty data IO operations in the cache and identify the model and size of dirty data IO; According to the model and size of the dirty data IO, the dirty data IO generated by the disordered random dirty data IO model is converted into ordered dirty data IO by applying balanced binary tree data; Copy the dirty data IO to the memory block, use the index value as the sorting key value, and insert it sequentially into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO; According to the obtained ordered dirty data IO size sequence, the dirty data IO is divided into two categories, small IO category and large IO category, according to the preset classification threshold; according to the category, the aggregation threshold and the splitting threshold are applied to aggregate or split the dirty data IO, and distribute them to the flush thread; Adjust the classification threshold, aggregation threshold, and split threshold based on the query memory block and disk usage.

2. The method for optimizing cache flushing of dirty data in a file storage gateway according to claim 1, characterized in that: In step S1, the method further includes: The starting index of the memory block is calculated according to the offset of the dirty data IO, and the number of required memory blocks and the ending index are calculated according to the size of the dirty data IO.

3. The method for optimizing cache flushing of dirty data in a file storage gateway according to claim 2, characterized in that: In step S3, the dirty data IO is divided into two categories: small IO category and large IO category according to the preset classification threshold, specifically: When the size of the dirty data IO is between 1B and 256K, it is identified as a small IO; when the size of the dirty data IO is greater than 256K, it is identified as a large IO.

4. The method for optimizing cache flushing of dirty data in a file storage gateway according to claim 1, characterized in that: In the step S3, applying the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO according to the category includes: If the dirty data IO is a small IO class, the dirty data IO is aggregated using the aggregation threshold and distributed to the flush thread; if the dirty data IO is a large IO class, the dirty data IO is split using the split threshold and distributed to the flush thread.

5. A file storage gateway optimized cache dirty data flushing system, characterized in that: The system comprises: A first processing module is configured to dynamically monitor dirty data IO operations in the cache and identify the model and size of dirty data IO; A second processing module is configured to convert the dirty data IO generated by the disordered random dirty data IO model into ordered dirty data IO by applying balanced binary tree data according to the model and size of the dirty data IO; Copy the dirty data IO to the memory block, use the index value as the sorting key value, and insert it sequentially into the self-balancing binary tree search, so as to convert the dirty data IO generated by the disordered random IO model into ordered dirty data IO; The third processing module is configured to classify the dirty data IO into two categories, small IO category and large IO category, according to the obtained ordered dirty data IO size sequence and a preset classification threshold; according to the category, apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO, and distribute them to the flush thread; The fourth processing module is configured to adjust the classification threshold, the aggregation threshold and the splitting threshold according to the usage of the query memory block and the disk.

6. The file storage gateway optimized cache dirty data flushing system according to claim 5, characterized in that: The first processing module is specifically configured as follows: The starting index of the memory block is calculated according to the offset of the dirty data IO, and the number of required memory blocks and the ending index are calculated according to the size of the dirty data IO.

7. The file storage gateway optimized cache dirty data flushing system according to claim 6, characterized in that: The second processing module is specifically configured to identify the dirty data IO as a small IO when the size of the dirty data IO is between 1B and 256K; and identify the dirty data IO as a large IO when the size of the dirty data IO is greater than 256K.

8. The file storage gateway optimized cache dirty data flushing system according to claim 5, characterized in that: The third processing module is specifically configured to apply the aggregation threshold and the splitting threshold to aggregate or split the dirty data IO according to the category, including: If the dirty data IO is a small IO class, the dirty data IO is aggregated using the aggregation threshold and distributed to the flush thread; if the dirty data IO is a large IO class, the dirty data IO is split using the split threshold and distributed to the flush thread.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the method for optimizing cache dirty data flushing for a file storage gateway described in any one of claims 1 to 4 are 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 the processor, the steps in the method for optimizing cache dirty data flushing for a file storage gateway described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Cached data disk brushing method and device

    CN104461936A

  • Organizing management method and system of dirty data in cache and storage system

    CN107844436A

  • Data down-refreshing method and related device

    CN109783023A

  • Dram-based storage caching method and dram-based smart terminal

    US20190258582A1