Hybrid cloud data synchronization method, device, electronic device and storage medium

By determining the switch status field value of the target service in the public cloud and triggering a synchronization message, the problem of data synchronization between private cloud and public cloud is solved, data consistency and user data accessibility are achieved, and user data loss is avoided.

CN116233155BActive Publication Date: 2025-08-22BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310279490.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2025-08-22
Estimated Expiration
2043-03-21

AI Technical Summary

Technical Problem

Since the storage middleware of the private cloud is different from the storage middleware of the public cloud, it is impossible to achieve two-way synchronization of data between the private cloud and the public cloud, resulting in instability or failure of the public cloud storage middleware, the user data written to the public cloud during the grayscale period cannot be accessed, resulting in the loss of user data.

Method used

By determining the switch status field value of the target service in the public cloud and triggering synchronization of incremental data to the private cloud when the preset requirements are met, private cloud consumers are notified to synchronize data by using message clusters to realize two-way data synchronization between the private cloud and the public cloud.

Benefits of technology

It ensures that when the public cloud storage middleware is unstable or faulty, the user data written to the public cloud during grayscale can still be accessed, avoiding user data loss and achieving data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233155B_ABST
    Figure CN116233155B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a hybrid cloud data synchronization method, device, electronic device and storage medium, the method includes: determining the switch status field corresponding to the target service, the target service is a service that is migrated from a private cloud to a public cloud for deployment; obtaining the switch status field value corresponding to the switch status field, and judging whether the switch status field value meets the preset requirements; when the switch status field value meets the preset requirements, triggering a synchronization message for synchronizing incremental data from the public cloud to the private cloud; sending the synchronization message to the message cluster, and notifying the private cloud consumer to consume the synchronization message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud. In this way, two-way synchronization of data between the private cloud and the public cloud can be achieved, ensuring data consistency, and when problems occur in the public cloud, it can be switched back to the private cloud at any time. User data written to the public cloud storage during the grayscale period can still be accessed, avoiding user data loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a hybrid cloud data synchronization method, device, electronic device and storage medium. Background Art

[0002] Currently, a service needs to be migrated from a private cloud to a public cloud for deployment. The API code is already deployed on the public cloud, but the storage middleware is deployed on the private cloud. Therefore, data operations require cross-network calls to the storage middleware on the private cloud.

[0003] To avoid cross-network calls to the storage middleware within the service, during the grayscale period of migrating the service from the private cloud to the public cloud for deployment, apply for the public cloud's storage middleware, and synchronize the private cloud and hybrid cloud data to the public cloud through the public cloud's storage middleware.

[0004] Because the storage middleware used in private clouds differs from that used in public clouds, bidirectional data synchronization between the private and public clouds is not possible. If the public cloud storage middleware becomes unstable or even fails, and service is switched back to the private cloud, user data written to the public cloud storage during the grayscale rollout will become inaccessible, resulting in data loss. Summary of the Invention

[0005] In order to solve the above-mentioned problem that due to the difference between the storage middleware of the private cloud and the storage middleware of the public cloud, it is impossible to achieve two-way synchronization of data between the private cloud and the public cloud. If the storage middleware of the public cloud becomes unstable or even fails, the service will be switched back to the private cloud. Then, the user data written to the public cloud storage during the grayscale period will be inaccessible, resulting in the technical problem of user data loss. The embodiments of the present invention provide a hybrid cloud data synchronization method, device, electronic device and storage medium. The specific technical solution is as follows:

[0006] In a first aspect of an embodiment of the present invention, a hybrid cloud data synchronization method is provided, which is applied to a public cloud. The method includes:

[0007] Determine a switch status field corresponding to a target service, wherein the target service is a service that is being migrated from a private cloud to a public cloud for deployment;

[0008] Obtaining a switch status field value corresponding to the switch status field, and determining whether the switch status field value meets a preset requirement;

[0009] When the switch status field value meets the preset requirements, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud;

[0010] The synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.

[0011] In an optional implementation, determining whether the switch status field value meets a preset requirement includes:

[0012] Determine whether the switch status field value is a preset third value, where the preset third value indicates sending a synchronization message and consuming a synchronization message;

[0013] The triggering of the synchronization message of synchronizing the public cloud incremental data to the private cloud when the switch status field value meets the preset requirements includes:

[0014] When the switch status field value is a preset third value, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud.

[0015] In an optional embodiment, when the switch status field value is a preset third value, triggering a synchronization message for synchronizing incremental data from the public cloud to the private cloud includes:

[0016] When the switch status field value is a preset third value, detecting whether the unidirectional data synchronization from the private cloud to the public cloud has been interrupted;

[0017] When the one-way data synchronization from the private cloud to the public cloud is interrupted, a synchronization message is triggered to synchronize the incremental data from the public cloud to the private cloud;

[0018] When the one-way data synchronization from the private cloud to the public cloud is not interrupted, the one-way data synchronization from the private cloud to the public cloud is interrupted, and a synchronization message is triggered to synchronize the incremental data of the public cloud to the private cloud.

[0019] In an optional implementation, after obtaining the switch status field value corresponding to the switch status field, the method further includes:

[0020] Determine whether the switch status field value is a preset first value, where the preset first value indicates that a synchronization message is not sent and a synchronization message is not consumed;

[0021] When the switch status field value is a preset first value, obtaining the status corresponding to the target service;

[0022] According to the status corresponding to the target service, the incremental data is stored in a public cloud or a private cloud.

[0023] In an optional implementation, after obtaining the switch status field value corresponding to the switch status field, the method further includes:

[0024] Determine whether the switch status field value is a preset second value, where the preset second value indicates that a synchronization message is sent and no synchronization message is consumed;

[0025] When the switch status field value is a preset second value, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud, and the synchronization message is sent to the message cluster.

[0026] In an optional embodiment, the method further comprises:

[0027] When the switch status field value is a preset second value, one-way data synchronization from the private cloud to the public cloud is performed.

[0028] In an optional embodiment, notifying the private cloud consumer to consume the synchronization message in the message cluster and synchronizing the incremental data in the public cloud to the private cloud includes:

[0029] Notify the private cloud consumer to consume the synchronization message in the message cluster according to the triggering time of the synchronization message, and synchronize the incremental data in the public cloud to the private cloud.

[0030] In a second aspect of an embodiment of the present invention, a hybrid cloud data synchronization device is further provided, the device comprising:

[0031] A field determination module, configured to determine a switch status field corresponding to a target service, wherein the target service is a service that is being migrated from a private cloud to a public cloud for deployment;

[0032] A field value acquisition module, used to obtain the switch status field value corresponding to the switch status field;

[0033] A field value judgment module is used to judge whether the switch status field value meets the preset requirements;

[0034] A message triggering module, configured to trigger a synchronization message for synchronizing incremental data from the public cloud to the private cloud when the switch status field value meets a preset requirement;

[0035] A message sending module, configured to send the synchronization message to a message cluster;

[0036] The data synchronization module is used to notify the private cloud consumer to consume the synchronization message in the message cluster and synchronize the incremental data in the public cloud to the private cloud.

[0037] In a third aspect of an embodiment of the present invention, an electronic device is provided, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0038] Memory for storing computer programs;

[0039] The processor is configured to implement the hybrid cloud data synchronization method described in any one of the first aspects above when executing the program stored in the memory.

[0040] In a fourth aspect of an embodiment of the present invention, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any hybrid cloud data synchronization method described in the first aspect above.

[0041] In a fifth aspect of the embodiments of the present invention, a computer program product comprising instructions is further provided, which, when executed on a computer, enables the computer to execute any of the above-described hybrid cloud data synchronization methods.

[0042] The technical solution provided by an embodiment of the present invention determines the switch status field corresponding to the target service, wherein the target service is a service migrated from a private cloud to a public cloud for deployment, obtains the switch status field value corresponding to the switch status field, and determines whether the switch status field value meets the preset requirements. When the switch status field value meets the preset requirements, a synchronization message is triggered to synchronize the incremental data of the public cloud to the private cloud, the synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud. By determining the switch status field corresponding to the target service and obtaining the switch status field value corresponding to the switch status field, when the switch status field value meets the preset requirements, the synchronization message of the public cloud incremental data to the private cloud is triggered, the synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud. In this way, two-way synchronization of data between the private cloud and the public cloud can be achieved to ensure data consistency. If the storage middleware of the public cloud becomes unstable or even fails, the service will be switched back to the private cloud. Then, the user data written to the public cloud storage during the grayscale period can still be accessed, avoiding user data loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1Schematic diagram of an implementation process of a hybrid cloud data synchronization method shown in an embodiment of the present invention;

[0046] Figure 2 Schematic diagram of another implementation process of a hybrid cloud data synchronization method according to an embodiment of the present invention;

[0047] Figure 3 Schematic diagram of the structure of a hybrid cloud data synchronization device shown in an embodiment of the present invention;

[0048] Figure 4 It is a schematic structural diagram of another electronic device shown in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0050] In an embodiment of the present invention, it is intended to solve the above-mentioned technical problem that due to the difference between the storage middleware of the private cloud and the storage middleware of the public cloud, it is impossible to achieve two-way synchronization of data between the private cloud and the public cloud. If the storage middleware of the public cloud becomes unstable or even fails, the service will be switched back to the private cloud. Then, the user data written to the public cloud storage during the grayscale period will not be accessible, resulting in user data loss. In fact, during the grayscale period, the user data on the public cloud should also be stored on the private cloud. In this way, the data between different clouds is consistent, and when problems occur in the public cloud, it can be switched back to the private cloud at any time.

[0051] However, due to the involvement of multiple storage middleware, such as MySQL, MongoDB, Redis, and Couchbase, bidirectional synchronization cannot be achieved by relying on the storage middleware's own functions, so it can only be achieved through programs. There are two options for achieving data synchronization through programs. One is to directly perform storage dual writes on the public cloud service. This approach is simple and direct, but its disadvantages are excessive dependencies and a lengthy operation process, which increases interface time and affects interface stability. The second option is to send asynchronous messages from the public cloud service, and deploy separate consumers in the private cloud to consume the messages and write the data to the private cloud for storage. Although this approach is complex, it can achieve data dual writes without affecting normal online business, so the second option was chosen.

[0052] Based on the above invention concept, Figure 1FIG. 1 is a schematic diagram of an implementation process of a hybrid cloud data synchronization method provided by an embodiment of the present invention. The method is applied to a public cloud and may specifically include the following steps:

[0053] S101: Determine a switch status field corresponding to a target service, where the target service is a service that is migrated from a private cloud to a public cloud for deployment.

[0054] In an embodiment of the present invention, a service needs to be migrated from a private cloud to a public cloud for deployment. To control the entire process of migrating from a private cloud to a public cloud, a related switch status field is designed for the service. Different switch status field values ​​correspond to different processing.

[0055] Based on this, the switch status field corresponding to the target service is determined, where the target service is a service being deployed from a private cloud to a public cloud. For example, the switch status field corresponding to service A is determined. This switch status field is stored in the cloud platform configuration center, where service A is a service being deployed from a private cloud to a public cloud.

[0056] S102: Obtain a switch status field value corresponding to the switch status field, and determine whether the switch status field value meets a preset requirement.

[0057] In an embodiment of the present invention, the switch status field is stored in the cloud platform configuration center, and the switch status field value corresponding to the switch status field can be obtained from the cloud platform configuration center. The relationship between the switch status field and the switch status field value is similar to the key-value relationship.

[0058] It should be noted that the switch status field value is determined by the status of the target service being migrated from the private cloud to the public cloud for deployment, such as before grayscale deployment, completion of formal launch, data switching back, etc. The switch status field value is 0, and the embodiment of the present invention does not limit this.

[0059] In addition, for the switch status field value corresponding to the switch status field, it is necessary to determine whether the switch status field value meets the preset requirements, and then decide whether to trigger the synchronization message of the public cloud incremental data to the private cloud based on the judgment result.

[0060] It should be noted that, for the switch status field value corresponding to the switch status field, determining whether the switch status field value meets the preset requirements is essentially determining whether the switch status field value is a preset value, and the embodiment of the present invention does not limit this.

[0061] S103, when the switch status field value meets the preset requirements, trigger the synchronization message of the public cloud incremental data to the private cloud.

[0062] In an embodiment of the present invention, for the switch status field value, it is determined whether it meets the preset requirements, and if it meets the preset requirements, it indicates that a synchronization message is sent and a synchronization message is consumed at the same time, thereby triggering a synchronization message for synchronizing incremental data from the public cloud to the private cloud.

[0063] It should be noted that the synchronization message corresponds to the public cloud incremental data (such as user incremental data), and the public cloud incremental data needs to be calculated in real time, which is not limited in the embodiment of the present invention.

[0064] S104: Send the synchronization message to the message cluster and notify the private cloud consumer to consume the synchronization message in the message cluster, and synchronize the incremental data in the public cloud to the private cloud.

[0065] In an embodiment of the present invention, a synchronization message is sent to a message cluster, and private cloud consumers are notified to consume the synchronization message in the message cluster, so that incremental data in the public cloud can be synchronized to the private cloud. In this way, two-way synchronization of data between the private cloud and the public cloud can be achieved to ensure data consistency.

[0066] It should be noted that the consumer of synchronization messages is pre-set in the private cloud, the public cloud sends the synchronization message to the message cluster, and then the public cloud issues a notification. After the private cloud consumer receives the notification, it consumes the synchronization message in the message cluster and synchronizes the incremental data in the public cloud to the private cloud.

[0067] Through the above description of the technical solution provided by the embodiment of the present invention, by determining the switch status field corresponding to the target service and obtaining the switch status field value corresponding to the switch status field, when the switch status field value meets the preset requirements, the synchronization message of the public cloud incremental data to the private cloud is triggered, the synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.

[0068] This allows for two-way synchronization of data between the private cloud and the public cloud, ensuring data consistency. If the public cloud's storage middleware becomes unstable or even fails, the service will be switched back to the private cloud. User data written to the public cloud storage during the grayscale period can still be accessed, preventing user data loss.

[0069] like Figure 2 FIG. 1 is a schematic diagram of an implementation flow of another hybrid cloud data synchronization method provided by an embodiment of the present invention. The method is applied to a public cloud and may specifically include the following steps:

[0070] S201: Determine a switch status field corresponding to a target service, where the target service is a service that is migrated from a private cloud to a public cloud for deployment.

[0071] In the embodiment of the present invention, this step is similar to the above-mentioned step S101, and the embodiment of the present invention will not be described in detail here.

[0072] S202: Obtain a switch status field value corresponding to the switch status field, and determine whether the switch status field value is a preset first value, where the preset first value indicates that a synchronization message is not sent and a synchronization message is not consumed.

[0073] S203: When the value of the switch status field is a preset first value, obtain the status corresponding to the target service.

[0074] S204: Store the incremental data in a public cloud or a private cloud according to the status corresponding to the target service.

[0075] In an embodiment of the present invention, the switch status field is stored in the cloud platform configuration center, so that the switch status field value corresponding to the switch status field can be obtained from the cloud platform configuration center, and it is determined whether the switch status field value is a preset first value, wherein the preset first value indicates that no synchronization message is sent and no synchronization message is consumed, which means that data synchronization from the public cloud to the private cloud is not performed at this time.

[0076] When the switch status field value is the preset first value, the status corresponding to the target service is obtained, and the incremental data is stored in the public cloud or private cloud according to the status corresponding to the target service, which means that the status corresponding to the target service determines whether the incremental data is stored in the public cloud or private cloud.

[0077] For example, obtain the switch status field value corresponding to the switch status field from the cloud platform configuration center, and determine whether the switch status field value is 0. The switch status field value is equal to 0, which means that no synchronization message is sent and no synchronization message is consumed, which means that data synchronization from the public cloud to the private cloud is not performed at this time.

[0078] When the switch status field value is 0, the status corresponding to the target service is obtained. This status is the status before grayscale deployment, the official launch is completed, or the data is switched back. Therefore, according to the status corresponding to the target service, the incremental data is stored in the public cloud or private cloud. Among them, the status of the target service is the status before grayscale deployment or the data is switched back, and the incremental data needs to be stored in the private cloud. The status of the target service is the status of the official launch is completed, and the incremental data needs to be stored in the public cloud.

[0079] It should be noted that for the status corresponding to the target service, this status is the status before grayscale deployment, formal online completion or data switching back. Therefore, the switch status field value can be set to a preset first value, for example, the preset first value is 0, so that data synchronization from the public cloud to the private cloud will not be performed subsequently. The embodiment of the present invention does not limit this.

[0080] S205 , determining whether the switch status field value is a preset second value, where the preset second value indicates that a synchronization message is sent but not consumed.

[0081] S206: When the switch status field value is a preset second value, trigger a synchronization message for synchronizing the public cloud incremental data to the private cloud, and send the synchronization message to the message cluster.

[0082] In an embodiment of the present invention, for the switch status field value corresponding to the switch status field, it is also possible to determine whether the switch status field value is a preset second value. The preset second value represents sending a synchronization message and not consuming the synchronization message. When the switch status field value is the preset second value, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud, and the synchronization message is sent to the message cluster.

[0083] For example, for the switch status field value corresponding to the switch status field, determine whether the switch status field value is 1, where the switch status field value equal to 1 represents sending a synchronization message but not consuming the synchronization message. When the switch status field value is 1, the synchronization message of the public cloud incremental data to the private cloud is triggered, and the synchronization message is sent to the message cluster.

[0084] It should be noted that when the Switch Status field value is the preset second value (e.g., 1), the target service is in grayscale deployment and is also performing one-way data synchronization from the private cloud to the public cloud. Because of this one-way data synchronization from the private cloud to the public cloud, message synchronization cannot be enabled. Messages are only stored in the message cluster, otherwise data will be duplicated in the public cloud.

[0085] For example, when a user completes a check-in, the API service stores a check-in record in the public cloud. This triggers a synchronization message to synchronize incremental data from the public cloud to the private cloud, and sends the synchronization message to the message cluster. If the corresponding switch status field value is 2, the private cloud consumer consumes the synchronization message and stores a check-in record in the private cloud. If the one-way data synchronization from the private cloud to the public cloud is not disconnected, this check-in record will be synchronized to the public cloud. Consequently, two check-in records for the user will exist in the public cloud, causing data duplication.

[0086] In addition, it should be noted that for the state corresponding to the target service, this state is the state in grayscale deployment, so the switch status field value can be set to a preset second value (for example, 1), and synchronization messages can be sent subsequently but not consumed. The embodiment of the present invention does not limit this.

[0087] S207 , determining whether the switch status field value is a preset third value, where the preset third value indicates sending and consuming synchronization messages.

[0088] S208: When the switch status field value is a preset third value, trigger a synchronization message for synchronizing the public cloud incremental data to the private cloud.

[0089] S209: Send the synchronization message to the message cluster and notify the private cloud consumer to consume the synchronization message in the message cluster, and synchronize the incremental data in the public cloud to the private cloud.

[0090] In an embodiment of the present invention, for the switch status field value corresponding to the switch status field, it is also possible to determine whether the switch status field value is a preset third value. The preset third value represents the sending of synchronization messages and the consumption of synchronization messages. When the switch status field value is the preset third value, a synchronization message is triggered to synchronize the incremental data of the public cloud to the private cloud, and the synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.

[0091] For example, for the switch status field value corresponding to the switch status field, it is also possible to determine whether the switch status field value is 2. The switch status field value equal to 2 represents sending a synchronization message and consuming a synchronization message. When the switch status field value is 2, the synchronization message of the public cloud incremental data to the private cloud is triggered, and the synchronization message is sent to the message cluster. The private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.

[0092] It should be noted that for the status corresponding to the target service, this status is the status of grayscale deployment completion, so the switch status field value can be set to a preset third value, for example, the preset third value is 2, so that synchronization messages will be sent and consumed subsequently. The embodiment of the present invention does not limit this.

[0093] In addition, in an embodiment of the present invention, during the period of sending and consuming synchronization messages, it is necessary to ensure that the one-way data synchronization from the private cloud to the public cloud has been interrupted. Therefore, when the value of the switch status field is a preset third value, it is detected whether the one-way data synchronization from the private cloud to the public cloud has been interrupted. If the one-way data synchronization from the private cloud to the public cloud has been interrupted, a synchronization message for synchronizing incremental data from the public cloud to the private cloud is triggered. If the one-way data synchronization from the private cloud to the public cloud has not been interrupted, the one-way data synchronization from the private cloud to the public cloud is interrupted, and a synchronization message for synchronizing incremental data from the public cloud to the private cloud is triggered.

[0094] For example, when the switch status field value is 2, it detects whether the one-way data synchronization from the private cloud to the public cloud has been interrupted. If the one-way data synchronization from the private cloud to the public cloud has been interrupted, it triggers the synchronization message of the public cloud incremental data to the private cloud, sends the synchronization message to the message cluster, and notifies the private cloud consumer to consume the synchronization message in the message cluster, and synchronizes the incremental data in the public cloud to the private cloud.

[0095] When the one-way data synchronization from the private cloud to the public cloud is not interrupted, the DBA interrupts the one-way data synchronization from the private cloud to the public cloud, and then triggers the synchronization message for synchronizing the incremental data of the public cloud to the private cloud, sends the synchronization message to the message cluster, and notifies the private cloud consumer to consume the synchronization message in the message cluster, and synchronizes the incremental data in the public cloud to the private cloud.

[0096] In addition, synchronization messages have corresponding triggering times. When consuming synchronization messages, private cloud consumers can follow these triggering times, perhaps on a priority-first-consumption basis. Therefore, in this embodiment of the present invention, the public cloud can notify private cloud consumers to consume synchronization messages in the message cluster according to the synchronization message triggering times, synchronizing incremental data from the public cloud to the private cloud.

[0097] It should be noted that for the above steps S202 to S204, S205 to S206, and S207 to S209, that is, the processing steps for determining whether the switch status field value is the preset first value, the preset second value, or the preset third value, the execution order may be, for example, first executing S202 to S204, then executing S205 to S206, and finally executing S207 to S209. The embodiment of the present invention does not limit this.

[0098] Through the above description of the technical solution provided by the embodiment of the present invention, by determining the switch status field corresponding to the target service and obtaining the switch status field value corresponding to the switch status field, when the switch status field value is a preset first value, data synchronization from the public cloud to the private cloud is not performed, and when the switch status field value is a preset second value, data synchronization from the public cloud to the private cloud is performed, and synchronization messages are sent but not consumed. When the switch status field value is a preset third value, data synchronization from the public cloud to the private cloud is performed, and synchronization messages are sent and consumed. In this way, the entire process of migrating from the private cloud to the public cloud for deployment is controlled according to the switch status field value, and when the switch status field value is the preset second value, two-way synchronization of data between the private cloud and the public cloud can be achieved to ensure data consistency. If the storage middleware of the public cloud becomes unstable or even fails, the service is switched back to the private cloud, and the user data written to the public cloud storage during the grayscale period can still be accessed, avoiding user data loss.

[0099] Corresponding to the above method embodiment, the embodiment of the present invention also provides a hybrid cloud data synchronization device, such as Figure 3 As shown, the device may include: a field determination module 310, a field value acquisition module 320, a field value judgment module 330, a message triggering module 340, a message sending module 350, and a data synchronization module 360.

[0100] A field determination module 310 is configured to determine a switch status field corresponding to a target service, wherein the target service is a service that is being migrated from a private cloud to a public cloud for deployment;

[0101] A field value acquisition module 320 is configured to acquire a switch status field value corresponding to the switch status field;

[0102] A field value determination module 330 is configured to determine whether the switch status field value meets a preset requirement;

[0103] A message triggering module 340 is configured to trigger a synchronization message for synchronizing incremental data from the public cloud to the private cloud when the switch status field value meets a preset requirement;

[0104] A message sending module 350 is configured to send the synchronization message to a message cluster;

[0105] The data synchronization module 360 ​​is used to notify the private cloud consumer to consume the synchronization message in the message cluster and synchronize the incremental data in the public cloud to the private cloud.

[0106] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42, and the memory 43 communicate with each other through the communication bus 44.

[0107] Memory 43, for storing computer programs;

[0108] The processor 41 is configured to execute the program stored in the memory 43 by performing the following steps:

[0109] Determine the switch status field corresponding to the target service, wherein the target service is a service that is migrated from a private cloud to a public cloud for deployment; obtain the switch status field value corresponding to the switch status field, and determine whether the switch status field value meets the preset requirements; if the switch status field value meets the preset requirements, trigger a synchronization message for synchronizing incremental data from the public cloud to the private cloud; send the synchronization message to a message cluster, and notify private cloud consumers to consume the synchronization message in the message cluster, and synchronize the incremental data in the public cloud to the private cloud.

[0110] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0111] The communication interface is used for communication between the above electronic device and other devices.

[0112] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0113] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0114] In another embodiment of the present invention, a storage medium is provided. The storage medium stores instructions that, when executed on a computer, enable the computer to execute the hybrid cloud data synchronization method described in any one of the above embodiments.

[0115] In another embodiment provided by the present invention, a computer program product including instructions is further provided, which, when executed on a computer, enables the computer to execute the hybrid cloud data synchronization method described in any one of the above embodiments.

[0116] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. 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 processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0117] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0118] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A hybrid cloud data synchronization method, characterized in that: Applied to a public cloud, the method includes: Determine a switch status field corresponding to a target service, wherein the target service is a service that is being migrated from a private cloud to a public cloud for deployment; Obtaining a switch status field value corresponding to the switch status field, and determining whether the switch status field value meets a preset requirement; the switch status field value is determined by the state of the target service being migrated from the private cloud to the public cloud for deployment; When the switch status field value meets the preset requirements, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud; the switch status field value indicates that the status corresponding to the target service is the state of grayscale deployment completion; The synchronization message is sent to the message cluster, and the private cloud consumer is notified to consume the synchronization message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.

2. The method according to claim 1, characterized in that The determining whether the switch status field value meets a preset requirement includes: Determine whether the switch status field value is a preset third value, where the preset third value indicates sending a synchronization message and consuming a synchronization message; The triggering of the synchronization message of synchronizing the public cloud incremental data to the private cloud when the switch status field value meets the preset requirements includes: When the switch status field value is a preset third value, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud.

3. The method according to claim 2, characterized in that The triggering of the synchronization message of synchronizing the public cloud incremental data to the private cloud when the switch status field value is a preset third value includes: When the switch status field value is a preset third value, detecting whether the unidirectional data synchronization from the private cloud to the public cloud has been interrupted; When the one-way data synchronization from the private cloud to the public cloud is interrupted, a synchronization message is triggered to synchronize the incremental data from the public cloud to the private cloud; When the one-way data synchronization from the private cloud to the public cloud is not interrupted, the one-way data synchronization from the private cloud to the public cloud is interrupted, and a synchronization message is triggered to synchronize the incremental data of the public cloud to the private cloud.

4. The method according to claim 1, wherein After obtaining the switch status field value corresponding to the switch status field, the method further includes: Determine whether the switch status field value is a preset first value, where the preset first value indicates that a synchronization message is not sent and a synchronization message is not consumed; When the switch status field value is a preset first value, the state corresponding to the target service is obtained; the switch status field value indicates that the state corresponding to the target service is before grayscale deployment, when the official launch is completed, or when data is switched back; According to the status corresponding to the target service, the incremental data is stored in a public cloud or a private cloud.

5. The method according to claim 1, characterized in that After obtaining the switch status field value corresponding to the switch status field, the method further includes: Determine whether the switch status field value is a preset second value, where the preset second value indicates that a synchronization message is sent and no synchronization message is consumed; When the switch status field value is a preset second value, a synchronization message is triggered to synchronize the public cloud incremental data to the private cloud, and the synchronization message is sent to the message cluster. The switch status field value indicates that the status corresponding to the target service is in grayscale deployment.

6. The method according to claim 5, characterized in that The method further comprises: When the switch status field value is a preset second value, one-way data synchronization from the private cloud to the public cloud is performed.

7. The method according to claim 1, characterized in that The notifying the private cloud consumer to consume the synchronization message in the message cluster and synchronizing the incremental data in the public cloud to the private cloud includes: Notify the private cloud consumer to consume the synchronization message in the message cluster according to the triggering time of the synchronization message, and synchronize the incremental data in the public cloud to the private cloud.

8. A hybrid cloud data synchronization device, characterized in that: The device comprises: A field determination module, configured to determine a switch status field corresponding to a target service, wherein the target service is a service that is being migrated from a private cloud to a public cloud for deployment; A field value acquisition module, configured to acquire a switch status field value corresponding to the switch status field; the switch status field value is determined by the state of the target service being deployed on the public cloud after being migrated from the private cloud; A field value judgment module is used to judge whether the switch status field value meets the preset requirements; A message trigger module is used to trigger a synchronization message for synchronizing incremental data from the public cloud to the private cloud when the switch status field value meets the preset requirements; the switch status field value indicates that the status corresponding to the target service is the state of grayscale deployment completion; A message sending module, configured to send the synchronization message to a message cluster; The data synchronization module is used to notify the private cloud consumer to consume the synchronization message in the message cluster and synchronize the incremental data in the public cloud to the private cloud.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Cross-regional disaster recovery method and device

    CN108512693A

  • System for constructing TELEVISION station-integrated media cloud platform

    CN109218565A