Data synchronization method and computing device
By acquiring discrepancy data and synchronizing it to the disaster recovery terminal when the production-side storage device load allows, the impact of data synchronization on production operations is resolved, resulting in less data loss and more efficient data synchronization.
Patent Information
- Application Number
- CN202211302779.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-10-24
AI Technical Summary
In existing technologies, data synchronization of production-end storage devices has a significant impact on production operations, resulting in large data discrepancies, substantial data loss during failures, and an inability to adaptively adjust the synchronization timing to avoid affecting production operations.
By acquiring differential data and synchronizing it to the disaster recovery end when the load on the production-side storage device is less than or equal to a specified threshold, the synchronization timing is adaptively adjusted using load detection and data synchronization flags, and differential data is acquired by combining snapshots and data transformation logs to optimize the synchronization process.
This reduces the impact of data synchronization on production operations, minimizes data loss during failures, and improves the efficiency and reliability of data synchronization.
Smart Images

Figure CN115827774B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data synchronization method and a computing device. BACKGROUND
[0002] With the development of digital technology, data protection and guarantee of business continuity are increasingly important to enterprises, and the loss of key data will cause great loss to enterprises, so the protection of key data usually needs to specify the disaster recovery scheme of the corresponding storage data.
[0003] Currently, the method of synchronizing data from the storage device of the production end to the storage device of the disaster recovery end usually adopts asynchronous remote replication technology. After the storage device of the production end and the storage device of the disaster recovery end establish an asynchronous remote replication relationship, the storage device of the production end can transmit data to the storage device of the disaster recovery end at a preset period.
[0004] In the above related technology, the storage device of the production end needs to trigger data replication synchronization strictly according to the preset period, and the data replication may affect the production business of the storage device of the production end. SUMMARY
[0005] The embodiments of the present application provide a data synchronization method and a computing device, which can adaptively trigger the data synchronization of the storage device of the production end and the storage device of the disaster recovery end, reduce the data difference between the storage device of the production end and the storage device of the disaster recovery end, and reduce the amount of data loss when a fault occurs.
[0006] In a first aspect, the present application provides a data synchronization method applied to a first storage device, the method comprising: obtaining difference data in a case that a load of the first storage device is less than or equal to a specified threshold; the difference data comprising business data for performing an input / output operation on the first storage device in a first time period, the first time period being a time period between a time when the last data synchronization to a second storage device is started and a current time, the first storage device being a storage device of a production end of the business data; the second storage device being a storage device of a disaster recovery end of the business data; and synchronizing the difference data into the second storage device.
[0007] It can be understood that, since the method obtains the difference data changed between the time when the last data synchronization to the second storage device is started and the current time when the load of the first storage device is determined to be less than or equal to the specified threshold, and sends the obtained difference data to the second storage device at the current time, the disaster recovery backup of the business data is realized. The load of the first storage device is less than or equal to the specified threshold, which means that the first storage device needs to perform less production business, and at this time, the disaster recovery backup has less impact on the storage performance of the production end (i.e. the first storage device).
[0008] In a possible implementation, the obtaining the difference data comprises: querying an attribute state of a data synchronization flag stored in the first storage device, the data synchronization flag being used to represent whether the current load of the first storage device is less than or equal to the specified threshold; and obtaining the difference data in a case where the queried attribute state is a first state, the first state being used to indicate that the current load of the first storage device is less than or equal to the specified threshold.
[0009] It can be understood that, in a case where the attribute state of the data synchronization flag is the first state, the difference data is obtained, which can ensure that the difference data is obtained when the current load of the first storage device is less than or equal to the specified threshold, and setting the data synchronization flag helps to implement that the operation process of comparing the load of the first storage device with the specified threshold and the process of managing the execution of the data synchronization operation belong to two threads, and therefore the efficiency of determining whether to obtain the difference data is improved.
[0010] In another possible implementation, the method further comprises: in a case where the queried attribute state is a second state, querying the attribute state of the data synchronization flag in turn at subsequent detection time points until the attribute state is stopped from being queried at a first detection time point, the detection time point being a time point at which the first storage device detects whether the load of the first storage device is less than or equal to the specified threshold, and the first detection time point being a detection time point at which a first attribute state queried in a time sequence is the first state; and obtaining the difference data at the first detection time point.
[0011] It can be understood that, if the attribute state of the data synchronization flag at the current time point is the second state, the operation of continuously performing data synchronization can be interrupted, and by querying whether the attribute state changes in turn at the current time point to the subsequent detection time point, the operation of data synchronization can be adjusted in a timely manner according to the load of the first storage device, so that the first storage device can adaptively adjust whether to synchronize data to the second storage device.
[0012] In another possible implementation, the method further comprises: in a case where the queried attribute state is the second state, and the attribute state is not the first state in the process of querying the attribute state of the data synchronization flag in turn at the subsequent detection time points, and a time interval between the current time point and a last synchronization start time point reaches a preset time period, obtaining the difference data, the synchronization start time point being a time point at which the data synchronization to the second storage device is started.
[0013] It can be understood that if the time interval between the current time and the last synchronization starting time reaches the preset time period in the process of inquiring whether the attribute state of the data synchronization flag changes to the second state, the process of synchronizing data to the second storage device can be directly started without considering whether the load is less than or equal to the specified threshold, and the difference data is obtained, thereby avoiding the problem of accumulated large amount of data not being synchronized to the second storage device in time due to the long time that the load of the first storage device is greater than the specified threshold.
[0014] In another possible implementation, the attribute state of the data synchronization flag is inquired, including: inquiring the attribute state of the data synchronization flag at a first time when a synchronization completion response returned by the second storage device is received, the synchronization completion response being used to indicate that the service data that the first storage device last synchronized to the second storage device has been synchronized.
[0015] In a case where the inquired attribute state is the first state, the difference data is obtained, including: in a case where the attribute state at the first time is the first state, the difference data is obtained.
[0016] It can be understood that when the first storage device receives the synchronization completion response returned by the second storage device, the first storage device can immediately inquire the attribute state of the data synchronization flag, so that the continuous data synchronization process is realized when the attribute state is the first state, the data synchronization is continuously performed in a self-adaptive manner, and the amount of data loss when a fault occurs is reduced.
[0017] In another possible implementation, in a case where the load of the first storage device is less than or equal to the specified threshold, the difference data is obtained, including: at a time when it is determined that the load of the first storage device is less than or equal to the specified threshold, a first snapshot of the service data in the first storage device is generated; and based on the first snapshot and a data change log between a time when the last data synchronization to the second storage device is started and the current time, the difference data is obtained, the data change log being a log recorded when the first storage device performs an input / output operation.
[0018] It can be understood that the difference data is obtained in a manner of combining the snapshot and the data change log, and the accuracy of obtaining the difference data can be ensured.
[0019] In another possible implementation, the load is represented by at least one of the following parameters: an occupation of a processor CPU of the first storage device, an occupation of a memory, and a bandwidth of a service data input / output (IO) interface.
[0020] Understandably, by using parameters that characterize the load of the first storage device, including CPU usage, memory usage, and bandwidth of business data input / output (I / O) interfaces, it is beneficial to determine the timing for data synchronization with the second storage device. This helps to balance the timing of the first storage device's production operations and synchronization operations, ensuring that the impact of synchronization operations on the load of the first storage device does not prevent it from completing production operations at a certain efficiency.
[0021] In one possible implementation, synchronizing the difference data to the second storage device includes: synchronizing the difference data to the second storage device when the amount of difference data is greater than a specified amount of data.
[0022] Understandably, if the load on the first storage device is determined to be less than or equal to a specified threshold, the decision to initiate data synchronization with the second storage device can be based on the size of the difference data. If the amount of difference data is less than or equal to a specified amount, data synchronization with the second storage device will not begin until the load on the first storage device is determined to be less than or equal to the specified threshold and the amount of difference data obtained is greater than the specified amount. This method can reduce the number of times the first storage device synchronizes data with the second storage device, thereby reducing system power consumption.
[0023] Secondly, this application provides a data synchronization device for performing any of the data synchronization methods provided in the first aspect above.
[0024] In one possible implementation, this application can divide the data synchronization device into functional modules according to the method provided in the first aspect above. For example, each function can be divided into its own functional modules, or two or more functions can be inherited into a single processing module. For instance, this application can divide the data synchronization device into processing modules and synchronization modules according to their functions. The descriptions of the possible technical solutions and beneficial effects of the various functional modules described above can be found in the technical solutions provided in the first aspect above or its corresponding possible implementations, and will not be repeated here.
[0025] Thirdly, embodiments of this application provide a computing device including a processor and a memory for storing computer program instructions, which are loaded and executed by the processor to enable the computing device to implement the data synchronization method as described above.
[0026] Fourthly, embodiments of this application provide a computer-readable storage medium storing at least one computer program instruction, which is loaded and executed by a processor to implement the data synchronization method as described above.
[0027] Fifthly, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computing device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computing device to perform the data synchronization method provided in the various optional implementations of the first aspect described above.
[0028] For a detailed description of the second to fifth aspects and their various implementations in this application, please refer to the detailed description in the first aspect and its various implementations; and for a detailed analysis of the beneficial effects of the second to fifth aspects and their various implementations in the first aspect and its various implementations, please refer to the beneficial effect analysis in the first aspect and its various implementations, which will not be repeated here.
[0029] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description
[0030] Figure 1 This is a schematic diagram illustrating a data synchronization system according to an exemplary embodiment;
[0031] Figure 2 yes Figure 1 The illustrated embodiment is a schematic diagram of establishing a remote replication consistency group between logical volumes.
[0032] Figure 3 This is a flowchart illustrating a data synchronization method according to an exemplary embodiment;
[0033] Figure 4 yes Figure 3 The illustrated embodiment is a schematic diagram illustrating the determination of a data synchronization start time.
[0034] Figure 5 This is a flowchart illustrating a data synchronization method according to an exemplary embodiment;
[0035] Figure 6 yes Figure 5 The illustrated embodiment is a schematic diagram of the process by which an adaptive detection module determines a data synchronization flag.
[0036] Figure 7 yes Figure 5 The illustrated embodiment is a schematic diagram of a performance testing and data synchronization process.
[0037] Figure 8 yes Figure 5 The illustrated embodiment is a schematic diagram of an adaptive continuous data replication process.
[0038] Figure 9 This is a schematic diagram of the structure of a data synchronization device provided in an exemplary embodiment of this application;
[0039] Figure 10 This is a schematic diagram of the structure of a computing device provided in an exemplary embodiment of this application. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0041] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0042] To ensure that critical business data stored on production storage devices is not lost in the event of application failures or data loss, enterprises need to perform disaster recovery backups on this business data and then perform data recovery based on the backups to protect the business data. Currently, storage devices are typically divided into different logical volumes based on the different types of business data. Different logical volumes can be used to store different types of business data. For data protection on logical volumes of production storage devices, data replication technology between storage devices can be used. This involves establishing a connection between logical volumes in the production data center and logical volumes at the disaster recovery site through remote replication technology, enabling data synchronization over a certain distance and thus achieving disaster recovery protection for production data. For data disaster recovery solutions, the business recovery time and data recovery volume after a failure are key metrics for evaluating a disaster recovery solution. The business recovery time of a data disaster recovery solution can be characterized by the recovery time objective (RTO), which indicates the shortest time period required from the occurrence of a disaster to the restoration of service functionality in the business system. The data recovery volume of a data disaster recovery solution can be characterized by the recovery point objective (RPO), which indicates the amount of data loss the business system can tolerate. When a failure occurs on the production side, due to the importance of production business data, higher requirements are needed for the storage-side business data recovery point objective, minimizing the RPO as much as possible. This is also a key issue that storage vendors need to address.
[0043] In related technologies, there are problems such as significant data discrepancies between production-side storage devices and disaster recovery-side storage devices, resulting in long Recovery Point Objectives (RPOs) and substantial data loss during failures. Furthermore, these technologies do not consider whether the production side is busy when triggering data synchronization from the production side to the disaster recovery side. This can lead to parallel execution of synchronization operations on the production side and multiple ongoing business operations, impacting the efficiency of ongoing production business operations. This application proposes a data synchronization method that detects the load on the production-side storage devices before data synchronization. Specifically, if the load on the production-side storage devices is detected to be less than or equal to a specified threshold at the current moment, subsequent data synchronization operations can proceed. This balances the relationship between production business operations and synchronization operations on the production side, using production-side business load indicators to adaptively adjust the synchronization timing, thereby reducing the impact of data synchronization on the load of the production-side storage devices.
[0044] Please refer to Figure 1 , Figure 1This is a schematic diagram of a data synchronization system according to an embodiment of this application. The data synchronization system includes a production data center 100 and a disaster recovery data center 200. The production data center 100 may include a production host and a first storage device 110. The first storage device 110 includes an I / O interface 101, a processor 102, a buffer memory, and a first memory 103. The disaster recovery data center 200 may include a disaster recovery host and a second storage device 210. The second storage device 210 may include a buffer memory and a second memory 201.
[0045] In this system, the production host can be a server, and the first storage device 110 is a storage device on the production side used to store business data. The first storage device 110 can also be a computing device. The second storage device 210 is a storage device on the disaster recovery side used to store replicated business data; the second storage device 210 can also be a computing device. The computing device can be a smartphone, tablet, e-book reader, personal portable computer, server, etc.
[0046] Optionally, the I / O interface 101 can be used to realize communication between the production host and the first storage device 110. The production host can send I / O instructions to the first storage device 110 through the I / O interface 101. These I / O instructions are used to instruct input / output operations of business data. The processor 102 in the first storage device 110 can be used to process production business and also to execute the data synchronization method of this scheme. The buffer memory can be used to temporarily store operation instructions and business data. The first memory 103 can be a disk array, which can be divided into multiple master logical volumes according to logical unit number (LUN), including master LUN001 to master LUN n. Similarly, the second memory 201 can also be a disk array, and this disk array is divided into multiple slave logical volumes according to LUN, including slave LUN001 to slave LUN n. Remote replication consistency groups can be established between the master and slave logical volumes. Since the master and slave logical volumes are one-to-one, the number of master and slave logical volumes can be the same, and each master logical volume corresponds to one slave logical volume.
[0047] for example, Figure 2 This is a schematic diagram illustrating the establishment of a remote replication consistency group between logical volumes according to an embodiment of this application. Figure 2As shown, the primary logical volumes in the first memory 103 can be divided into primary LUN001, primary LUN002, and primary LUN003, etc., according to LUN. Correspondingly, the secondary logical volumes included in the second memory 201 can be divided into secondary LUN001, secondary LUN002, and secondary LUN003, etc., according to LUN. If the types of service data that can be stored in primary LUN001 and primary LUN002 are the same, a remote replication consistency relationship can be established between primary LUN001 and primary LUN002 and secondary LUN001 and secondary LUN002. Primary LUN001 and primary LUN002 and secondary LUN001 and secondary LUN002 are treated as a remote replication consistency group 1, and remote replication task 1 is executed through this remote replication consistency group 1. If the business data that can be stored in the primary LUN003 is a single data type, a remote replication consistency relationship can be established between the primary LUN003 and the secondary LUN003. The primary LUN003 and the secondary LUN003 are treated as a remote replication consistency group 2, and remote replication task 2 is executed through this remote replication consistency group 2.
[0048] In one possible implementation, the production host and the disaster recovery host can be connected via Ethernet Protocol (IP) or Fibre Channel (FC). The first storage device 110 and the second storage device 210 can also be connected via IP or FC. These communication connections enable the first storage device 110 to copy stored business data to the second storage device 210, and also allow the first storage device 110 to receive business data returned by the second storage device 210 to recover data in the event of a failure.
[0049] Figure 3 A flowchart illustrating a data synchronization method provided in an exemplary embodiment of this application is shown. This data synchronization method can be executed by a first storage device; for example, the first storage device may be... Figure 1 The first storage device 110 in the data synchronization system shown. The data synchronization method includes the following steps:
[0050] S301, if the load on the first storage device is less than or equal to a specified threshold, acquire the difference data.
[0051] In this embodiment of the application, the first storage device may determine whether its own load is less than or equal to a specified threshold before synchronizing data to the second storage device.
[0052] In one possible implementation, if the first storage device is not currently in the process of synchronizing data with the second storage device, the first storage device can determine whether its own load at the current moment is less than or equal to a specified threshold. If it is determined that the load of the first storage device at the current moment is less than or equal to the specified threshold, then the difference data can be obtained.
[0053] In the case where the first storage device and the second storage device have established a remote replication consistency group, the first storage device first needs to perform initial data synchronization with the second storage device. After the first storage device and the second storage device achieve initial data synchronization, the first storage device can start to determine whether the load of the first storage device at the current moment is less than or equal to a specified threshold. If it is determined that the load of the first storage device is less than or equal to the specified threshold, it can obtain the difference data at the current moment. The difference data may include business data that performs input and output operations on the first storage device within a first time period. The first time period is the time period between the last time data synchronization with the second storage device started and the current moment.
[0054] In other words, the first storage device can use the moment when it determines that its own load is less than or equal to a specified threshold as the synchronization start moment. That is, the synchronization start moment is the moment when it begins to perform data synchronization operations with the second storage device, or it can be the moment when it begins to acquire the difference data that needs to be sent to the second storage device.
[0055] The specified threshold in this embodiment can be preset by the user based on their needs. For example, the value of the specified threshold is positively correlated with the priority of synchronizing data with the second storage unit. That is, if it is necessary to synchronize data with the second storage device as quickly as possible, the value of the specified threshold can be appropriately increased to ensure that the data synchronization from the first storage device to the second storage device is more timely. If it is necessary to ensure the efficiency of production operations on the production side, the value of the specified threshold can be appropriately decreased to ensure that the second storage device does not affect its own production operations when the first storage device synchronizes data with the second storage device. Alternatively, the specified threshold can be dynamically updated and adjusted in real time according to the business load on the production side, without any restrictions.
[0056] for example, Figure 4 This is a schematic diagram illustrating the determination of the data synchronization start time according to an embodiment of this application. For example... Figure 4As shown, when the first storage device completes the initial synchronization process with the second storage device, that is, from the initial time until the end of time 1, the process of synchronizing initial data with the second storage device is completed. Then, at time 1, it is determined whether the load of the first storage device at time 1 is less than or equal to a specified threshold. If the load of the first storage device is less than or equal to the specified threshold, then time 1 can be taken as the start time of this data synchronization, and the first data synchronization process with the second storage device can begin. The difference data that needs to be transmitted to the second storage device at time 1 can be the business data of input / output operations performed on the first storage device between the initial time and time 1. That is to say, the difference data that needs to be sent to the second storage device in the first synchronization process includes the difference data between the business data in the first storage device at time 1 and the business data in the first storage device at the initial time. Next, since the first synchronization time of the first data synchronization process from the first storage device to the second storage device is from the start of time 1 to the end of time 2, it is possible to continue to determine whether the load of the first storage device at time 2 is less than or equal to the specified threshold.
[0057] In one possible implementation, when the load on the first storage device is determined to be less than a specified threshold, a first snapshot of the business data in the first storage device is generated; based on the first snapshot and the data transformation log from the last time data was synchronized to the second storage device to the current time, difference data is obtained, where the data transformation log is the log recorded when the first storage device performs input / output operations.
[0058] S302, if the load of the first storage device is greater than a specified threshold, continue to determine whether the load of the first storage device is less than or equal to the specified threshold in chronological order, until the moment when it is determined that the load of the first storage device is less than or equal to the specified threshold, and obtain the difference data.
[0059] In this embodiment of the application, if the first storage device determines that its load is greater than a specified threshold at the current moment, it does not acquire difference data at the current moment and sends difference data to the second storage device. It determines whether the load at subsequent moments is less than or equal to the specified threshold according to the time sequence, until it is determined that the load of the first storage device at the current moment is less than or equal to the specified threshold, and then acquires difference data.
[0060] In one possible implementation, the subsequent determination of whether the load of the first storage device is less than or equal to a specified threshold can be made in real time, or it can be made at a certain period when the current time reaches the time indicated by the period.
[0061] For example, such as Figure 4As shown, if the load of the first storage device at time 2 is greater than a specified threshold, the first storage device can continue to determine whether its load is less than or equal to the specified threshold at subsequent times. If the first storage device only determines that its load is less than or equal to the specified threshold when the current time reaches time 3, then time 3 is determined as the data synchronization start time for the second data synchronization with the second storage device, and the second data synchronization process with the second storage device begins at time 3. The difference data acquired at time 3 that needs to be transmitted to the second storage device in this process can be the business data for performing input / output operations on the first storage device between time 1 of the previous synchronization start and the current time 3. That is, the difference data that needs to be sent to the second storage device in the second synchronization process includes the difference data between the business data in the first storage device at time 3 and the business data in the first storage device at time 1. Next, since the second synchronization time of the second data synchronization process from the first storage device to the second storage device is from time 3 to time 4, it is possible to continue to determine whether the load of the first storage device at time 4 is less than or equal to the specified threshold at time 4.
[0062] S303, when the load of the first storage device is greater than a specified threshold, and the load of the first storage device is not yet determined to be less than or equal to the specified threshold according to the time sequence, and the time interval between the current time and the last synchronization start time reaches a preset time period, the difference data is obtained.
[0063] In this embodiment of the application, when the first storage device determines that its load is greater than a specified threshold at the current moment, and the time interval between the current moment and the last time of synchronization start reaches a preset time period, difference data is obtained.
[0064] In other words, if the load of the first storage device exceeds a specified threshold for a period of time after the first storage device performs a data synchronization with the second storage device, in order to ensure that the business data in the first storage device and the disaster recovery backup business data in the second storage device are not too different, a preset time period can be set in advance. This allows the first storage device to obtain the difference data when the preset time period is reached, even if it determines that its load does not meet the condition of being less than or equal to the specified threshold at the current moment. This can stabilize the upper limit of RPO to a certain extent.
[0065] For example, such as Figure 4As shown, if the load of the first storage device at time 2 is greater than a specified threshold, the first storage device can continue to determine whether its own load is less than or equal to the specified threshold at subsequent times. If the first storage device still has not determined that its own load is less than or equal to the specified threshold by time 3, and the time interval between time 3 and time 1 reaches a preset time period, then a second data synchronization process with the second storage device can begin at time 3. The difference data acquired at time 3 that needs to be transmitted to the second storage device in this process can be the business data for performing input / output operations on the first storage device between time 1 and the current time 3 of the previous synchronization start. In other words, the difference data that needs to be sent to the second storage device in the second synchronization process includes the difference data between the business data in the first storage device at time 3 and the business data in the first storage device at time 1. Next, since the second synchronization time of the second data synchronization process from the first storage device to the second storage device is from time 3 to time 4, it is possible to continue to determine whether the load of the first storage device at time 4 is less than or equal to the specified threshold.
[0066] S304, the first storage device synchronizes the difference data to the second storage device.
[0067] In this embodiment of the application, after the first storage device obtains the difference data, it copies the difference data and sends it to the second storage device to achieve the purpose of synchronizing the business data in the first storage device to the second storage device.
[0068] The process of synchronizing the differential data on the first storage device is used to instruct the process of copying the differential data to the second storage device.
[0069] In one possible implementation, after obtaining the current difference data, the difference data is transmitted through a remote replication consistency group established between the primary logical volume in the first storage device to which the difference data belongs and the secondary logical volume in the second storage device corresponding to the primary logical volume. This ensures that the secondary logical volume in the second storage device corresponding to the primary logical volume has backups of the difference data, thereby enabling the storage in the second storage device to contain disaster recovery business data.
[0070] In one possible implementation, if the amount of differential data exceeds a specified amount, the first storage device can synchronize the differential data to the second storage device.
[0071] Specifically, after the first storage device acquires the difference data, it can determine whether the size of the difference data exceeds a specified data volume. If the size of the difference data exceeds the specified data volume, the difference data can be synchronized to the second storage device. The specified data volume can be preset according to the RPO requirements.
[0072] For example, when a business data synchronization operation is triggered between the first storage device and the second storage device at a certain time, and this synchronization takes 10 minutes to complete, during which the primary logical volume of the first storage device experiences a 100MB change, the first storage device can immediately begin synchronizing the 100MB difference data after the 10-minute synchronization process ends, provided that the load of the first storage device is less than or equal to a specified threshold and the 100MB change is greater than a specified data size of 20MB. If the synchronization process takes 5 minutes, and the primary logical volume of the first storage device experiences a 50MB change during these 5 minutes, the first storage device continues to synchronize this 50MB data because the load of the first storage device is less than or equal to the specified threshold and the 50MB change is greater than a specified data size of 20MB. If the synchronization process takes 2 minutes, and another 20MB change occurs during this period, since the 20MB change does not exceed the specified data size, data synchronization continues at the next time the load of the first storage device is less than or equal to the specified threshold and the difference data size is greater than 20MB. This reduces the number of data synchronizations and lowers system power consumption while maintaining a certain RPO (Recovery Point Objective).
[0073] S305, the second storage device returns a synchronization completion response to the first storage device.
[0074] In this embodiment of the application, after the second storage device has fully received the difference data sent by the first storage device and stored it in its own logical volume, it can determine that the process of the first storage device synchronizing data with the second storage device is complete, and then return a synchronization completion response to the first storage device.
[0075] The synchronization completion response indicates that the business data previously synchronized to the second storage device has been successfully synchronized.
[0076] In one possible implementation, after the first storage device receives the synchronization completion response, it can start a new round of determining whether its own load is less than or equal to a specified threshold, and re-execute steps S301 to S303 to start the next round of data synchronization between the first storage device and the second storage device.
[0077] In the above embodiments, the first storage device can use the data replication management module in the processor to determine whether its current load is less than a specified threshold when it needs to determine its own load status. In other words, during the normal operation of the business system of the first storage device, the first storage device can monitor and record its own load status in real time. After receiving the synchronization completion response returned by the second storage device, it can start to obtain its own load status at the current moment and compare it with the specified threshold. This allows the first storage device to determine whether its own load status can achieve data synchronization with the second storage device without affecting production business before starting the next data synchronization with the second storage device.
[0078] In another possible implementation, the processor in the first storage device may include an adaptive detection module in addition to the data replication management module. This adaptive detection module can detect whether the load of the first storage device at the current moment is less than or equal to a specified threshold, and modify the attribute status of the data synchronization flag in real time for the data replication management module to query. The data replication management module determines whether to initiate the synchronization of business data to the second storage device based on the queried attribute status of the data synchronization flag. Figure 5 A flowchart illustrating a data synchronization method provided in an exemplary embodiment of this application is shown. This data synchronization method can be executed by a first storage device. Specifically, the data synchronization method includes the following steps:
[0079] S31, the first storage device determines the attribute status of the data synchronization flag at the current moment.
[0080] In this embodiment of the application, the first storage device can determine the attribute status of the data synchronization flag stored in the first storage device at the current moment.
[0081] The data synchronization flag can be stored in the first storage device and is used to characterize whether the current load of the first storage device is less than or equal to a specified threshold.
[0082] In one possible implementation, when it is determined that the current load of the first storage device is less than or equal to a specified threshold, the attribute state of the data synchronization flag is determined to be a first state; when it is determined that the current load of the first storage device is greater than the specified threshold, the attribute state of the data synchronization flag is determined to be a second state.
[0083] The first state indicates that the current load of the first storage device is less than or equal to a specified threshold. The second state indicates that the current load of the first storage device is greater than the specified threshold.
[0084] For example, the data synchronization flag stored in the first storage device can be represented as STOP_REPLICATION. When the first storage device determines whether the load at the current moment is less than or equal to a specified threshold, if the current load is less than or equal to the specified threshold, the attribute state of the data synchronization flag STOP_REPLICATION can be marked as FALSE. That is, the first state of the data synchronization flag STOP_REPLICATION can be marked as FALSE. If it is determined that the current load is greater than the specified threshold, the attribute state of the data synchronization flag STOP_REPLICATION can be marked as TRUE. That is, the second state of the data synchronization flag STOP_REPLICATION can be marked as TRUE.
[0085] In one possible implementation, the load can be characterized by at least one of the following parameters: CPU usage of the first storage device, memory usage, and bandwidth of the business data input / output (I / O) interface.
[0086] If the load of the first storage device can be characterized by the CPU usage of the first storage device, the CPU usage can be the average of the current time and the three most recently recorded CPU usage rates before the current time.
[0087] If the load of the first storage device can be characterized by the memory usage of the first storage device, the memory usage can be the memory usage rate detected at the current moment.
[0088] The load of the first storage device can be characterized by the bandwidth of the I / O interface of the first storage device. The bandwidth of the I / O interface can be the bandwidth of the I / O interface detected at the current moment.
[0089] In one possible implementation, when the load of the first storage device needs to be characterized by at least two of the above parameters, it can be determined that if each parameter characterizing the load is less than its corresponding specified threshold, the first storage device can determine the attribute state of the data synchronization flag at the current moment as the first state.
[0090] The specified thresholds corresponding to different parameters representing the load can be the same or different. The specified threshold corresponding to the average CPU utilization can be a pre-set specified percentage. Similarly, the specified threshold corresponding to memory utilization can also be a specified percentage. The specified threshold corresponding to the bandwidth of the I / O interface can be a specified percentage of the historical bandwidth peak. For example, the specified percentage could be 80%.
[0091] In one possible implementation, in addition to the load of the first storage device, other performance characteristics of the first storage device can also affect the determination of the attribute state of the data synchronization flag at the current moment. Therefore, for the performance parameters in the first storage device, if the load of the first storage device is less than or equal to a specified threshold and the performance of the first storage device meets a preset indicator, the attribute state of the data synchronization flag at the current moment can be determined as the first state. However, if the load of the first storage device is less than or equal to the specified threshold and the performance of the first storage device does not meet the preset indicator, the attribute state of the data synchronization flag at the current moment can be determined as the second state.
[0092] For example, Figure 6 This is a schematic diagram illustrating the process of determining a data synchronization flag using an adaptive detection module according to an embodiment of this application. Figure 6 As shown, the first storage device can check whether the CPU load of the first storage device at the current moment is greater than the threshold corresponding to the CPU load (S11). If the CPU load of the first storage device at the current moment is less than or equal to the threshold corresponding to the CPU load, then it continues to check whether the memory load of the first storage device is greater than the threshold corresponding to the memory load (S12). If the memory load of the first storage device at the current moment is less than or equal to the threshold corresponding to the memory load, then it continues to check whether the service bandwidth load of the first storage device is greater than the threshold corresponding to the service bandwidth load (S13). If the service bandwidth load of the first storage device at the current moment is less than or equal to the threshold corresponding to the service bandwidth load, then it checks whether the first storage device... If the extended performance load is greater than the threshold corresponding to the performance load (S14), and the extended performance load of the first storage device is less than or equal to the threshold corresponding to the performance load, then the first storage device sets the data synchronization flag STOP_REPLICATION to FALSE and starts the adaptive data synchronization process to the second storage device (S15), then sleeps for a time interval and performs cyclic adaptive performance detection (S16). If at least one of the parameters representing the load is determined to be greater than the corresponding threshold, then the first storage device sets the data synchronization flag STOP_REPLICATION to TRUE and starts cyclic adaptive performance detection again (S17).
[0093] S32, the first storage device queries the attribute status of the data synchronization flag at the current moment.
[0094] In this embodiment, since the first storage device can determine the attribute status of the data synchronization flag after detecting the relationship between the load and the specified threshold at the current moment, the first storage device only needs to query the attribute status of the data synchronization flag at the current moment to determine whether the first storage device supports synchronizing data to the second storage device at the current moment.
[0095] For example, the first storage device can query whether the data synchronization flag STOP_REPLICATION is TRUE or FALSE at the current moment.
[0096] S33, the first storage device obtains the difference data when the attribute status of the queried data synchronization flag is in the first state.
[0097] In this embodiment of the application, the first storage device can query the attribute status of the data synchronization flag at the current time when the last time data synchronization with the second storage device is completed. When the query finds that the attribute status of the data synchronization flag at the current time is the first state, it can start to obtain the difference data between the current business data and the business data when the last time data synchronization with the second storage device was started.
[0098] In one possible implementation, the first storage device can query the data synchronization flag of the first storage device at the current moment. If the attribute status of the data synchronization flag of the first storage device at the current moment is the first state, then the difference data at the current moment can be obtained.
[0099] The data synchronization flag can be stored in the first storage device to indicate whether the current load of the first storage device is less than or equal to a specified threshold.
[0100] In one possible implementation, the first storage device queries the attribute status of the data synchronization flag the moment it receives the synchronization completion response from the second storage device.
[0101] The synchronization completion response indicates that the business data synchronized from the first storage device to the second storage device in the previous step has been successfully synchronized. In other words, after the previous data synchronization with the second storage device is completed—that is, when all business data to be sent to the second storage device has been successfully sent and written to the corresponding slave logical volume in the second storage device—a synchronization completion response can be returned to the first storage device indicating that data synchronization is complete. This "first moment" can be either the completion time of the previous data synchronization between the first and second storage devices, or the start time of the current data synchronization between the first and second storage devices when the data synchronization flag's attribute status is found to be in the first state. The first state can be used to indicate that the current load of the first storage device is less than or equal to a specified threshold.
[0102] In one possible implementation, if the attribute state at the first moment is found to be in the first state, the difference data is obtained.
[0103] For example, Figure 7This is a schematic diagram of a performance detection and data synchronization process according to an embodiment of this application. The performance detection process and the data synchronization process are two parallel threads in time. The performance detection process can detect whether the load of the first storage device at the current moment is less than or equal to a specified threshold according to a preset period. When it is determined that the load of the first storage device is less than or equal to the specified threshold, the attribute state of the data synchronization flag at the current moment is set to a first state. When it is determined that the load of the first storage device is greater than the specified threshold, the attribute state of the data synchronization flag at the current moment is set to a second state. Figure 7 As shown, since the attribute status of the data synchronization flag is in the first state at time 1, the first data synchronization with the second storage device begins. The first data synchronization with the second storage device ends when the current time reaches time 2. When the current time reaches time 2, the attribute status of the current data synchronization flag is queried. Since the attribute status of the current data synchronization flag is found to be in the first state at the current time, i.e. time 2, the difference data to be copied and synchronized to the second storage device can be obtained.
[0104] S34, if the first storage device finds that the attribute status of the data synchronization flag at the current time is the second state, it continues to query the attribute status of the data synchronization flag at the next time according to the time sequence, until the first storage device finds that the attribute status of the data synchronization flag has changed to the first state, and then begins to acquire the difference data.
[0105] In this embodiment of the application, when the first storage device finds that the attribute status of the data synchronization flag at the current time is the second state, it continues to query the attribute status of the data synchronization flag at each subsequent time in chronological order until the attribute status of the data synchronization flag of the first storage device changes from the second state to the first state, and then begins to acquire the difference data.
[0106] In one possible implementation, the first storage device can query the attribute status of the data synchronization flag at a preset period.
[0107] In other words, since the first storage device can determine the attribute status of the data synchronization flag according to a preset period, the update period of the data synchronization flag of the first storage device can be a preset period. That is, it is only necessary to query whether the attribute status of the data synchronization flag has changed from the second state to the first state when the attribute status of the data synchronization flag is updated according to the preset period.
[0108] In this process, when the attribute status of the data synchronization flag is found to be in the second state, the first storage device queries the attribute status of the data synchronization flag sequentially at subsequent detection times until the first detection time is reached, at which point it stops querying the attribute status and obtains the difference data at the first detection time.
[0109] The detection time can be the moment when the first storage device detects whether the load of the first storage device is less than or equal to a specified threshold. The first detection time can be the detection time when the first attribute state found in the subsequent query is the first state, according to the time sequence.
[0110] For example, such as Figure 7 As shown, if the first storage device completes the second data synchronization with the second storage device at time 3, the attribute status of the current data synchronization flag can be queried at time 3. Since the attribute status found at time 3 is the second state, the continuous copying process can be paused. When the next check time arrives, it is determined whether the current attribute status has changed. Since the attribute status of the data synchronization flag at this check time is still the second state, the attribute status of the data synchronization flag at the next check time is queried when the next check time arrives. If the next check time is time 4, since the data synchronization flag found at time 4 changes to the first state, time 4 is taken as the start time for the third data synchronization with the second storage device, and the acquisition of difference data begins.
[0111] S35, if the queried attribute status is in the second state, and no attribute status in the first state is found during the process of querying the attribute status of the data synchronization flag at subsequent detection times, and the time interval between the current time and the previous synchronization start time reaches a preset time interval, the difference data is obtained.
[0112] In this embodiment of the application, during the execution of S34, if the time interval between the current time and the last synchronization start time reaches a preset time interval during the subsequent detection of whether the attribute state of the data synchronization flag changes to the second state, then the process of synchronizing data to the second storage device can be started directly without considering whether the load is less than or equal to the specified threshold.
[0113] The synchronous startup time is the moment when data synchronization with the second storage device begins. The preset time period can be a preset time interval in asynchronous remote replication technology.
[0114] For example, such as Figure 7As shown, if the process of synchronizing data from the first storage device to the second storage device is completed at time 5, the attribute status of the data synchronization flag can be queried. Since the attribute status of the data synchronization flag at the time of completion of this data synchronization is the second state, the attribute status of the data synchronization flag can be queried when the current time reaches the subsequent detection time. Since the attribute status of the data synchronization flag at each detection time is the second state until time 6, and the time interval between time 5 and time 6 reaches the preset time interval, time 6 can be used as the data start time to obtain the difference data.
[0115] S36, the first storage device synchronizes the difference data to the second storage device, and when the difference data synchronization is complete, the second storage device returns a synchronization completion response to the first storage device.
[0116] For specific implementation details of the embodiments in this application, please refer to S304 and S305, which will not be repeated here.
[0117] For example, Figure 8 This is a schematic diagram of an adaptive continuous data replication process according to an embodiment of this application. Figure 8As shown, when the first storage device receives the synchronization completion response returned when the previous data synchronization with the second storage device is completed, it starts adaptive data replication. It queries whether the data synchronization flag STOP_REPLICATION is FALSE. If the data synchronization flag STOP_REPLICATION is FALSE, it means that continuous replication will not stop, that is, the current data synchronization process can continue from the previous data synchronization process. If the data synchronization flag STOP_REPLICATION is TRUE, it means that continuous replication stops, that is, there is an interval between the previous data synchronization process and the current data synchronization process (S21). If the data synchronization flag STOP_REPLICATION is TRUE, it enters sleep mode. The sleep time interval can be modified. The default sleep time interval is 1 second and is configurable. The sleep time interval can be the time interval between detection times (S22). It determines whether the interval between the current time and the previous synchronization start time is greater than a preset time period (S23). If it is greater than the preset time period, it executes S24. If it is less than or equal to the preset time period, it executes S21. The first storage device can record the synchronization start time RG_REP_START_TIME (S24). The first storage device clears the original snapshot RGNO_BEFORE_REP_SNAP and regenerates a new snapshot RGNO_BEFORE_REP_SNAP, where RGNO can be used to represent the identity of the remote replication consistency group (S25). Based on RGNO_BEFORE_REP_SNAP and DCL, the difference data of the current snapshot is obtained and copied to the second storage device at the disaster recovery end (S26). The second storage device can return a response indicating that the difference data was successfully written (S27).
[0118] In this embodiment, when a business data synchronization operation is triggered between the first storage device and the second storage device at a certain moment, the synchronization of business data to the second storage device takes 10 minutes to complete. During these 10 minutes, the primary logical volume of the first storage device undergoes a 100MB change. Therefore, after the 10-minute synchronization process ends, if the load of the first storage device is determined to be less than or equal to a specified threshold, the first storage device can immediately begin to continue synchronizing the 100MB difference data. If the synchronization process takes 5 minutes, and the primary logical volume of the first storage device undergoes a 50MB change during these 5 minutes, then the first storage device continues to synchronize this 50MB data. If the synchronization process takes 2 minutes, and another 20MB change occurs during this period, and synchronizing this 20MB takes another minute, the synchronization can continue until convergence. By using asynchronous replication to catch up, the interval between synchronization processes can become shorter and shorter, and the amount of data transmitted each time can become smaller and smaller, thereby maximizing the RPO of the system.
[0119] The foregoing mainly describes the solutions of the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the data synchronization device includes at least one of the hardware structures and software modules corresponding to each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0120] This application embodiment can divide the data recovery device into functional units according to the above method example. For example, each function can be divided into separate functional units, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0121] For example, Figure 9 A schematic diagram of a data synchronization device 400 provided in an exemplary embodiment of this application is shown. The data synchronization device 400 is applied in a first storage device and includes:
[0122] Processing module 410 is used to acquire difference data when the load of the first storage device is less than or equal to a specified threshold; the difference data includes business data for which input / output operations are performed on the first storage device within a first time period, the first time period being the time between the last time data synchronization with the second storage device started and the current time, the first storage device being the storage device at the business data production end; the second storage device being the storage device at the business data disaster recovery end;
[0123] The synchronization module 420 is used to synchronize the difference data to the second storage device.
[0124] For example, combining Figure 3 The processing module 410 can be used to perform, for example... Figure 3 As shown in S301, the synchronization module 420 can be used to perform, for example... Figure 3 S304 is shown.
[0125] In one possible implementation, the processing module 410 further includes:
[0126] The query submodule is used to query the attribute status of the data synchronization flag, which is stored in the first storage device and is used to characterize whether the current load of the first storage device is less than or equal to the specified threshold.
[0127] The acquisition submodule is used to acquire difference data when the queried attribute status is a first status, wherein the first status is used to indicate that the current load of the first storage device is less than or equal to the specified threshold.
[0128] For example, combining Figure 5 The processing module 410 can be used to perform, for example... Figure 5 S31 is shown.
[0129] In one possible implementation, the processing module 410 further includes:
[0130] If the attribute status found is in the second state, the attribute status of the data synchronization flag is queried sequentially at subsequent detection times until the first detection time is reached and the query of the attribute status is stopped. The detection time is the time when the first storage device detects whether the load of the first storage device is less than or equal to the specified threshold. The first detection time is the detection time when the first attribute status found in the subsequent query is in the first state according to the time sequence. The second state is used to indicate that the current load of the first storage device is greater than the specified threshold.
[0131] The difference data is acquired at the first detection time.
[0132] In one possible implementation, the processing module 410 further includes:
[0133] If the attribute status found is the second state, and the attribute status of the data synchronization flag is not found to be the first state during subsequent detection times, and the time interval between the current time and the previous synchronization start time reaches a preset time period, the difference data is obtained. The synchronization start time is the time when data synchronization with the second storage device begins.
[0134] In one possible implementation, the query submodule includes:
[0135] Upon receiving the synchronization completion response from the second storage device, the attribute status of the data synchronization flag is queried. The synchronization completion response indicates that the business data previously synchronized from the first storage device to the second storage device has been successfully synchronized.
[0136] The processing module 410 further includes:
[0137] If the attribute status at the first moment is found to be the first status, obtain the difference data.
[0138] In one possible implementation, the processing module 410 further includes:
[0139] When it is determined that the load of the first storage device is less than the specified threshold, a first snapshot is generated for the business data in the first storage device.
[0140] Based on the first snapshot and the data transformation log from the last time data was synchronized to the second storage device to the current time, the difference data is obtained. The data transformation log is a log recorded when the first storage device performs input / output operations.
[0141] In one possible implementation, the load is characterized by at least one of the following parameters: CPU usage of the first storage device, memory usage, and bandwidth of the business data input / output (I / O) interface.
[0142] In one possible implementation, the processing module 410 further includes:
[0143] When the load of the first storage device is characterized by at least two parameters, the difference data is obtained if none of the at least two parameters exceed the specified threshold of each of the at least two parameters.
[0144] In one possible implementation, the synchronization module 420 includes:
[0145] If the amount of the difference data exceeds a specified amount, the difference data will be synchronized to the second storage device.
[0146] For a detailed description of the above-mentioned optional methods, please refer to the foregoing method embodiments, which will not be repeated here. Furthermore, the explanation of any of the data synchronization devices provided above and the description of their beneficial effects can be found in the corresponding method embodiments described above, which will not be repeated here.
[0147] As an example, combined Figure 1 The functions implemented by some or all of the processing module 410 and synchronization module 420 in the data synchronization device can be achieved through... Figure 1 Processor 102 in the middle executes Figure 1 The program code implementation in the first storage device 110.
[0148] Figure 10This illustration shows a schematic diagram of a computing device 1100 provided in an exemplary embodiment of this application. The computing device 1100 can be an electronic device such as a smartphone, tablet computer, e-reader, portable personal computer, or smart wearable device. The computing device 1100 in this application may include one or more of the following components: a processor 1110 and a memory 1120.
[0149] Processor 1110 may include one or more processing cores. Processor 1110 connects to various parts of the terminal using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 1120, and by calling data stored in memory 1120. Optionally, processor 1110 may be implemented using at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). Processor 1110 may integrate one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the modem is used for wireless communication. It is understood that the modem may also not be integrated into processor 1110 and may be implemented separately using a communication chip.
[0150] The memory 1120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 1120 may include a non-transitory computer-readable storage medium. The memory 1120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 1120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described above, etc. The operating system may be an Android system (including systems deeply developed based on the Android system), an iOS system developed by Apple Inc. (including systems deeply developed based on the iOS system), or other systems. The data storage area may also store data created by the terminal during use (such as phonebook data, audio and video data, chat history data, etc.).
[0151] In addition, those skilled in the art will understand that the structure of the computing device 1100 shown in the above figures does not constitute a limitation on the computing device 1100. The computing device 1100 may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the terminal may also include radio frequency circuits, imaging components, sensors, audio circuits, wireless fidelity (WiFi) components, power supplies, Bluetooth components, etc., which will not be described in detail here.
[0152] This application also provides a computer-readable storage medium storing at least one computer instruction, which is loaded and executed by a processor to implement the data synchronization method described in the above embodiments. Explanations of the relevant content and descriptions of the beneficial effects of any of the computer-readable storage media provided above can be found in the corresponding embodiments described above, and will not be repeated here.
[0153] This application also provides a chip. This chip integrates a control circuit for implementing the functions of the aforementioned data synchronization device and one or more ports. Optionally, the functions supported by this chip can be referred to above, and will not be repeated here. Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium. The aforementioned storage medium can be a read-only memory, random access memory, etc. The aforementioned processing unit or processor can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0154] This application also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or may include one or more data storage devices such as servers or data centers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.
[0155] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of this application, such as, but not limited to, the aforementioned memory, computer-readable storage medium, and communication chip, are all non-transitory. Those skilled in the art should recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0156] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data synchronization method, characterized in that, Applied to a first storage device, the method includes: performance detection and synchronization, wherein the performance detection and synchronization are two threads that are parallel in time; The performance detection includes: detecting whether the load of the first storage device at the current moment is less than or equal to a specified threshold; when the load of the first storage device is less than or equal to the specified threshold, setting the attribute state of the data synchronization flag at the current moment to a first state; and when it is determined that the load of the first storage device is greater than the specified threshold, setting the attribute state of the data synchronization flag at the current moment to a second state. The data synchronization flag is stored in the first storage device and is used to characterize whether the current load of the first storage device is less than or equal to the specified threshold. The first state is used to indicate that the current load of the first storage device is less than or equal to the specified threshold. The synchronization includes: querying the attribute status of the data synchronization flag; If the queried attribute status is in the first state, obtain the difference data. The difference data includes business data for which input / output operations are performed on the first storage device within a first time period. The first time period is the time period between the last time data synchronization with the second storage device started and the current time. The first storage device is the storage device of the business data production end, and the second storage device is the storage device of the business data disaster recovery end. The difference data is synchronized to the second storage device.
2. The method according to claim 1, characterized in that, The method further includes: If the attribute status found is in the second state, the attribute status of the data synchronization flag is queried sequentially at subsequent detection times until the first detection time is reached and the query of the attribute status is stopped. The detection time is the time when the first storage device detects whether the load of the first storage device is less than or equal to the specified threshold. The first detection time is the detection time when the first attribute status found in the subsequent query is in the first state according to the time sequence. The second state is used to indicate that the current load of the first storage device is greater than the specified threshold. The difference data is acquired at the first detection time.
3. The method according to claim 2, characterized in that, The method further includes: If the attribute status found is the second state, and the attribute status of the data synchronization flag is not found to be the first state during subsequent detection times, and the time interval between the current time and the previous synchronization start time reaches a preset time period, the difference data is obtained. The synchronization start time is the time when data synchronization with the second storage device begins.
4. The method according to any one of claims 1 to 3, characterized in that, The attribute status of the query data synchronization flag includes: At the first moment after receiving the synchronization completion response from the second storage device, the attribute status of the data synchronization flag is queried. The synchronization completion response is used to indicate that the business data that was previously synchronized from the first storage device to the second storage device has been synchronized. When the queried attribute status is in the first state, the step of obtaining the difference data includes: If the attribute status at the first moment is found to be the first status, obtain the difference data.
5. The method according to any one of claims 1 to 3, characterized in that, The step of acquiring difference data when the load on the first storage device is less than or equal to a specified threshold includes: When it is determined that the load of the first storage device is less than the specified threshold, a first snapshot is generated for the business data in the first storage device. Based on the first snapshot and the data transformation log from the last time data was synchronized to the second storage device to the current time, the difference data is obtained. The data transformation log is a log recorded when the first storage device performs input / output operations.
6. The method according to any one of claims 1 to 3, characterized in that, The load is characterized by at least one of the following parameters: CPU usage of the first storage device, memory usage, and bandwidth of the service data input / output (I / O) interface.
7. The method according to any one of claims 1 to 3, characterized in that, The step of acquiring difference data when the load on the first storage device is less than or equal to a specified threshold includes: When the load of the first storage device is characterized by at least two parameters, the difference data is obtained if none of the at least two parameters exceed the specified threshold of each of the at least two parameters.
8. The method according to any one of claims 1 to 3, characterized in that, The step of synchronizing the difference data to the second storage device includes: If the amount of the difference data exceeds a specified amount, the difference data will be synchronized to the second storage device.
9. A computing device, characterized in that, The computing device includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, which are loaded and executed by the processor to enable the computing device to implement the data synchronization method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program instruction, which, when loaded and executed by a processor, implements the data synchronization method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
A disaster recovery platform and a disaster recovery method
CN109597718A
Service data processing method, processing device and terminal
CN113268395A
Data incremental backup method and device, equipment, and storage medium
CN113722152A