Dirty page data volume updating method and device, storage medium and electronic equipment
By dividing the storage device into multiple sub-storage devices to update the amount of dirty page data in parallel, the problem of low update efficiency of dirty page data data in the prior art is solved, and more efficient IO performance is achieved.
Patent Information
- Application Number
- CN202410992984.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, when the amount of dirty page data changes in multiple small volumes, locks need to be acquired one by one, resulting in low system IO performance.
The storage device is divided into multiple sub-storage devices. Each sub-storage device records the current amount of dirty page data, and updates the initial amount of data of the target sub-storage device by detecting the update status and changing the data volume of the data request, and maps it to the storage device. The total amount of dirty page data is realized to realize parallel updates of each sub-storage device.
It improves the efficiency of updating the amount of dirty page data, reduces the time required to update the total amount of data of storage devices, and improves the system IO performance.
Smart Images

Figure CN118915967A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the computer field, and in particular, to a method and device for updating dirty page data volume, a storage medium, and an electronic device. Background Art
[0002] In the related art, the accumulated dirty page data volume is only recorded on the large volume, and the thread corresponding to the small volume needs to obtain a read-write lock (a lock can only be obtained by one small volume at a time) to modify the amount of dirty data recorded in the large volume. In this way, when the amount of dirty page data changes in multiple small volumes, each small volume needs to obtain a lock one by one to modify the amount of dirty data, resulting in low IO performance of the system. Summary of the invention
[0003] Embodiments of the present application provide a method and device for updating dirty page data volume, a storage medium, and an electronic device, so as to at least solve the problem of low updating efficiency of dirty page data volume in the related art.
[0004] According to an embodiment of the present application, a method for updating the amount of dirty page data is provided, wherein a storage device is divided into a plurality of sub-storage devices, each of the plurality of sub-storage devices records the amount of data of a currently corresponding dirty page, and the storage device is used to map the sum of the amount of data of the currently corresponding dirty pages recorded in each sub-storage device to the total amount of data of the dirty pages of the storage device, and the method is applied to each target sub-storage device in the plurality of sub-storage devices, comprising: after executing a received target data request, detecting an update status of the amount of data of the dirty page recorded in the target sub-storage device, wherein the target data request is used to request a data operation to be performed on the data in the target sub-storage device, and the updating The status is used to indicate whether the data operation requested by the target data request has caused a change in the data amount of dirty pages recorded in the target sub-storage device; when the update status is used to indicate that the data operation requested by the target data request has caused a change in the data amount of dirty pages recorded in the target sub-storage device, the changed data amount of the change in the data amount of dirty pages recorded in the target sub-storage device caused by the data operation requested by the target data request is detected; the changed data amount is updated to the initial data amount of dirty pages currently recorded in the target sub-storage device to obtain the target data amount, wherein the storage device is used to map the target data amount to the total data amount of dirty pages of the storage device.
[0005] In an exemplary embodiment, multiple threads are also deployed in the storage device, and the multiple threads correspond one-to-one to the multiple sub-storage devices. The detection of the change in the amount of data of dirty pages recorded in the target sub-storage device caused by the data operation requested to be performed by the target data request includes: controlling the target thread corresponding to the target sub-storage device among the multiple threads to pause responding to the reference data request received by the target sub-storage device, wherein the reference data request is used to request to perform data operations on the data in the target sub-storage device; controlling the target thread to detect the changed data amount.
[0006] In an exemplary embodiment, the controlling the target thread to detect the changed data amount includes: when the target sub-storage device includes N sub-storage devices, the target thread includes N threads, the target data request includes N data requests, and the changed data amount includes N data amounts, by executing the following steps, controlling the i-th thread among the N threads to detect the i-th data amount among the N data amounts, wherein the i-th data amount is a change in the data amount of dirty pages recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests. wherein N is a positive integer, and i is a positive integer less than or equal to N: controlling the i-th thread to search for the i-th group of target data from the i-th group of candidate data, wherein the i-th group of candidate data is data obtained when the data operation requested by the i-th data request is completed on the i-th group of initial data in the i-th sub-storage device, the i-th group of candidate data is different from the i-th group of initial data, and the i-th group of target data is data in the i-th group of candidate data that is not stored in the i-th sub-storage device; controlling the target thread to extract the sum of the data amounts of each data in the i-th group of target data to obtain the i-th data amount.
[0007] In an exemplary embodiment, the storage device is further deployed with a plurality of threads, the plurality of threads corresponding one-to-one to the plurality of sub-storage devices, and the detecting the update status of the data volume of the dirty pages recorded in the target sub-storage device includes: controlling the target thread corresponding to the target sub-storage device in the plurality of threads to detect the matching degree between the target data and the initial data, wherein the target data is data obtained after executing the data operation requested by the target data request on the initial data in the target sub-storage device, and the matching degree is used to indicate whether the target data is consistent with the initial data; in a case where the matching degree is used to indicate that the target data is inconsistent with the initial data, detecting the storage status of the target data, wherein the storage status is used to indicate whether the target data is stored in the target sub-storage device; in a case where the storage status is used to indicate that the target data is not stored in the target sub-storage device, determining the update status as indicating that the data operation requested by the target data request has resulted in a change in the data volume of the dirty pages recorded in the target sub-storage device.
[0008] In an exemplary embodiment, each of the multiple sub-storage devices also stores a first variable, and the first variable is used to record the data volume of the dirty page currently corresponding to the sub-storage device. The storage device also has multiple threads deployed, and the multiple threads correspond to the multiple sub-storage devices one by one. The updating of the changed data volume to the initial data volume of the dirty page currently recorded by the target sub-storage device to obtain the target data volume includes: controlling the target thread corresponding to the target sub-storage device among the multiple threads to detect the running status of the target sub-storage device, wherein the running status is used to indicate whether the data is allowed to be stored in the target sub-storage device; when the running status is used to indicate that the data is allowed to be stored in the target sub-storage device, controlling the target thread to update the changed data volume to the initial data volume of the dirty page currently recorded by the target sub-storage device to obtain the target data volume.
[0009] In an exemplary embodiment, the control of the target thread to update the changed data amount to the initial data amount of the dirty page currently recorded by the target sub-storage device to obtain the target data amount includes: controlling the target thread to extract the initial data amount of the dirty page recorded by the first variable; controlling the target thread to update the data amount of the dirty page recorded by the first variable to the target data amount, wherein the target data amount is equal to the sum of the initial data amount and the changed data amount; a second variable is deployed in the storage device, and the second variable is used to record the total data amount of the dirty pages of the storage device. The method also includes: the target sub-storage device includes N sub-storage devices, the changed data amount includes N data amounts, and the target data request includes N data requests. In the case of, the i-th data amount among the N data amounts is mapped to the total data amount of dirty pages of the storage device by executing the following steps, wherein the i-th data amount is the changed data amount of the change in the data amount of dirty pages recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests, and N is a positive integer: extracting the current total data amount of dirty pages of the storage device recorded by the second variable, wherein the current total data amount is equal to the sum of the data amounts of the currently corresponding dirty pages recorded in each sub-storage device; updating the data amount of dirty pages recorded by the second variable to the target total data amount, wherein the target total data amount is equal to the sum of the current total data amount and the i-th data amount.
[0010] In an exemplary embodiment, a third variable is also deployed in the storage device, wherein the third variable is used to record the total data volume of the locked page of the storage device, and the method further includes: when the running state is used to indicate that data storage in the target sub-storage device is not allowed, controlling the target thread to extract the initial total data volume of the locked page of the storage device recorded by the third variable; controlling the target thread to update the initial total data volume recorded by the third variable to a reference total data volume, wherein the reference total data volume is equal to the sum of the initial total data volume and the changed data volume.
[0011] According to another embodiment of the present application, a device for updating the amount of dirty page data is provided, comprising: a storage device is divided into multiple sub-storage devices, each of the multiple sub-storage devices records the amount of data of the currently corresponding dirty page, the storage device is used to map the sum of the amount of data of the currently corresponding dirty page recorded in each sub-storage device to the total amount of data of the dirty pages of the storage device, the device is applied to each target sub-storage device in the multiple sub-storage devices, the device comprises: a first detection module, used to detect the update status of the amount of data of the dirty page recorded in the target sub-storage device after executing a received target data request, wherein the target data request is used to request to perform a data operation on the data in the target sub-storage device, and the update The status is used to indicate whether the data operation requested by the target data request has caused a change in the data volume of dirty pages recorded in the target sub-storage device; a second detection module is used to detect the changed data volume of the dirty pages recorded in the target sub-storage device caused by the data operation requested by the target data request, when the update status is used to indicate that the data operation requested by the target data request has caused a change in the data volume of dirty pages recorded in the target sub-storage device; an update module is used to update the changed data volume to the initial data volume of dirty pages currently recorded in the target sub-storage device to obtain a target data volume, wherein the storage device is used to map the target data volume to the total data volume of dirty pages of the storage device.
[0012] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0013] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0014] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0015] Through the present application, the sub-storage devices to which the storage device is divided record the data volume of the currently corresponding dirty pages. When the data operation requested to be executed by the data request causes the data volume of the dirty pages corresponding to the sub-storage device to change, the changed data volume can be updated to the data volume of the dirty pages corresponding to the sub-storage device, but is not limited to, and the storage device maps the sum of the data volumes of the dirty pages corresponding to each of the sub-storage devices to which the storage device is divided. When the number of dirty pages of one of the sub-storage devices changes, the total data volume of the dirty pages of the storage device will be updated accordingly. In this way, each sub-storage device updates its own dirty page data volume and the total data volume of the dirty pages of the storage device in parallel, reducing the time required to update the total data volume of the dirty pages of the storage device. Therefore, the problem of low efficiency in updating the dirty page data volume can be solved, thereby achieving the effect of improving the update efficiency of the dirty page data volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a hardware structure block diagram of a server device of a method for updating dirty page data volume in an embodiment of the present application;
[0017] Figure 2 is a flowchart of a method for updating dirty page data volume according to an embodiment of the present application;
[0018] Figure 3 is a schematic diagram of an optional large volume divided into multiple small volumes according to an embodiment of the present application;
[0019] Figure 4 is a schematic diagram of an optional thread updating the data amount of a dirty page of a sub-storage device according to an embodiment of the present application;
[0020] Figure 5 This is a schematic diagram of updating the amount of data on a locked page in an optional volume offline scenario according to an embodiment of the present application. Figure 2
[0021] Figure 6 is a schematic diagram of an optional method of updating the data amount of dirty pages of a small volume according to an embodiment of the present application;
[0022] Figure 7 It is a structural block diagram of a device for updating dirty page data volume according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0025] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a method for updating dirty page data volume in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for updating the amount of dirty page data in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] First, the terms involved in the embodiments of the present application are explained and illustrated.
[0029] Cache: A module in the IO stack in storage.
[0030] Volume: Visible to users, users read and write data through the volume, similar to the D drive or E drive on a desktop computer.
[0031] Dirty page: has been stored in the cache and a completion response has been sent to the host, but has not yet been stored in the hard disk data block.
[0032] Pinned page: The data block that cannot be flushed from the cache in offline scenarios.
[0033] Small volumes: After implementing single-volume multithreading, each volume is split into multiple small volumes according to the number of threads, and the execution of each small volume is a single-threaded block.
[0034] Volume offline / online flag: Both large and small volumes have an offline / online flag. After the online process is executed, the volume offline / online flag is online. After the offline process is executed, the volume offline / online flag is offline.
[0035] Single volume multi-threading: Single volume multi-threading technology means that a large volume is split into multiple small volumes according to the number of threads it can use. The IO on each small volume runs on only one thread, and the IO is determined on which small volume to execute based on its address range. Although the large volume is split into multiple small volumes, the host can only see the large volume, not the small volumes. In the single volume multi-threading scenario, each small volume has an offline / online flag; when any small volume is offline, the small volumes in the entire large volume think they are also offline.
[0036] In this embodiment, a method for updating the amount of dirty page data is provided. A storage device is divided into a plurality of sub-storage devices. Each of the plurality of sub-storage devices records the amount of data of the currently corresponding dirty page. The storage device is used to map the sum of the amount of data of the currently corresponding dirty page recorded in each sub-storage device to the total amount of data of the dirty page of the storage device. The method is applied to each target sub-storage device in the plurality of sub-storage devices. Figure 2 is a flow chart of a method for updating dirty page data volume according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:
[0037] Step S202, after executing the received target data request, detecting an update status of the data volume of the dirty page recorded in the target sub-storage device, wherein the target data request is used to request to perform a data operation on the data in the target sub-storage device, and the update status is used to indicate whether the data operation requested to be performed by the target data request has resulted in a change in the data volume of the dirty page recorded in the target sub-storage device;
[0038] Step S204, detecting a changed data amount of the change in the amount of dirty page data recorded in the target sub-storage device caused by the data operation requested to be executed by the target data request, when the update status indicates that the data operation requested to be executed by the target data request causes a change in the amount of dirty page data recorded in the target sub-storage device;
[0039] Step S206, updating the changed data volume to the initial data volume of the dirty pages currently recorded in the target sub-storage device to obtain the target data volume, wherein the storage device is used to map the target data volume to the total data volume of the dirty pages of the storage device.
[0040] Through the above steps, the sub-storage devices to which the storage device is divided record the data volume of the current corresponding dirty pages. When the data operation requested to be executed by the data request causes the data volume of the dirty pages corresponding to the sub-storage device to change, the changed data volume can be updated to the data volume of the dirty pages corresponding to the sub-storage device, but is not limited to updating the changed data volume to the data volume of the dirty pages corresponding to the sub-storage device. The storage device maps the sum of the data volumes of the dirty pages corresponding to the sub-storage devices to which the storage device is divided. When the number of dirty pages of one of the sub-storage devices changes, the total data volume of the dirty pages of the storage device will be updated accordingly. In this way, each sub-storage device updates its own dirty page data volume and the total data volume of the dirty pages of the storage device in parallel, reducing the time required to update the total data volume of the dirty pages of the storage device. Therefore, the problem of low dirty page data volume update efficiency can be solved, thereby achieving the effect of improving the dirty page data volume update efficiency.
[0041] In the technical solution provided in the above step S202, the data operation requested by the target data request to be performed on the data in the target sub-storage device may include but is not limited to a read operation, a write operation, a query operation, a delete operation, and the like.
[0042] As an optional example, a read operation may be but is not limited to requesting to read data stored in a target sub-storage device, a write operation may be but is not limited to requesting to modify data stored in a target sub-storage device, a query operation may be but is not limited to requesting to query data stored in a target sub-storage device, etc.
[0043] Optionally, in this embodiment, the data operation requested by the target data request to be performed on the data in the target sub-storage device may or may not result in a change in the data volume of the dirty pages recorded in the target sub-storage device. As an optional example, the data volume of the dirty pages may include, but is not limited to, the number of dirty pages, the data size of the dirty pages, etc.
[0044] Optionally, in this embodiment, dirty pages may include but are not limited to data that has completed responding to received data requests and completed data modification but has not yet been written to the storage device. For example, the storage device may include but is not limited to a hard disk, a disk, or a volume, etc., and the sub-storage device may include but is not limited to a storage area divided by a hard disk or a small volume divided by a volume, etc. This application does not impose any restrictions on this.
[0045] In an exemplary embodiment, the storage device is also deployed with a plurality of threads, and the plurality of threads correspond one-to-one to the plurality of sub-storage devices. The update status of the data volume of the dirty pages recorded in the target sub-storage device may be detected in the following manner, but is not limited to: controlling the target thread corresponding to the target sub-storage device in the plurality of threads to detect the matching degree between the target data and the initial data, wherein the target data is data obtained after executing the data operation requested by the target data request on the initial data in the target sub-storage device, and the matching degree is used to indicate whether the target data is consistent with the initial data; in a case where the matching degree is used to indicate that the target data is inconsistent with the initial data, detecting the storage status of the target data, wherein the storage status is used to indicate whether the target data is stored in the target sub-storage device; in a case where the storage status is used to indicate that the target data is not stored in the target sub-storage device, determining the update status as indicating that the data operation requested by the target data request has resulted in a change in the data volume of the dirty pages recorded in the target sub-storage device.
[0046] Optionally, in this embodiment, when the storage status is used to indicate that the target data has been stored in the target sub-storage device, the update status is determined to indicate that the data operation requested by the target data request has not resulted in a change in the amount of dirty page data recorded in the target sub-storage device.
[0047] It should be noted that when the update status is used to indicate that the data operation requested by the target data request has not resulted in a change in the amount of dirty page data recorded in the target sub-storage device, it may be that the target data has been stored in the target sub-storage device, or that the target data has not changed compared to the initial data, etc.
[0048] In this way, by detecting whether the data has changed and whether the data has been stored in the sub-storage device, it is jointly detected whether the data volume of the dirty page of the sub-storage device has changed, thereby improving the accuracy of detecting whether the data volume of the dirty page of the sub-storage device has changed.
[0049] In the technical solution provided in the above step S204, when the update status indicates that the data operation requested by the target data request does not cause a change in the data volume of the dirty pages recorded in the target sub-storage device, the data volume of the dirty pages recorded in the target sub-storage device remains unchanged.
[0050] In an exemplary embodiment, multiple threads are also deployed in the storage device, and the multiple threads correspond one-to-one to the multiple sub-storage devices. The changed data amount of the dirty page data recorded in the target sub-storage device caused by the data operation requested to be performed by the target data request can be detected in the following manner, but is not limited to: controlling the target thread corresponding to the target sub-storage device among the multiple threads to pause responding to the reference data request received by the target sub-storage device, wherein the reference data request is used to request to perform data operations on the data in the target sub-storage device; controlling the target thread to detect the changed data amount.
[0051] Optionally, in this embodiment, the target thread corresponding to the target sub-storage device may be, but is not limited to, used to respond to a data request received by the target sub-storage device and detect a change in the data volume of dirty pages of the target sub-storage device.
[0052] Figure 3 is a schematic diagram of an optional large volume divided into multiple small volumes according to an embodiment of the present application, such as Figure 3 As shown, the dirty data count variable (equivalent to the second variable) of the large volume (equivalent to the storage device) is retained, and the dirty data count variable of the large volume can be but is not limited to being split into each small volume (equivalent to the sub-storage device).
[0053] For example, a large volume (or storage volume) may be divided into, but not limited to, small volumes 1 to n, small volume 1 corresponds to thread 1 (path_stage), small volume 2 corresponds to thread 2 (path_stage), small volume n corresponds to thread n (path_stage), and the variable of the number of dirty data of the storage volume (equivalent to the second variable) may include, but not limited to, modified_pages.
[0054] Every time the dirty data count variable (equivalent to the first variable) of the small volume is updated, the dirty data count variable of the large volume is also updated. Figure 4 is a schematic diagram of an optional thread updating the data amount of a dirty page of a sub-storage device according to an embodiment of the present application, such as Figure 4As shown, for example, in the scenario where the volume is already online, each time there is dirty data to be increased or decreased, the data amount (e.g., quantity) of the dirty data of the corresponding small volume can be updated through the thread corresponding to the small volume, and the data amount (e.g., quantity) of the dirty data (or dirty pages) of the entire large volume can be updated at the same time. For example, in the case where the amount of dirty data of small volume 2 increases or decreases, the amount of dirty data corresponding to small volume 2 can be updated through thread 2 (path_state) corresponding to small volume 2, but it is not limited to. In addition, the total data amount (e.g., quantity) of the dirty data (or dirty pages) of the large volume will also increase or decrease accordingly.
[0055] In this way, where the cache module needs to use the data amount (eg, quantity) of the volume's dirty data, there is no need to recalculate the data amount (eg, quantity) of the dirty data, and the dirty data can be used directly.
[0056] As an optional example, the operation of the target thread responding to the data request received by the target sub-storage device and the operation of the target thread detecting the change in the data amount of the dirty pages of the target sub-storage device can be but is not limited to being mutually exclusive operations. It can be understood that the operation of the target thread responding to the data request received by the target sub-storage device and the operation of the target thread detecting the change in the data amount of the dirty pages of the target sub-storage device cannot be executed at the same time.
[0057] Compared with the prior art, when the data volume of the dirty pages of the sub-storage device changes, the thread corresponding to the sub-storage device needs to first obtain the corresponding read-write lock before the data volume of the dirty pages of the storage device can be updated. Through the embodiment of the present application, the read-write lock is removed, and the accuracy of the data volume of the dirty pages recorded on the sub-storage device is guaranteed through the mutual exclusion mechanism.
[0058] In an exemplary embodiment, the target thread may be controlled to detect the changed data amount in the following manner, but is not limited to: when the target sub-storage device includes N sub-storage devices, the target thread includes N threads, the target data request includes N data requests, and the changed data amount includes N data amounts, the i-th thread among the N threads is controlled to detect the i-th data amount among the N data amounts by executing the following steps, wherein the i-th data amount is the amount of dirty page data recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests. The amount of changed data of the change, N is a positive integer, and i is a positive integer less than or equal to N: controlling the i-th thread to search for the i-th group of target data from the i-th group of candidate data, wherein the i-th group of candidate data is data obtained when the data operation requested by the i-th data request is completed on the i-th group of initial data in the i-th sub-storage device, the i-th group of candidate data is different from the i-th group of initial data, and the i-th group of target data is data in the i-th group of candidate data that is not stored in the i-th sub-storage device; controlling the target thread to extract the sum of the data amounts of each data in the i-th group of target data to obtain the i-th data amount.
[0059] Optionally, in this embodiment, N threads may, but are not limited to, independently detect the changed data volume of dirty pages of N sub-storage devices in parallel, and N threads may, but are not limited to, independently update target variables in N sub-storage devices in parallel.
[0060] Through the embodiments of the present application, the read-write lock in the related art is removed, and the thread does not need to obtain the read-write lock to update the total number of dirty pages of the storage device, so that each sub-storage device can update the data volume of its own dirty pages in parallel. As the data volume of the dirty pages of the sub-storage device is updated, the total data volume of the dirty pages of the storage device will also be updated accordingly, thereby improving the performance of system IO processing and the processing concurrency of multi-threaded large-volume offline processes. After the read lock is removed, the execution speed of the IO process is improved, and after the write lock is removed, the offline processes of multiple volumes can be processed in parallel, and the IO processes and offline processes of different small volumes do not need to be mutually exclusive, but the IO processes and offline processes of the same small volume are mutually exclusive.
[0061] In the technical solution provided in the above step S206, the changed data amount can be updated to the initial data amount of the dirty page currently recorded in the target sub-storage device to obtain the target data amount, where the target data amount is equal to the sum of the initial data amount and the changed data amount.
[0062] In an exemplary embodiment, each of the multiple sub-storage devices further stores a first variable, which is used to record the data volume of the dirty page currently corresponding to the sub-storage device. The storage device further deploys multiple threads, which correspond one-to-one to the multiple sub-storage devices. The changed data volume can be updated to the initial data volume of the dirty page currently recorded by the target sub-storage device in the following manner, but is not limited to: controlling the target thread corresponding to the target sub-storage device in the multiple threads to detect the running state of the target sub-storage device, wherein the running state is used to indicate whether the data is allowed to be stored in the target sub-storage device; when the running state is used to indicate that the data is allowed to be stored in the target sub-storage device, controlling the target thread to update the changed data volume to the initial data volume of the dirty page currently recorded by the target sub-storage device to obtain the target data volume.
[0063] Optionally, in this embodiment, a flag bit is stored in the target sub-storage device, and the flag bit is used to record whether the target sub-storage device is offline. The target thread corresponding to the target sub-storage device in the multiple threads can be controlled to detect the operating status of the target sub-storage device in the following manner, but is not limited to: control the target thread to extract the flag value recorded on the flag bit in the target sub-storage device, and when the flag value is a first flag value, determine that the target sub-storage device is online, wherein the operating status includes that the target sub-storage device is online, and when the flag value is a second flag value, determine that the target sub-storage device is offline, wherein the operating status includes that the target sub-storage device is offline.
[0064] It should be noted that each sub-storage device (for example, a small volume) only cares about whether it is offline or online. Compared with the prior art, after a small volume goes through the offline process first (because each small volume is executed in a different thread, the execution order cannot be guaranteed to be completely consistent, and the small volumes on some threads are executed quickly, and the small volumes on some threads are executed slowly), the offline / online flag is in the offline state, and other small volumes also consider themselves to be in the offline state, and in the related art, only when all the small volumes' offline / online flags are in the online state, all the small volumes consider themselves to be in the online state; through the embodiments of the present application, each small volume only considers its own offline / online flag, and as long as its own offline / online flag is offline / online, it considers itself offline / online, regardless of the status of the offline / online flags of other small volumes. Such decoupling processing can improve the robustness of the system and ensure that any small volume will not be affected by the status of other small volumes.
[0065] In an exemplary embodiment, the target thread may be controlled to update the changed data amount to the initial data amount of the dirty page currently recorded by the target sub-storage device to obtain the target data amount in the following manner, but is not limited to: controlling the target thread to extract the initial data amount of the dirty page recorded by the first variable; controlling the target thread to update the data amount of the dirty page recorded by the first variable to the target data amount, wherein the target data amount is equal to the sum of the initial data amount and the changed data amount; a second variable is deployed in the storage device, and the second variable is used to record the total data amount of the dirty pages of the storage device. The above method also includes: the target sub-storage device includes N sub-storage devices, the changed data amount includes N data amounts, and the target data request includes N In the case of a data request, the i-th data amount among the N data amounts is mapped to the total data amount of dirty pages of the storage device by executing the following steps, wherein the i-th data amount is the changed data amount of the dirty page data amount recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests, and N is a positive integer: extracting the current total data amount of dirty pages of the storage device recorded by the second variable, wherein the current total data amount is equal to the sum of the data amounts of the currently corresponding dirty pages recorded in each sub-storage device; updating the data amount of dirty pages recorded by the second variable to the target total data amount, wherein the target total data amount is equal to the sum of the current total data amount and the i-th data amount.
[0066] Optionally, in the present embodiment, after controlling the target thread to update the data volume of the dirty page recorded by the first variable to the target data volume, the method further includes: extracting the update result, wherein the update result is used to indicate whether the target thread is successfully controlled to update the data volume of the dirty page recorded by the first variable to the target data volume, and when the update result is used to indicate that the target thread is not successfully controlled to update the data volume of the dirty page recorded by the first variable to the target data volume, detecting the number of updates corresponding to the updated data volume, and when the number of updates is less than the update number threshold, controlling the target thread again to update the data volume of the dirty page recorded by the first variable to the target data.
[0067] Through the embodiments of the present application, when the number of updates is greater than or equal to the update number threshold, it can be indicated that attempts to update the data volume of the dirty pages of the sub-storage device have been made for a large number of times. In this case, in order not to affect the thread's response to the data request received by the sub-storage device, the updating of the data volume of the dirty pages of the sub-storage device can be, but is not limited to, stopped. In this way, repeated attempts to update the data volume of the dirty pages of the sub-storage device are made within a certain number of times, thereby improving the success rate of updating the data volume of the dirty pages of the sub-storage device, and avoiding repeated attempts to update the data volume of the dirty pages of the sub-storage device that have failed, thereby avoiding waste of computer resources.
[0068] In an exemplary embodiment, a third variable is also deployed in the storage device, wherein the third variable is used to record the total data volume of the locked pages of the storage device. The above method also includes: when the operating state is used to indicate that data storage in the target sub-storage device is not allowed, controlling the target thread to extract the initial total data volume of the locked pages of the storage device recorded by the third variable; controlling the target thread to update the initial total data volume recorded by the third variable to a reference total data volume, wherein the reference total data volume is equal to the sum of the initial total data volume and the changed data volume.
[0069] Optionally, in an embodiment of the present application, the storage device may be but is not limited to the total data volume corresponding to a locked page, the total data volume of the locked page may be but is not limited to including the number of locked pages or the data size of the locked page, and the locked page may be but is not limited to including data that cannot be stored in the sub-storage device by cache in an offline scenario.
[0070] Optionally, in an embodiment of the present application, when the running status is used to indicate that data storage in the target sub-storage device is not allowed, it may indicate that the target sub-storage device is damaged or the target sub-storage device is unplugged. In this case, it may indicate that the dirty page corresponding to the changed data amount cannot be stored in the target sub-storage device. Then, it may be possible but not limited to controlling the target thread to update the initial total data amount recorded by the third variable to the reference total data amount.
[0071] Figure 5 is a schematic diagram of updating the amount of data on a locked page in an optional volume offline scenario according to an embodiment of the present application, such as Figure 5 As shown, the dirty data count variable (equivalent to the second variable) of the large volume (equivalent to the storage device) is retained, and the dirty data count variable of the large volume can be but is not limited to being split into each small volume (equivalent to the sub-storage device).
[0072] For example, a large volume (or storage volume) can be divided into but not limited to small volumes 11 to n, small volume 1 corresponds to thread 1 (path_stage), small volume 2 corresponds to thread 2 (path_stage), small volume n corresponds to thread n (path_stage), and the variable of the number of dirty data of the storage volume (equivalent to the second variable) can include but is not limited to modified_pages.
[0073] For the scenario where the volume is offline, when the number of dirty data of each small volume and large volume is updated, the number of pinned data (equivalent to locked pages) must also be updated synchronously. When offline, compared with the related art, the small volume adds the number of dirty data of the large volume to the number of pinned data. In the embodiment of the present application, when each small volume executes the offline process, the number of dirty data of each small volume is added to the number of pinned data through the thread corresponding to the small volume.
[0074] When volume 1 is offline, the amount of dirty data (equivalent to the amount of dirty pages) of the volume is updated (e.g., increased or decreased) by thread 1 (path_state) corresponding to volume 1, and the amount of locked pages is updated (e.g., increased or decreased) by thread 1 (path_state) corresponding to volume 1.
[0075] After the volume's dirty data count variable is split, it must be adapted to the owned volume type and the unowned volume type. For IO (Input / Output) that is restored after the node restarts, for example, when a small volume is offline and then online again, the thread to which it belongs is calculated in the unowned volume mode, and then the dirty data count variable value of the corresponding small volume is increased.
[0076] When the types of unowned and owned volumes can be identified later, the dirty data count of each small volume will be readjusted. If it is an unowned volume, no adjustment will be made. If it is an owned volume, adjustment will be made. The dirty data of all small volumes will be added to the dirty data count variable of the small volume in the same thread as the owned volume, and the dirty data counts of other small volumes will be cleared to 0. This ensures the adaptation of owned and unowned volumes in the node restart scenario. In normal scenarios, no adaptation is required because owned and unowned volumes can be automatically identified.
[0077] It is possible but not limited to subtract the dirty data volume (equivalent to the data volume of dirty pages) of the small volume from the pinned data volume of the large volume through the thread corresponding to the small volume. Figure 6 is a schematic diagram of an optional method for updating the data amount of dirty pages of a small volume according to an embodiment of the present application, such as Figure 6As shown, the dirty data count variable (equivalent to the second variable) of the large volume (equivalent to the storage device) is retained, and the dirty data count variable of the large volume can be but is not limited to being split into each small volume (equivalent to the sub-storage device) through the thread corresponding to the small volume.
[0078] For example, a large volume (or storage volume) can be divided into but not limited to small volumes 11 to n, small volume 1 corresponds to thread 1 (path_stage), small volume 2 corresponds to thread 2 (path_stage), small volume n corresponds to thread n (path_stage), and the variable of the number of dirty data of the storage volume (equivalent to the second variable) can include but is not limited to modified_pages.
[0079] For example, when small volume 2 is offline first and then online, thread 2 (path_state) corresponding to small volume 2 can be set to online (online) but is not limited to, and the amount of data of dirty pages corresponding to small volume 2 can be increased or decreased through thread 2.
[0080] Through the embodiment of the present application, the dirty data count variable of the large volume is split into each small volume, and the mutually exclusive way of modifying dirty data in the IO process and the offline / online process is changed to improve the system performance and the concurrency of the small volume offline process. The dirty data count variable after splitting into small volumes should be adapted to different volume types. The dirty data count variable of the large volume is modified to an atomic variable. For the single-volume multi-threaded scenario, because it was originally a single-volume single-threaded, the resources that may be shared by the small volumes in the original large volume should be split to ensure that each small volume only accesses its own resources, thus ensuring the independence of each small volume (because each small volume is single-threaded), which can improve the performance of the entire system. Because the small volumes do not interfere with each other, there will be no scenario where the IO on a small volume waits for another small volume to be locked because of a lock. In the future, it is necessary to find points on the large volume that can be split and continue to split to further improve system performance.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment 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 this 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, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0082] In this embodiment, a device for updating the amount of dirty page data is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0083] In this embodiment, a device for updating the amount of dirty page data is also provided. The storage device is divided into a plurality of sub-storage devices. Each of the plurality of sub-storage devices records the amount of data of the currently corresponding dirty page. The storage device is used to map the sum of the amount of data of the currently corresponding dirty page recorded in each sub-storage device to the total amount of data of the dirty page of the storage device. The device is applied to each target sub-storage device in the plurality of sub-storage devices. Figure 7 is a structural block diagram of a device for updating dirty page data volume according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:
[0084] A first detection module 702 is used to detect an update status of the data volume of the dirty page recorded in the target sub-storage device after executing the received target data request, wherein the target data request is used to request to perform a data operation on the data in the target sub-storage device, and the update status is used to indicate whether the data operation requested to be performed by the target data request has caused a change in the data volume of the dirty page recorded in the target sub-storage device;
[0085] A second detection module 704 is used to detect a changed data amount of a change in the data amount of dirty pages recorded in the target sub-storage device caused by the data operation requested to be executed by the target data request, when the update status indicates that the data operation requested to be executed by the target data request has caused a change in the data amount of dirty pages recorded in the target sub-storage device;
[0086] The update module 706 is used to update the changed data volume to the initial data volume of the dirty pages currently recorded in the target sub-storage device to obtain the target data volume, wherein the storage device is used to map the target data volume to the total data volume of the dirty pages of the storage device.
[0087] Through the above-mentioned device, the sub-storage devices to which the storage device is divided record the data volume of the current corresponding dirty page. When the data operation requested to be executed by the data request causes the data volume of the dirty page corresponding to the sub-storage device to change, the changed data volume can be updated to the data volume of the dirty page corresponding to the sub-storage device, but is not limited to, and the storage device maps the sum of the data volumes of the dirty pages corresponding to each sub-storage device to which the storage device is divided. When the number of dirty pages of one of the sub-storage devices changes, the total data volume of the dirty pages of the storage device will be updated accordingly. In this way, each sub-storage device updates its own dirty page data volume and the total data volume of the dirty pages of the storage device in parallel, reducing the time required to update the total data volume of the dirty pages of the storage device. Therefore, the problem of low efficiency in updating the dirty page data volume can be solved, thereby achieving the effect of improving the updating efficiency of the dirty page data volume.
[0088] In an exemplary embodiment, the storage device further has multiple threads deployed therein, the multiple threads corresponding one-to-one to the multiple sub-storage devices, and the second detection module includes:
[0089] A first control unit, configured to control a target thread corresponding to the target sub-storage device among the multiple threads to suspend responding to a reference data request received by the target sub-storage device, wherein the reference data request is used to request to perform a data operation on data in the target sub-storage device;
[0090] The second control unit is used to control the target thread to detect the changed data amount.
[0091] In an exemplary embodiment, the second control unit is used to: when the target sub-storage device includes N sub-storage devices, the target thread includes N threads, the target data request includes N data requests, and the changed data amount includes N data amounts, control the i-th thread among the N threads to detect the i-th data amount among the N data amounts by executing the following steps, wherein the i-th data amount is the changed data amount of the change in the data amount of the dirty page recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests, N is a positive integer, and i is a positive integer less than or equal to N:
[0092] Control the i-th thread to search for the i-th group of target data from the i-th group of candidate data, wherein the i-th group of candidate data is data obtained when the data operation requested by the i-th data request is completed on the i-th group of initial data in the i-th sub-storage device, the i-th group of candidate data is different from the i-th group of initial data, and the i-th group of target data is data in the i-th group of candidate data that is not stored in the i-th sub-storage device;
[0093] The target thread is controlled to extract the sum of the data amounts of the respective data in the i-th group of target data to obtain the i-th data amount.
[0094] In an exemplary embodiment, the storage device further has multiple threads deployed therein, the multiple threads corresponding one-to-one to the multiple sub-storage devices, and the first detection module includes:
[0095] a third control unit, configured to control a target thread corresponding to the target sub-storage device among the multiple threads to detect a matching degree between target data and initial data, wherein the target data is data obtained after a data operation requested by a target data request is performed on the initial data in the target sub-storage device, and the matching degree is used to indicate whether the target data is consistent with the initial data;
[0096] a detection unit, configured to detect a storage state of the target data when the matching degree indicates that the target data is inconsistent with the initial data, wherein the storage state indicates whether the target data is stored in the target sub-storage device;
[0097] A determination unit is used to determine the update status as indicating that the data operation requested by the target data request has caused a change in the amount of dirty page data recorded in the target sub-storage device when the storage status indicates that the target data is not stored in the target sub-storage device.
[0098] In an exemplary embodiment, each of the plurality of sub-storage devices further stores a first variable, the first variable being used to record the amount of data of a dirty page currently corresponding to the sub-storage device, the storage device further deploys a plurality of threads, the plurality of threads correspond one-to-one to the plurality of sub-storage devices, and the update module comprises:
[0099] a fourth control unit, configured to control a target thread corresponding to the target sub-storage device among the multiple threads to detect an operation state of the target sub-storage device, wherein the operation state is used to indicate whether it is allowed to store data in the target sub-storage device;
[0100] The fifth control unit is used to control the target thread to update the changed data amount to the initial data amount of the dirty page currently recorded in the target sub-storage device to obtain the target data amount when the operating state is used to indicate that data storage in the target sub-storage device is allowed.
[0101] In an exemplary embodiment, the fifth control unit is configured to:
[0102] Controlling the target thread to extract the initial data amount of the dirty page recorded by the first variable;
[0103] Controlling the target thread to update the data volume of the dirty page recorded by the first variable to the target data volume, wherein the target data volume is equal to the sum of the initial data volume and the changed data volume;
[0104] A second variable is deployed in the storage device, and the second variable is used to record the total data volume of dirty pages of the storage device. The apparatus further includes: when the target sub-storage device includes N sub-storage devices, the changed data volume includes N data volumes, and the target data request includes N data requests, the i-th data volume in the N data volumes is mapped to the total data volume of dirty pages of the storage device by executing the following steps, wherein the i-th data volume is the changed data volume of the change in the data volume of the dirty pages recorded in the i-th sub-storage device in the N sub-storage devices caused by the data operation requested to be executed by the i-th data request in the N data requests, and N is a positive integer:
[0105] Extracting the current total data volume of the dirty pages of the storage device recorded by the second variable, wherein the current total data volume is equal to the sum of the data volumes of the currently corresponding dirty pages recorded in each sub-storage device;
[0106] The data volume of the dirty page recorded by the second variable is updated to the target total data volume, wherein the target total data volume is equal to the sum of the current total data volume and the i-th data volume.
[0107] In an exemplary embodiment, a third variable is further deployed in the storage device, wherein the third variable is used to record the total amount of data of the locked pages of the storage device, and the apparatus further includes:
[0108] A first control module, configured to control the target thread to extract an initial total amount of data of a locked page of the storage device recorded by the third variable when the running state indicates that data storage in the target sub-storage device is not allowed;
[0109] The second control module is used to control the target thread to update the initial total data volume of the third variable record to a reference total data volume, wherein the reference total data volume is equal to the sum of the initial total data volume and the changed data volume.
[0110] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0111] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0112] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0113] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0114] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0115] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0116] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0117] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0118] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0119] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0120] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for updating dirty page data volume, characterized in that: A storage device is divided into a plurality of sub-storage devices, each of the plurality of sub-storage devices records a data amount of a currently corresponding dirty page, the storage device is used to map the sum of the data amounts of the currently corresponding dirty pages recorded in each sub-storage device to a total data amount of dirty pages of the storage device, the method is applied to each target sub-storage device in the plurality of sub-storage devices, and the method includes: After executing the received target data request, detecting an update status of the data volume of the dirty page recorded in the target sub-storage device, wherein the target data request is used to request to perform a data operation on the data in the target sub-storage device, and the update status is used to indicate whether the data operation requested to be performed by the target data request has resulted in a change in the data volume of the dirty page recorded in the target sub-storage device; In a case where the update status indicates that the data operation requested by the target data request causes a change in the data volume of the dirty pages recorded in the target sub-storage device, detecting a changed data volume of the change in the data volume of the dirty pages recorded in the target sub-storage device caused by the data operation requested by the target data request; The changed data volume is updated to the initial data volume of the dirty pages currently recorded in the target sub-storage device to obtain the target data volume, wherein the storage device is used to map the target data volume to the total data volume of the dirty pages of the storage device.
2. The method according to claim 1, characterized in that The storage device is further deployed with a plurality of threads, the plurality of threads corresponding to the plurality of sub-storage devices one by one, and the detection of the changed data amount of the dirty page data amount recorded in the target sub-storage device caused by the data operation requested to be executed by the target data request includes: Controlling a target thread corresponding to the target sub-storage device among the multiple threads to pause responding to a reference data request received by the target sub-storage device, wherein the reference data request is used to request to perform a data operation on data in the target sub-storage device; The target thread is controlled to detect the changed data amount.
3. The method according to claim 2, characterized in that The controlling the target thread to detect the changed data amount includes: when the target sub-storage device includes N sub-storage devices, the target thread includes N threads, the target data request includes N data requests, and the changed data amount includes N data amounts, controlling the i-th thread among the N threads to detect the i-th data amount among the N data amounts by executing the following steps, wherein the i-th data amount is the changed data amount of the change in the data amount of the dirty page recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests, N is a positive integer, and i is a positive integer less than or equal to N: Control the i-th thread to search for the i-th group of target data from the i-th group of candidate data, wherein the i-th group of candidate data is data obtained when the data operation requested by the i-th data request is completed on the i-th group of initial data in the i-th sub-storage device, the i-th group of candidate data is different from the i-th group of initial data, and the i-th group of target data is data in the i-th group of candidate data that is not stored in the i-th sub-storage device; The target thread is controlled to extract the sum of the data amounts of the respective data in the i-th group of target data to obtain the i-th data amount.
4. The method according to claim 1, characterized in that: The storage device further includes a plurality of threads, the plurality of threads corresponding to the plurality of sub-storage devices one by one, and the detecting the update status of the amount of data of the dirty page recorded in the target sub-storage device includes: Controlling a target thread corresponding to the target sub-storage device among the multiple threads to detect a matching degree between target data and initial data, wherein the target data is data obtained after executing a data operation requested by a target data request on the initial data in the target sub-storage device, and the matching degree is used to indicate whether the target data is consistent with the initial data; In a case where the matching degree is used to indicate that the target data is inconsistent with the initial data, detecting a storage state of the target data, wherein the storage state is used to indicate whether the target data is stored in the target sub-storage device; When the storage status indicates that the target data is not stored in the target sub-storage device, the update status is determined to indicate that the data operation requested by the target data request results in a change in the amount of dirty page data recorded in the target sub-storage device.
5. The method according to claim 1, characterized in that Each of the plurality of sub-storage devices further stores a first variable, the first variable being used to record the data volume of the dirty page currently corresponding to the sub-storage device, the storage device further deploys a plurality of threads, the plurality of threads corresponding one-to-one to the plurality of sub-storage devices, and the updating of the changed data volume to the initial data volume of the dirty page currently recorded by the target sub-storage device to obtain the target data volume includes: Controlling a target thread corresponding to the target sub-storage device among the multiple threads to detect an operation state of the target sub-storage device, wherein the operation state is used to indicate whether it is allowed to store data in the target sub-storage device; When the running state indicates that data storage in the target sub-storage device is allowed, the target thread is controlled to update the changed data amount to the initial data amount of the dirty page currently recorded in the target sub-storage device to obtain the target data amount.
6. The method according to claim 5, characterized in that The controlling the target thread to update the changed data volume to the initial data volume of the dirty page currently recorded in the target sub-storage device to obtain the target data volume includes: Controlling the target thread to extract the initial data amount of the dirty page recorded by the first variable; Controlling the target thread to update the data volume of the dirty page recorded by the first variable to the target data volume, wherein the target data volume is equal to the sum of the initial data volume and the changed data volume; A second variable is deployed in the storage device, and the second variable is used to record the total data volume of dirty pages of the storage device. The method also includes: when the target sub-storage device includes N sub-storage devices, the change data volume includes N data volumes, and the target data request includes N data requests, the i-th data volume among the N data volumes is mapped to the total data volume of dirty pages of the storage device by executing the following steps, wherein the i-th data volume is the change data volume of the change in the data volume of dirty pages recorded in the i-th sub-storage device among the N sub-storage devices caused by the data operation requested to be executed by the i-th data request among the N data requests, and N is a positive integer: extracting the current total data volume of dirty pages of the storage device recorded by the second variable, wherein the current total data volume is equal to the sum of the data volumes of the currently corresponding dirty pages recorded in each sub-storage device; updating the data volume of dirty pages recorded by the second variable to the target total data volume, wherein the target total data volume is equal to the sum of the current total data volume and the i-th data volume.
7. The method according to claim 5, characterized in that The storage device is further configured with a third variable, wherein the third variable is used to record the total amount of data in the locked pages of the storage device. The method further includes: When the running state indicates that data storage in the target sub-storage device is not allowed, controlling the target thread to extract the initial total data volume of the locked page of the storage device recorded by the third variable; The target thread is controlled to update the initial total data volume of the third variable record to a reference total data volume, wherein the reference total data volume is equal to the sum of the initial total data volume and the changed data volume.
8. A device for updating dirty page data volume, characterized in that: The storage device is divided into a plurality of sub-storage devices, each of the plurality of sub-storage devices records the data volume of the currently corresponding dirty page, the storage device is used to map the sum of the data volume of the currently corresponding dirty page recorded in each sub-storage device to the total data volume of the dirty page of the storage device, the apparatus is applied to each target sub-storage device in the plurality of sub-storage devices, and the apparatus comprises: A first detection module is used to detect an update status of the data volume of the dirty pages recorded in the target sub-storage device after executing a received target data request, wherein the target data request is used to request to perform a data operation on the data in the target sub-storage device, and the update status is used to indicate whether the data operation requested to be performed by the target data request has resulted in a change in the data volume of the dirty pages recorded in the target sub-storage device; A second detection module is used to detect a changed data amount of a change in the data amount of dirty pages recorded in the target sub-storage device caused by the data operation requested to be executed by the target data request, when the update status is used to indicate that the data operation requested to be executed by the target data request has caused a change in the data amount of dirty pages recorded in the target sub-storage device; An update module is used to update the changed data volume to the initial data volume of the dirty pages currently recorded in the target sub-storage device to obtain the target data volume, wherein the storage device is used to map the target data volume to the total data volume of the dirty pages of the storage device.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
