CN117112314B - Service data switching method, device, equipment and storage medium - Google Patents

Service data switching method, device, equipment and storage medium Download PDF

Info

Publication number
CN117112314B
CN117112314B CN202311380786.XA CN202311380786A CN117112314B CN 117112314 B CN117112314 B CN 117112314B CN 202311380786 A CN202311380786 A CN 202311380786A CN 117112314 B CN117112314 B CN 117112314B
Authority
CN
China
Prior art keywords
data
volume
end host
backup
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311380786.XA
Other languages
Chinese (zh)
Other versions
CN117112314A (en
Inventor
胡超
张勇
汪雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Clerware Technology Co ltd filed Critical Shenzhen Clerware Technology Co ltd
Priority to CN202311380786.XA priority Critical patent/CN117112314B/en
Publication of CN117112314A publication Critical patent/CN117112314A/en
Application granted granted Critical
Publication of CN117112314B publication Critical patent/CN117112314B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a service data switching method, a device, equipment and a storage medium, wherein the method comprises the following steps: in the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request; determining a disk area with data change between a time point to be switched and a data synchronization effective time point; generating data information to be adjusted based on backup data of the source machine volume and a disk area; pushing the data information to be adjusted to the standby end host so that the standby end host updates the data of the target volume; and sending a service switching instruction to the standby end host. The method and the device generate the data information to be adjusted according to the disk area with data change between the time point to be switched and the data synchronization effective time point and the backup data of the source machine volume, and push the data information to be adjusted to the standby end host to update the data of the target volume, thereby effectively realizing the rapid switching of the user service from the source end host to the standby end host service data.

Description

Service data switching method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data backup, and in particular, to a service data switching method, device, apparatus, and storage medium.
Background
With the rapid development of internet information technology, there are many schemes for realizing high availability in the disaster recovery field of service systems, and hot recovery is one of the schemes. The hot standby may perform hot standby on all hard disk data of the whole physical host, or may perform hot standby on only a file system volume where data concerned by a user is located, which is called volume hot standby. The volume hot standby is lighter than the whole machine hot standby, only the data concerned is hot standby, and the standby end host can be in a starting working state, but the target volume corresponding to the standby end host of the hot standby is in a non-mounting state. Compared with the whole machine hot standby, the time spent when the hot standby task of the volume is switched between the main and standby is less, only the target volume is required to be hung, and the downtime of user business when a disaster occurs is reduced.
However, various challenges are encountered in implementing volume hot standby, such as: how to realize the fast switching of the user business from the source end host to the standby end host business data, etc.
Therefore, a service data switching method is needed to effectively solve the technical problem of fast switching of service data from a source host to a standby host.
Disclosure of Invention
The invention mainly aims to provide a service data switching method, a device, equipment and a storage medium, which aim to solve the technical problem of how to realize the rapid switching of service data from a source host to a standby host in the prior art.
In order to achieve the above object, the present invention provides a service data switching method, which includes the following steps:
in the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host;
determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data;
generating data information to be adjusted based on the backup data of the source machine volume and the disk area;
pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted;
And sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host.
Optionally, the step of synchronizing the service data of the target volume and the source volume includes:
receiving a data synchronization instruction, determining a target volume in a standby end host based on the data synchronization instruction, and selecting a source machine volume from backup data volumes, wherein the backup data volumes are generated by backing up at least one disk volume of the source end host;
sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction;
and pushing the valid data of the source machine volume to the target volume.
Optionally, the step of pushing the valid data of the source machine volume to the target volume includes:
dividing the effective data of the source machine volume based on a preset time interval or a preset data volume to obtain a backup data unit;
pushing the backup data unit to the target volume;
and after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume.
Optionally, after the step of receiving the data synchronization instruction and determining the target volume in the backup end host based on the data synchronization instruction, the method further includes:
after receiving data sent by a source end host based on complete machine level basic backup, receiving the data sent by CDP backup sent by the source end host, and obtaining CDP backup data;
comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result;
and determining the valid data of the source machine volume in the CDP backup data according to the comparison result.
Optionally, the step of pushing the backup data unit to the target volume includes:
acquiring a distribution area of the effective data of the source machine volume on a disk;
determining volume data information of the effective data in the distribution area, wherein the volume data information comprises data content, data length and a volume offset value;
and pushing the backup data units to the target volume in sequence according to the time sequence based on the offset value of the volume.
Optionally, the data information to be adjusted is an adjustment area bitmap, and the step of generating the data information to be adjusted based on the backup data of the source machine volume and the disk area includes:
Determining a service switching backup point corresponding to the disk area according to the disk area;
the service switching backup point is used as backup data of the source machine volume;
and generating an adjustment area bitmap based on the backup data of the source machine volume and the disk area.
Optionally, before the step of generating the adjustment area bitmap based on the backup data of the source machine volume and the disk area, the method further includes:
performing format conversion operation on the region data corresponding to the specific region in the target volume in the service switching backup point to obtain a target service switching backup point;
correspondingly, after the step of sending the service switching instruction to the standby end host, the method further comprises:
determining difference data from the time point to be switched to a data synchronization effective time point according to the target service switching backup point and the disk area;
and sending the difference data to the standby end host.
In addition, in order to achieve the above object, the present invention also proposes a service data switching device, the device comprising:
the time determining module is used for determining a time point to be switched based on a service switching request when the service switching request is received in the process of synchronizing service data of a target volume and a source machine volume, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host;
The region determining module is used for determining a magnetic disk region with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data;
the information generation module is used for generating data information to be adjusted based on the backup data of the source machine volume and the disk area;
the data pushing module is used for pushing the data information to be adjusted to the standby end host so that the standby end host can update the data of the target volume based on the data information to be adjusted;
and the service switching module is used for sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host.
In addition, to achieve the above object, the present invention also proposes a service data switching device, the device comprising: the system comprises a memory, a processor and a service data switching program stored on the memory and capable of running on the processor, wherein the service data switching program is configured to realize the steps of the service data switching method.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a service data switching program which, when executed by a processor, implements the steps of the service data switching method as described above.
In the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host; determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data; generating data information to be adjusted based on the backup data of the source machine volume and the disk area; pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted; and sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host. Because the invention generates the data information to be adjusted according to the disk area with data change between the time point to be switched and the data synchronization effective time point and the backup data of the source machine volume, and pushes the data information to be adjusted to the standby machine to update the data of the target volume, compared with the prior art, the invention effectively realizes the rapid switching of the service data of the user service from the source machine to the standby machine.
Drawings
Fig. 1 is a schematic structural diagram of a service data switching device of a hardware running environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a first embodiment of a service data switching method according to the present invention;
fig. 3 is a flow chart of a second embodiment of the service data switching method of the present invention;
fig. 4 is a schematic diagram of a specific implementation scenario of the service data switching method of the present invention;
fig. 5 is a schematic flow chart of a third embodiment of a service data switching method according to the present invention;
fig. 6 is a block diagram of a first embodiment of a service data switching device according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a service data switching device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the service data switching apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is not limiting of the service data switching device and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a service data switching program may be included in the memory 1005 as one type of storage medium.
In the service data switching device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the service data switching device of the present invention may be disposed in the service data switching device, where the service data switching device invokes a service data switching program stored in the memory 1005 through the processor 1001, and executes the service data switching method provided by the embodiment of the present invention.
An embodiment of the present invention provides a service data switching method, referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the service data switching method of the present invention.
In this embodiment, the service data switching method includes the following steps:
Step S10: in the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on the source end host.
It should be noted that, the execution body of the embodiment may be a computing service device having functions of data processing, network communication and program running, such as a server, a tablet computer, a personal computer, or an electronic device, a service data switching device, or the like, which can implement the above functions. The present embodiment and the following embodiments will be described by way of example with reference to the backup integrated machine.
It can be understood that the backup integrated machine is a computer service device for controlling hot standby task scheduling of the source end host and the standby end host, receiving and storing source end host data, and then pushing the stored source end host data to the standby end host. The source host and the standby host may be computing service devices, such as servers, tablet computers, personal computers, and other electronic devices with similar functions, which is not limited in this embodiment.
It is readily understood that the source end-host may be a computer service device for storing user traffic data, user traffic work, and data protection is required. The standby end host can be a computer service device for synchronizing the data of the source end host and immediately undertaking the service of the source end host when the source end host fails and stops.
It should be understood that, since the data in the source volume in the source host is pushed to the target volume of the backup host in real time by the backup integrated machine, the data of the target volume in the backup host is generally consistent with the data of the source volume in the source host.
The service switching request may be request information including a time point for service switching selected by the user at the operation interface of the backup integrated machine.
Step S20: and determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data.
In the concrete implementation, in the process of synchronizing the service data of the target volume and the source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, and then comparing the time point to be switched with the time point of the latest synchronous data received by the standby end host; if the time point to be switched is earlier or later than the time point of the standby end host receiving the latest synchronous data, determining a disk area with data change between the time point to be switched and the time point of the data synchronous validation; if the time point to be switched is equal to the time point when the standby end host receives the latest synchronous data, a service switching instruction can be directly sent to the standby end host, so that the standby end host mounts the target volume, and the service supported by the source end host is switched to be supported by the standby end host, and service taking-over is completed.
For example, when the time point to be switched is 2023-08-08 07:00:00, the time point when the backup host receives the latest synchronous data is 2023-08-12:00:00, the time period from 2023-08-08:00:00 to 2023-08-08:12:00:00 can be counted in the backup all-in-one machine, which areas of data are pushed to the backup host together, specifically, the time period from 2023-08-08:00:00 to 2023-08-08:08:08:00:00:00 is counted, which magnetic disk areas are covered by the CDP backup data stream sent by the source host to the backup all-in-one machine, and the magnetic disk areas of these magnetic disk areas and the magnetic disk areas of the source volume have overlapped parts, that is, the areas of data already pushed to the backup host, that is, the target volumes of the backup host need to be data rolled back.
For another example, when the time point to be switched is 2023-08-09-07:00:00, the time point when the standby end host receives the latest synchronous data is 2023-08-12:00:00, and the CDP backup data disk area is not yet pushed in the period of time from 2023-08-12:00:00 to 2023-08-09-07:00:00 in the backup all-in-one machine, which is the disk area with data change, and may also be referred to as the area where the target volume of the standby end host needs to roll data.
It should be understood that the data adjustment area includes a data rollback area and a data rollback area, and the adjustment area bitmap includes a bitmap corresponding to the data rollback area and a bitmap corresponding to the data rollback area.
Step S30: and generating data information to be adjusted based on the backup data of the source machine volume and the disk area.
It should be noted that, in order to increase the rate of switching the service data of the user service from the source end host to the standby end host, the data information to be adjusted may be an adjustment area bitmap.
It should be explained that, the service switching backup point corresponding to the disk area can be determined according to the disk area; the service switching backup point is used as backup data of the source machine volume; and generating an adjustment area bitmap based on the backup data of the source machine volume and the disk area.
For example, determining a rollback area of a target volume of the standby end host to be rolled back according to a disk area with data change between a time point to be switched and a data synchronization effective time point; the service switching backup point is then determined according to the rollback area, that is, before 2023-08-07:00:00, and is the backup point closest to 2023-08-07:00:00, only the latest backup point is needed, and not needed earlier (for example, if a rollback area is reserved for 2023-08-01:00:00, and CDP is reserved for 2023-08-05-07:00:00, only backup data for 2023-08-05-07:00:00 is needed, and not needed earlier). After obtaining the area data, a rollback area bitmap of the areas is generated (the sector needing to be rolled back is identified as 1, otherwise, the sector needing to be rolled back is identified as 0), and the area bitmap is sent to the standby host.
It should be understood that, in this embodiment, for the scenario where data rollback is required, only the bitmap corresponding to the disk area where CDP backup data has not yet been pushed needs to be counted and sent to the standby host.
Step S40: pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted.
It should be noted that, in order to prevent the data from being modified by the target volume mounted by other processes on the standby host or by performing data consistency check on the target volume after the system is restarted, the data in a specific area (such as a superblock) on the target volume needs to be subjected to format conversion (such as operations of negation, exclusive or, encryption, etc.). The format conversion operation can be performed on the region data corresponding to the specific region in the target volume in the service switching backup point through the backup integrated machine, or the format conversion operation can be performed on the data of the specific region on the target volume of the backup end host after the data of the target volume is updated, so that the data on the target volume can be prevented from being modified by other programs or operating systems.
Step S50: and sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host.
It can be understood that, format conversion operation is performed on the area data corresponding to the specific area in the target volume in the service switching backup point, so as to obtain a target service switching backup point; correspondingly, after the step of sending the service switching instruction to the standby end host, the method further comprises: determining difference data from the time point to be switched to a data synchronization effective time point according to the target service switching backup point and the disk area; and sending the difference data to the standby end host.
It should be understood that, after receiving the service switching instruction and the adjustment area bitmap, the standby end host informs the target volume filter driver of the adjustment area bitmap. The subsequent target volume filtering driver captures the read-write requests of the data adjustment areas according to the bitmap of the adjustment areas, when an application program executes read-write operations on the areas, the application program needs to firstly fetch the data from the backup integrated machine and write the data onto the disk (and the bitmap of the corresponding area is clear 0, that is, the data is not fetched from the backup integrated machine later), and then the read-write requests of the application program are put forward (the operations of the disk filtering driver are transparent to the application program, and the data of the areas are equivalent to the data on the disk in view of the application program, but the read-write speed is slightly slower). And after the target volume filtering drive adjustment area bitmap is notified, restoring the data of the specific area on the target volume to the original format.
It should be explained that after the restoration of the data in the specific area is completed, the target volume may be tried to be mounted, and after the mounting, the service program of the system may be started to complete the service takeover. Because the read-write request of the application program is captured through the target volume filtering driver, when the service program needs to read and write the service data of the target volume, the difference data of the corresponding area is acquired back (the data can be acquired back in advance when the system is idle), the service can be recovered without the need of retrieving all the data of the adjustment area in advance, and the quick switching of the service data of the user service from the source end host to the standby end host is effectively realized.
In the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host; determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data; generating data information to be adjusted based on the backup data of the source machine volume and the disk area; pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted; and sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host. Because the embodiment generates the data information to be adjusted according to the disk area with the data change between the time point to be switched and the data synchronization effective time point and the backup data of the source machine volume, and pushes the data information to be adjusted to the standby machine host to update the data of the target volume, compared with the prior art, the embodiment effectively realizes the rapid switching of the service data of the user service from the source machine host to the standby machine host.
Referring to fig. 3, fig. 3 is a flow chart of a second embodiment of the service data switching method of the present invention.
Based on the first embodiment, in this embodiment, the step of synchronizing the service data of the target volume and the source volume in step S10 includes:
step S01: and receiving a data synchronization instruction, determining a target volume in the standby end host based on the data synchronization instruction, and selecting a source machine volume from backup data volumes, wherein the backup data volumes are generated by backing up at least one disk volume of the source end host.
It should be noted that, after receiving the data synchronization instruction and determining the target volume in the standby end host based on the data synchronization instruction, the method further includes: after receiving data sent by a source end host based on complete machine level basic backup, receiving the data sent by CDP backup sent by the source end host, and obtaining CDP backup data;
comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result; and determining the valid data of the source machine volume in the CDP backup data according to the comparison result.
It should be understood that the original data of the disk of the source host and the data which are changed subsequently are continuously backed up to the backup integrated machine to form backup points, and the number of the disks in the backup points is consistent with that of the source host. The operation process of backup is to enumerate the number of disks on the host computer first, obtain the effective data on each disk, and then backup to the backup integrated machine for storage. Each block of data stored contains the data content, the offset of the data on the source volume, the data length, and the data write time.
Step S02: and sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction.
It should be appreciated that if the business process is not stopped, the target volume may not be unloaded, and data is synchronized without unloading the target volume, which may cause a system crash, thus requiring that the business process be stopped before the target volume is unloaded. Because of different business programs, service names and program names are different, the method for stopping the business programs needs special treatment, for example, enumerating which programs on the system open files on the target volume, ending the processes, and then unloading the volume. After unloading, a specific area (such as a superblock of the volume) of the target volume is cleared, so that a program is prevented from mounting the target volume again.
It should be noted that, the backup integrated machine obtains the distribution area of the volume data on the disk according to the source machine volume selected by the user (the source machine volume may be formed by a certain partition on the disk or may be formed by a plurality of partitions on a plurality of disks, so that the distribution of the volume data needs to be obtained), pushes the data, the data length and the offset of the corresponding volume in these areas to the backup host, and writes the data to the target volume corresponding to the backup host according to the offset of the volume. For example, the disk of the source host is 300G, 3 partitions (C, D, E, respectively) are created, each 100G, and the user chooses to synchronize the data of the D to the backup host, in which case only the data on the disk offset by 100G to 200G is synchronized to the target volume of the backup host. For another example, a volume size is 200G, and is formed by stitching 2 hard disks, and each hard disk is 100G, then the data of the 2 hard disks needs to be synchronized to the target volume of the standby host.
Step S03: and pushing the valid data of the source machine volume to the target volume.
When the backup integrated machine pushes the CDP backup data stream to the backup end host, the backup integrated machine first judges the area range of the data to be pushed, and if the data belongs to the area range of the source machine volume, the data is pushed to the backup end host according to the time sequence; if the data does not belong to the regional scope of the source machine volume, pushing is not needed; if a part belongs to the regional scope of the source machine volume and a part does not, only the part of data belonging to the regional scope of the source machine volume needs to be pushed, and the other part does not need to be pushed.
For example, referring to fig. 4, fig. 4 is a schematic diagram of a specific implementation scenario of the service data switching method of the present invention, in this embodiment, by performing a complete machine level basic backup and CDP backup on a source host, data is backed up in real time into a backup integrated machine for storage, and a user selects a source machine volume at an operation interface of the backup integrated machine according to own service needs, so that data on the source machine volume is synchronized to a target volume of a standby host in real time. As shown in fig. 4, the source host performs overall-level basic backup and CDP backup, where the backup point includes data of a C disc, a D disc, and an E disc, and the user selects to synchronize service data of the D disc to an F disc of the backup host in real time in an operation interface of the backup integrated machine (that is, CDP backup data stream of the source host is pushed to the backup host through the backup integrated machine). When the service of the source end host fails, the service program can be started on the standby end host rapidly, the service can be recovered rapidly by using the service data of the F disc, and the continuity of the service is ensured. In addition, if misoperation occurs in the source host, and data of the service system is deleted by mistake at 2023-08-01:01:00 to cause service interruption, a backup point (a selection history point) of 2023-08-01:00:50 can be selected at an operation interface of the backup integrated machine, and data of the source host D disk is synchronized to the backup host F disk to perform service recovery.
The embodiment receives a data synchronization instruction, determines a target volume in a standby end host based on the data synchronization instruction, and selects a source machine volume from backup data volumes, wherein the backup data volumes are generated by backing up at least one disk volume of the source end host; after receiving data sent by a source end host based on complete machine level basic backup, receiving the data sent by CDP backup sent by the source end host, and obtaining CDP backup numbers; comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result; determining the effective data of the source machine volume in the CDP backup data according to the comparison result; sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction; and pushing the valid data of the source machine volume to the target volume. Compared with the prior art, the method and the device have the advantages that the synchronization efficiency of the source machine volume in the source end host and the target volume in the standby end host is improved, and the rapid adaptation of the data volumes of the source end host and the standby end host is realized.
Referring to fig. 5, fig. 5 is a flowchart of a third embodiment of a service data switching method according to the present invention.
Based on the above embodiments, in this embodiment, the step S03 includes:
Step S031: and cutting the effective data of the source machine volume based on a preset time interval or a preset data volume to obtain a backup data unit.
It should be noted that the preset time interval may be user-defined, for example, 10 seconds, 1 minute, 10 minutes, etc., which is not limited in this embodiment. The preset data amount may also be user-defined, for example, 5G, 10G, etc., which is not limited in this embodiment.
Step S032: pushing the backup data unit to the target volume.
In a specific implementation, the distribution area of the effective data of the source machine volume on the disk can be obtained; determining volume data information of the effective data in the distribution area, wherein the volume data information comprises data content, data length and a volume offset value; and pushing the backup data units to the target volume in sequence according to the time sequence based on the offset value of the volume.
Step S033: and after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume.
In a specific implementation, when the backup integrated machine receives the CDP backup data stream of the source end host, the valid data of the source machine volume is split into a series of data unit backup data units according to a preset data volume (for example, 10G) or a preset time interval (for example, 20 minutes), for example, the data volume of each 10G is regarded as a backup data unit, or the data stream of each 20 minutes is regarded as a backup data unit. If the subsequent backup host computer is abnormally restarted in the data pushing process, and the current data state on the target volume of the backup host computer is not well confirmed at the moment corresponding to the CDP data stream, the backup data unit currently being synchronized is re-synchronized once, and the data before the current backup data unit is not required to be transmitted once again. After the transmission of one backup data unit is completed, the standby end host computer needs to wait for the synchronous data to be written into the hard disk, and then the transmission of the next backup data unit is started, so that the standby end host computer is enabled to be restarted abnormally at the moment of starting the transmission of the next backup data unit, and data loss can not occur.
The embodiment receives a data synchronization instruction, determines a target volume in a standby end host based on the data synchronization instruction, and selects a source machine volume from backup data volumes, wherein the backup data volumes are generated by backing up at least one disk volume of the source end host; after receiving data sent by a source end host based on complete machine level basic backup, receiving the data sent by CDP backup sent by the source end host, and obtaining CDP backup data; comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result; determining the effective data of the source machine volume in the CDP backup data according to the comparison result; sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction; dividing the effective data of the source machine volume based on a preset time interval or a preset data volume to obtain a backup data unit; pushing the backup data unit to the target volume; and after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume. Compared with the prior art, in this embodiment, after the backup data unit is transmitted, the backup end host needs to wait for the backup end host to write all the synchronized data into the hard disk, and then start the transmission of the next backup data unit, so that the backup end host is ensured to be restarted abnormally at the moment of starting the transmission of the next backup data unit, and no data loss occurs.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a service data switching program, and the service data switching program realizes the steps of the service data switching method when being executed by a processor.
Referring to fig. 6, fig. 6 is a block diagram illustrating a first embodiment of a service data switching device according to the present invention.
As shown in fig. 6, the service data switching device provided in the embodiment of the present invention includes: a time determining module 601, a region determining module 602, an information generating module 603, a data pushing module 604 and a service switching module 605.
The time determining module 601 is configured to determine, when a service switching request is received during a process of synchronizing service data of a target volume and a source volume, a time point to be switched based on the service switching request, where the target volume is a disk volume on a standby host, and the source volume is a disk volume on the source host.
The area determining module 602 is configured to determine a disk area where data changes exist between the time point to be switched and a data synchronization validation time point, where the data synchronization validation time point is a time point when the standby end host receives the latest synchronization data.
The information generating module 603 is configured to generate data information to be adjusted based on the backup data of the source machine volume and the disk area.
The data pushing module 604 is configured to push the data information to be adjusted to the backup end host, so that the backup end host updates data of the target volume based on the data information to be adjusted.
The service switching module 605 is configured to send a service switching instruction to the standby end host, so that the standby end host mounts the target volume, and switches a service supported by the source end host to be supported by the standby end host.
The information generating module 603 is further configured to determine a service switching backup point corresponding to the disk area according to the disk area; the service switching backup point is used as backup data of the source machine volume; and generating an adjustment area bitmap based on the backup data of the source machine volume and the disk area.
The information generating module 603 is further configured to perform a format conversion operation on the area data corresponding to the specific area in the target volume in the service switching backup point, so as to obtain a target service switching backup point.
The service switching module 605 is further configured to determine, according to the target service switching backup point and the disk area, difference data from the time point to be switched to a time point at which data synchronization takes effect; and sending the difference data to the standby end host.
In the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host; determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data; generating data information to be adjusted based on the backup data of the source machine volume and the disk area; pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted; and sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host. Because the embodiment generates the data information to be adjusted according to the disk area with the data change between the time point to be switched and the data synchronization effective time point and the backup data of the source machine volume, and pushes the data information to be adjusted to the standby machine host to update the data of the target volume, compared with the prior art, the embodiment effectively realizes the rapid switching of the service data of the user service from the source machine host to the standby machine host.
Based on the above-mentioned first embodiment of the service data switching device of the present invention, a second embodiment of the service data switching device of the present invention is proposed.
In this embodiment, the time determining module 601 is further configured to receive a data synchronization instruction, determine a target volume in the backup end host based on the data synchronization instruction, and select a source machine volume from backup data volumes, where the backup data volumes are generated by backing up at least one disk volume of the source end host; sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction; and pushing the valid data of the source machine volume to the target volume.
The time determining module 601 is further configured to receive, after receiving data sent by the source end host based on the overall level basic backup, data sent by the CDP backup sent by the source end host, and obtain CDP backup data; comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result; and determining the valid data of the source machine volume in the CDP backup data according to the comparison result.
The time determining module 601 is further configured to segment the valid data of the source machine volume based on a preset time interval or a preset data amount, to obtain a backup data unit; pushing the backup data unit to the target volume; and after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume.
Other embodiments or specific implementation manners of the service data switching device of the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. A method for switching service data, the method comprising the steps of:
in the process of synchronizing service data of a target volume and a source machine volume, when a service switching request is received, determining a time point to be switched based on the service switching request, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host;
determining a disk area with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data;
generating data information to be adjusted based on the backup data of the source machine volume and the disk area;
pushing the data information to be adjusted to the standby end host, so that the standby end host updates the data of the target volume based on the data information to be adjusted;
Sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host;
the step of synchronizing the service data of the target volume and the source machine volume comprises the following steps:
receiving a data synchronization instruction, determining a target volume in a standby end host based on the data synchronization instruction, and selecting a source machine volume from backup data volumes, wherein the backup data volumes are generated by backing up at least one disk volume of the source end host;
sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction;
pushing the valid data of the source machine volume to the target volume;
the step of pushing the valid data of the source machine volume to the target volume includes:
dividing the effective data of the source machine volume based on a preset time interval or a preset data volume to obtain a backup data unit;
pushing the backup data unit to the target volume;
after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume;
After the step of receiving the data synchronization instruction and determining the target volume in the standby end host based on the data synchronization instruction, the method further comprises the following steps:
after receiving data sent by a source end host based on complete machine level basic backup, receiving the data sent by CDP backup sent by the source end host, and obtaining CDP backup data;
comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result;
and determining the valid data of the source machine volume in the CDP backup data according to the comparison result.
2. The service data switching method according to claim 1, wherein the step of pushing the backup data unit to the target volume includes:
acquiring a distribution area of the effective data of the source machine volume on a disk;
determining volume data information of the effective data in the distribution area, wherein the volume data information comprises data content, data length and a volume offset value;
and pushing the backup data units to the target volume in sequence according to the time sequence based on the offset value of the volume.
3. The service data switching method according to claim 1, wherein the data information to be adjusted is an adjustment area bitmap, and the step of generating the data information to be adjusted based on the backup data of the source machine volume and the disk area includes:
Determining a service switching backup point corresponding to the disk area according to the disk area;
the service switching backup point is used as backup data of the source machine volume;
and generating an adjustment area bitmap based on the backup data of the source machine volume and the disk area.
4. The service data switching method according to claim 3, wherein before the step of generating the adjustment area bitmap based on the backup data of the source volume and the disk area, the method further comprises:
performing format conversion operation on the region data corresponding to the specific region in the target volume in the service switching backup point to obtain a target service switching backup point;
correspondingly, after the step of sending the service switching instruction to the standby end host, the method further comprises:
determining difference data from the time point to be switched to a data synchronization effective time point according to the target service switching backup point and the disk area;
and sending the difference data to the standby end host.
5. A service data switching device, the device comprising:
the time determining module is used for determining a time point to be switched based on a service switching request when the service switching request is received in the process of synchronizing service data of a target volume and a source machine volume, wherein the target volume is a disk volume on a standby end host, and the source machine volume is a disk volume on a source end host;
The region determining module is used for determining a magnetic disk region with data change between the time point to be switched and the data synchronization effective time point, wherein the data synchronization effective time point is the time point when the standby end host receives the latest synchronization data;
the information generation module is used for generating data information to be adjusted based on the backup data of the source machine volume and the disk area;
the data pushing module is used for pushing the data information to be adjusted to the standby end host so that the standby end host can update the data of the target volume based on the data information to be adjusted;
the service switching module is used for sending a service switching instruction to the standby end host, so that the standby end host mounts the target volume and switches the service supported by the source end host to be supported by the standby end host;
the time determining module is further configured to receive a data synchronization instruction, determine a target volume in the backup end host based on the data synchronization instruction, and select a source machine volume from backup data volumes, where the backup data volumes are generated by backing up at least one disk volume of the source end host; sending a volume unloading instruction to a standby end host, so that the standby end host unloads the target volume after receiving the volume unloading instruction; pushing the valid data of the source machine volume to the target volume;
The time determining module is further configured to segment the valid data of the source machine volume based on a preset time interval or a preset data amount, so as to obtain a backup data unit; pushing the backup data unit to the target volume; after receiving a data writing success instruction sent by the standby end host, continuing to execute the step of pushing the backup data unit to the target volume until the valid data of the source machine volume are all pushed to the target volume;
the time determining module is further used for receiving the CDP backup sent data sent by the source end host after receiving the data sent by the source end host based on the whole machine level basic backup, and obtaining CDP backup data; comparing the CDP backup data with the data of the source machine volume and obtaining a comparison result; and determining the valid data of the source machine volume in the CDP backup data according to the comparison result.
6. A service data switching apparatus, the apparatus comprising: a memory, a processor and a service data switching program stored on the memory and executable on the processor, the service data switching program being configured to implement the steps of the service data switching method according to any one of claims 1 to 4.
7. A storage medium having stored thereon a service data switching program which, when executed by a processor, implements the steps of the service data switching method according to any one of claims 1 to 4.
CN202311380786.XA 2023-10-24 2023-10-24 Service data switching method, device, equipment and storage medium Active CN117112314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311380786.XA CN117112314B (en) 2023-10-24 2023-10-24 Service data switching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311380786.XA CN117112314B (en) 2023-10-24 2023-10-24 Service data switching method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117112314A CN117112314A (en) 2023-11-24
CN117112314B true CN117112314B (en) 2024-02-06

Family

ID=88809602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311380786.XA Active CN117112314B (en) 2023-10-24 2023-10-24 Service data switching method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117112314B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062263A (en) * 2017-12-27 2018-05-22 深圳市科力锐科技有限公司 Data switching method, device, server, system and storage medium
CN110209726A (en) * 2018-02-12 2019-09-06 中兴通讯股份有限公司 Distributed experiment & measurement system system, method of data synchronization and storage medium
US10705920B1 (en) * 2017-10-26 2020-07-07 Gravic, Inc. Method and system for implementing current, consistent, and complete backups
CN116541469A (en) * 2023-07-07 2023-08-04 深圳市科力锐科技有限公司 Method, device, equipment and storage medium for realizing data synchronization

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8055745B2 (en) * 2004-06-01 2011-11-08 Inmage Systems, Inc. Methods and apparatus for accessing data from a primary data storage system for secondary storage
US8601225B2 (en) * 2005-09-16 2013-12-03 Inmage Systems, Inc. Time ordered view of backup data on behalf of a host

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10705920B1 (en) * 2017-10-26 2020-07-07 Gravic, Inc. Method and system for implementing current, consistent, and complete backups
CN108062263A (en) * 2017-12-27 2018-05-22 深圳市科力锐科技有限公司 Data switching method, device, server, system and storage medium
CN110209726A (en) * 2018-02-12 2019-09-06 中兴通讯股份有限公司 Distributed experiment & measurement system system, method of data synchronization and storage medium
CN116541469A (en) * 2023-07-07 2023-08-04 深圳市科力锐科技有限公司 Method, device, equipment and storage medium for realizing data synchronization

Also Published As

Publication number Publication date
CN117112314A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
CN102594849B (en) Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device
US11947429B2 (en) Data disaster recovery method and site
EP2731013A1 (en) Backing up method, device, and system for virtual machine
US8578203B2 (en) Providing a backup service from a remote backup data center to a computer through a network
US8370591B2 (en) Method and apparatus for automatic snapshot
US6754842B2 (en) Facilitating a restart operation within a data processing system
CN107729515B (en) Data synchronization method, device and storage medium
CN110825562B (en) Data backup method, device, system and storage medium
CN110109628B (en) Data reconstruction method, device, equipment and storage medium of distributed storage system
US7284109B1 (en) Partition creation
US20090164840A1 (en) System and Method For Managing Root File System
JP4560074B2 (en) Virtual computer system and virtual computer restoration method in the same system
CN112579361B (en) Backup data reconstruction method, device, equipment and storage medium
CN107621994B (en) Method and device for creating data snapshot
CN117112314B (en) Service data switching method, device, equipment and storage medium
CN111309799A (en) Method, device and system for realizing data merging and storage medium
CN112416527A (en) Data recovery method, device, equipment and storage medium
CN110941516A (en) Operating system restoration method, device, equipment and storage medium
CN112333008B (en) Cloud host complete machine backup and restoration method, device, equipment and storage medium
CN113297134B (en) Data processing system, data processing method and device, and electronic device
KR101552580B1 (en) Method for system recovery including mobile device and backup supporting multi operation system
CN110389713B (en) Data synchronization method, apparatus and computer readable medium
CN117112313B (en) Service disaster tolerance switching method, device, equipment and storage medium
CN107145302B (en) Method and equipment for executing file writing in distributed storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant