[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN116233155A - Hybrid cloud data synchronization method and device, electronic equipment and storage medium - Google Patents

Hybrid cloud data synchronization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116233155A
CN116233155A CN202310279490.2A CN202310279490A CN116233155A CN 116233155 A CN116233155 A CN 116233155A CN 202310279490 A CN202310279490 A CN 202310279490A CN 116233155 A CN116233155 A CN 116233155A
Authority
CN
China
Prior art keywords
cloud
switch state
message
state field
private cloud
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.)
Pending
Application number
CN202310279490.2A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202310279490.2A priority Critical patent/CN116233155A/en
Publication of CN116233155A publication Critical patent/CN116233155A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a hybrid cloud data synchronization method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a switch state field corresponding to a target service, wherein the target service is a service which is transferred from a private cloud to a public cloud for deployment; acquiring a switch state field value corresponding to the switch state field, and judging whether the switch state field value meets a preset requirement; triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets the preset requirement; and sending the synchronous message to the message cluster, notifying the private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud. Therefore, bidirectional synchronization of data between the private cloud and the public cloud can be realized, the consistency of the data is ensured, the public cloud can be switched back to the private cloud at any time when the public cloud is out of question, user data written into the public cloud during gray scale can still be accessed, and user data loss is avoided.

Description

Hybrid cloud data synchronization method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a hybrid cloud data synchronization method, a device, an electronic device, and a storage medium.
Background
Currently, for a certain service, migration from a private cloud to a public cloud is required for deployment. The API-related code is already deployed in the public cloud, but the storage middleware is deployed in the private cloud, so that the storage middleware on the private cloud needs to be called across networks for data operation.
In order to avoid cross-network call of the storage middleware in the service, the storage middleware of the public cloud is applied during the gray scale period of the service deployment from the private cloud to the public cloud, and the private cloud mixed cloud data is synchronized to the public cloud through the storage middleware of the public cloud.
Because the storage middleware of the private cloud is different from the storage middleware of the public cloud, the bidirectional synchronization of data between the private cloud and the public cloud cannot be realized. If the public cloud storage middleware is unstable or even fails, the service is switched back to the private cloud, so that the user data stored in the public cloud during the gray scale period cannot be accessed, and the user data is lost.
Disclosure of Invention
In order to solve the problem that the storage middleware of the private cloud is different from the storage middleware of the public cloud, the bidirectional synchronization of data between the private cloud and the public cloud cannot be realized. If unstable conditions or even faults occur in the public cloud storage middleware, services are switched back to private cloud, and then user data written into the public cloud storage during gray scale cannot be accessed, so that the technical problem of user data loss is caused. The specific technical scheme is as follows:
in a first aspect of the embodiment of the present invention, there is provided a hybrid cloud data synchronization method, applied to public cloud, the method including:
determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment;
acquiring a switch state field value corresponding to the switch state field, and judging whether the switch state field value meets a preset requirement or not;
triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets the preset requirement;
and sending the synchronous message to a message cluster, notifying a private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud.
In an optional embodiment, the determining whether the switch status field value meets a preset requirement includes:
judging whether the switch state field value is a preset third value, wherein the preset third value represents sending and consuming synchronous messages;
triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets a preset requirement, wherein the synchronization message comprises the following steps:
and triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset third value.
In an optional embodiment, the triggering the synchronization message for synchronizing the public cloud incremental data to the private cloud when the switch status field value is a preset third value includes:
detecting whether unidirectional data synchronization from private cloud to public cloud is interrupted or not under the condition that the switch state field value is a preset third value;
triggering a synchronization message of synchronizing public cloud incremental data to the private cloud under the condition that unidirectional data synchronization from the private cloud to the public cloud is interrupted;
under the condition that the unidirectional data synchronization from the private cloud to the public cloud is not interrupted, the unidirectional data synchronization from the private cloud to the public cloud is interrupted, and a synchronization message of the public cloud incremental data synchronization to the private cloud is triggered.
In an optional embodiment, after the obtaining the switch state field value corresponding to the switch state field, the method further includes:
judging whether the switch state field value is a preset first value or not, wherein the preset first value represents that the synchronous message is not sent and is not consumed;
acquiring a state corresponding to the target service under the condition that the switch state field value is a preset first value;
and storing the incremental data to public cloud or private cloud according to the state corresponding to the target service.
In an optional embodiment, after the obtaining the switch state field value corresponding to the switch state field, the method further includes:
judging whether the switch state field value is a preset second value, wherein the preset second value represents that the synchronous message is sent and is not consumed;
and triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset second value, and sending the synchronization message to a message cluster.
In an alternative embodiment, the method further comprises:
and under the condition that the switch state field value is a preset second value, executing unidirectional data synchronization from private cloud to public cloud.
In an optional embodiment, 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:
and notifying a private cloud consumer to consume the synchronous message in the message cluster according to the triggering time of the synchronous message, and synchronizing the incremental data in the public cloud to the private cloud.
In a second aspect of the embodiment of the present invention, there is also provided a hybrid cloud data synchronization device, including:
the field determining module is used for determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment;
the field value acquisition module is used for acquiring a switch state field value corresponding to the switch state field;
the field value judging module is used for judging whether the switch state field value meets a preset requirement;
the message triggering module is used for triggering the synchronization message of the public cloud incremental data to the private cloud under the condition that the switch state field value meets the preset requirement;
the message sending module is used for sending the synchronous message to a message cluster;
and the data synchronization module is used for notifying a 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 a third aspect of the embodiment of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the hybrid cloud data synchronization method according to any one of the first aspect when executing the program stored on the memory.
In a fourth aspect of the embodiments of the present invention, there is further provided a storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the hybrid cloud data synchronization method according to any one of the first aspects described above.
In a fifth aspect of embodiments of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the above-described hybrid cloud data synchronization methods.
According to the technical scheme provided by the embodiment of the invention, the switch state field corresponding to the target service is determined, wherein the target service is a service which is transferred from the private cloud to the public cloud for deployment, the switch state field value corresponding to the switch state field is obtained, whether the switch state field value meets the preset requirement is judged, under the condition that the switch state field value meets the preset requirement, the synchronization message of the public cloud incremental data to the private cloud is triggered, the synchronization message is sent to the message cluster, the private cloud consumer is informed of consuming the synchronization message in the message cluster, and the public cloud incremental data is synchronized to the private cloud. The method comprises the steps of determining a switch state field corresponding to a target service, obtaining a switch state field value corresponding to the switch state field, triggering a synchronous message of public cloud incremental data to a private cloud under the condition that the switch state field value meets a preset requirement, sending the synchronous message to a message cluster, informing a private cloud consumer to consume the synchronous message in the message cluster, synchronizing the incremental data in the public cloud to the private cloud, and thus, realizing bidirectional synchronization of data between the private cloud and the public cloud, ensuring data consistency, and if unstable or even failure occurs in a storage middleware of the public cloud, switching the service back to the private cloud, user data written in the public cloud for storage in a gray scale period can still be accessed, and avoiding user data loss.
Drawings
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.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of an implementation of a hybrid cloud data synchronization method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an implementation of another hybrid cloud data synchronization method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a hybrid cloud data synchronization device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the embodiment of the invention, the technical problem that user data is lost because user data written into public cloud storage cannot be accessed during gray scale is solved if the public cloud storage middleware is unstable or even fails and services are switched back to the private cloud, and the user data on the public cloud is stored into the private cloud during gray scale.
However, since a plurality of storage middleware, for example MySQL, mongoDB, redis, couchbase, are involved, bidirectional synchronization cannot be achieved depending on the own functions of the storage middleware, and therefore, the bidirectional synchronization can be achieved only by a program. Two schemes exist for realizing data synchronization through programs, and the method is simple and direct in storage double-writing in public cloud service, and has the defects of too much dependence and too long operation flow, so that interface time consumption is increased, and interface stability is also influenced. The second scheme is that asynchronous messages are sent out by public cloud service, and individual consumers are deployed by private cloud, so that the messages are consumed, and data are written into the private cloud for storage. The method is complex, but can realize double writing of data without affecting normal on-line service, so that the second scheme is selected.
Based on the above-mentioned inventive concept, as shown in fig. 1, a schematic implementation flow diagram of a hybrid cloud data synchronization method provided by an embodiment of the present invention is applied to public clouds, and the method specifically may include the following steps:
s101, determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment.
In the embodiment of the invention, for a certain service, the service needs to be migrated from a private cloud to a public cloud for deployment. In order to control the whole process of transferring from private cloud to public cloud for deployment, for service, relevant switch state fields are designed, corresponding switch state field values are different, and corresponding processes are different.
Based on the switch state field, the switch state field corresponding to the target service is determined, wherein the target service is a service which is migrated from the private cloud to the public cloud for deployment. For example, a switch state field corresponding to the service a is determined, and the switch state field is stored in a cloud platform configuration center, wherein the service a is a service that is deployed by migrating from a private cloud to a public cloud.
S102, acquiring a switch state field value corresponding to the switch state field, and judging whether the switch state field value meets the preset requirement.
In the embodiment of the invention, the switch state field is stored in the cloud platform configuration center, so that the switch state field value corresponding to the switch state field can be obtained from the cloud platform configuration center. Wherein the relationship of the switch state field to the switch state field Value is similar to the relationship of Key-Value.
It should be noted that, for the switch state field value, the switch state field value is 0, which is determined by the state that the target service is migrated from the private cloud to the public cloud for deployment, for example, the state before gray scale deployment, the formally online completion, the data back cut, etc., which is not limited in the embodiment of the present invention.
In addition, for the switch state field value corresponding to the switch state field, whether the switch state field value meets the preset requirement needs to be judged, so that whether the synchronization message of the public cloud incremental data to the private cloud is triggered is determined according to the judging result.
It should be noted that, for the switch state field value corresponding to the switch state field, whether the switch state field value meets the preset requirement is determined, which is essentially whether the switch state field value is a certain preset value, which is not limited in the embodiment of the present invention.
And S103, triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value meets the preset requirement.
In the embodiment of the invention, for the switch state field value, whether the switch state field value meets the preset requirement is judged, and the synchronous message is sent and consumed at the same time under the condition that the switch state field value meets the preset requirement, so that the synchronous message of the public cloud incremental data to the private cloud can be triggered.
It should be noted that, for the synchronization message, the public cloud incremental data (for example, user incremental data) is corresponding to the public cloud incremental data, and the public cloud incremental data needs to be calculated in real time, which is not limited by the embodiment of the present invention.
S104, sending the synchronous message to the message cluster, notifying the private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud.
In the embodiment of the invention, the synchronous message is sent to the message cluster, and the private cloud consumer is informed to consume the synchronous message in the message cluster, so that the incremental data in the public cloud can be synchronized to the private cloud, the bidirectional synchronization of the data between the private cloud and the public cloud can be realized, and the consistency of the data is ensured.
It should be noted that, when the private cloud sets up the consumer of the synchronization message in advance, the public cloud sends the synchronization message to the message cluster, and then the public cloud sends a notification, after the private cloud consumer receives the notification, the private cloud consumes the synchronization message in the message cluster, and synchronizes the incremental data in the public cloud to the private cloud.
Through the description of the technical scheme provided by the embodiment of the invention, the switch state field corresponding to the target service is determined, the switch state field value corresponding to the switch state field is obtained, and under the condition that the switch state field value meets the preset requirement, 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 informed to consume the synchronization message in the message cluster, so that the public cloud incremental data is synchronized to the private cloud.
Therefore, bidirectional synchronization of data between the private cloud and the public cloud can be realized, consistency of the data is guaranteed, if unstable conditions or even faults occur in the storage middleware of the public cloud, services are switched back to the private cloud, user data written into the public cloud storage during gray scale can still be accessed, and user data loss is avoided.
As shown in fig. 2, a schematic implementation flow chart of another hybrid cloud data synchronization method provided by the embodiment of the present invention is applied to public clouds, and may specifically include the following steps:
s201, determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment.
In the embodiment of the present invention, the step is similar to the step S101, and the embodiment of the present invention is not described here again.
S202, a switch state field value corresponding to the switch state field is obtained, whether the switch state field value is a preset first value is judged, and the preset first value represents that the synchronous message is not sent and is not consumed.
S203, acquiring a state corresponding to the target service under the condition that the switch state field value is a preset first value.
S204, according to the state corresponding to the target service, the incremental data are stored to the public cloud or the private cloud.
In the embodiment of the invention, for the switch state field, the switch state field is stored in the cloud platform configuration center, so that the switch state field value corresponding to the switch state field can be obtained from the cloud platform configuration center, and whether the switch state field value is a preset first value is judged, wherein the preset first value characterizes that the synchronization message is not sent and is not consumed, which means that the public cloud to private cloud data synchronization is not performed at the moment.
Under the condition that the switch state field value is a preset first value, acquiring a state corresponding to the target service, and storing the incremental data to the public cloud or the private cloud according to the state corresponding to the target service, wherein the state corresponding to the target service determines to store the incremental data to the public cloud or the private cloud.
For example, a switch state field value corresponding to the switch state field is obtained from the cloud platform configuration center, and whether the switch state field value is 0 is determined, wherein the switch state field value is equal to 0, which means that no synchronization message is sent and no synchronization message is consumed, meaning that no public cloud to private cloud data synchronization is performed at this time.
And under the condition that the switch state field value is 0, acquiring a state corresponding to the target service, wherein the state is a state before gray level deployment, when formally online completion or data back-cut, and accordingly storing the incremental data to the public cloud or the private cloud according to the state corresponding to the target service, wherein the state of the target service is a state before gray level deployment or when data back-cut, the incremental data is required to be stored to the private cloud, and the state of the target service is a state after formally online completion, and the incremental data is required to be stored to the public cloud.
It should be noted that, for the state corresponding to the target service, the state is a state before gray level deployment, when the formally online is completed or the data is switched back, so that the switch state field value can be set to a preset first value, for example, the preset first value is set to 0, so that the data synchronization from public cloud to private cloud is not performed afterwards.
S205, judging whether the switch state field value is a preset second value, wherein the preset second value represents that the synchronous message is sent and the synchronous message is not consumed.
S206, triggering the synchronization message of the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset second value, and sending the synchronization message to the message cluster.
In the embodiment of the invention, for the switch state field value corresponding to the switch state field, whether the switch state field value is a preset second value can be judged, the preset second value represents that the synchronous message is sent and the synchronous message is not consumed, and under the condition that the switch state field value is the preset second value, the synchronous message of the public cloud incremental data to the private cloud is triggered and the synchronous message is sent to the message cluster.
For example, for a switch state field value corresponding to the switch state field, determining whether the switch state field value is 1, where a switch state field value equal to 1 represents sending a synchronization message but not consuming the synchronization message, triggering synchronization of public cloud incremental data to a synchronization message of a private cloud and sending the synchronization message to a message cluster under the condition that the switch state field value is 1.
In addition, when the switch status field value is a preset second value (for example, 1), the status of the target service is in the state of gray scale deployment, and unidirectional data synchronization from the private cloud to the public cloud is performed. Because the private cloud is stored to the public cloud to store the unidirectional data synchronization at the moment, the message synchronization message cannot be started, and the message synchronization message is stored only in the message cluster, otherwise, the public cloud data is repeatedly written.
For example, the user completes the check-in action, the API service stores a check-in record to the public cloud, then triggers the public cloud delta data to synchronize to the synchronization message of the private cloud, and sends the synchronization message to the message cluster. If the value of the switch state field corresponding to the switch state field is 2, the private cloud consumer can consume the synchronous message and store a check-in record to the private cloud, and if the unidirectional data stored by the private cloud to the public cloud is not synchronous, the check-in record can be synchronized to the public cloud, two check-in records of the user can exist in the public cloud, and data is rewritten.
In addition, it should be noted that, for the state corresponding to the target service, the state is a state in gray scale deployment, so that the switch state field value may be set to a preset second value (for example, 1), and the synchronization message may be sent later but not consumed.
S207, judging whether the switch state field value is a preset third value, wherein the preset third value represents sending and consuming the synchronous message.
And S208, triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset third value.
S209, sending the synchronous message to the message cluster, notifying the private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud.
In the embodiment of the invention, for the switch state field value corresponding to the switch state field, whether the switch state field value is a preset third value can be judged, the preset third value represents that the synchronous message is sent and the synchronous message is consumed, and under the condition that the switch state field value is the preset third value, the synchronous message of the public cloud incremental data to the private cloud is triggered, the synchronous message is sent to the message cluster, and the private cloud consumer is informed of consuming the synchronous message in the message cluster, and the incremental data in the public cloud is synchronized to the private cloud.
For example, for the switch state field value corresponding to the switch state field, it may also be determined whether the switch state field value is 2, where the switch state field value is equal to 2, and represents that a synchronization message is sent and a synchronization message is consumed, and when the switch state field value is 2, a synchronization message for synchronizing public cloud incremental data to a private cloud is triggered, the synchronization message is sent to a message cluster, and a private cloud consumer is notified to consume the synchronization message in the message cluster, and incremental data in the public cloud is synchronized to the private cloud.
It should be noted that, for the state corresponding to the target service, the state is a state in which the gray deployment is completed, and thus the switch state field value may be set to a preset third value, for example, the preset third value is 2, so that the synchronization message may be sent and consumed later.
Furthermore, in the embodiment of the present invention, during the period of sending and consuming the synchronization message, it is necessary to ensure that unidirectional data synchronization from the private cloud to the public cloud has been interrupted. And when the one-way data synchronization from the private cloud to the public cloud is not interrupted, interrupting the one-way data synchronization from the private cloud to the public cloud and triggering the synchronization message of the public cloud incremental data synchronization to the private cloud.
For example, if the switch state field value is 2, detecting whether unidirectional data synchronization from the private cloud to the public cloud is interrupted, if unidirectional data synchronization from the private cloud to the public cloud is interrupted, triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud, sending the synchronization message to the message cluster, notifying a private cloud consumer to consume the synchronization message in the message cluster, and synchronizing the public cloud incremental data to the private cloud.
Under the condition that unidirectional data synchronization from private cloud to public cloud is not interrupted, interrupting unidirectional data synchronization from private cloud to public cloud by DBA, triggering synchronous message of public cloud incremental data synchronization to private cloud, sending synchronous message to message cluster, notifying private cloud consumer to consume synchronous message in message cluster, and synchronizing incremental data in public cloud to private cloud.
In addition, for the synchronous message, there is a corresponding trigger time, so that the private cloud consumer can follow the trigger time of the synchronous message in the process of consuming the synchronous message, and the following principle can be priority triggering and priority consumption. Therefore, in the embodiment of the invention, the public cloud can inform the private cloud consumer to consume the synchronous message in the message cluster according to the triggering time of the synchronous message, and synchronize the increment data in the public cloud to the private cloud.
It should be noted that, for the steps S202 to S204, S205 to S206, and S207 to S209, that is, the processing steps of whether the switch status field value is the preset first value, the preset second value, or the preset third value, the execution sequence may be, for example, executing S202 to S204, then executing S205 to S206, and finally executing S207 to S209.
Through the description of the technical scheme provided by the embodiment of the invention, through determining the switch state field corresponding to the target service and acquiring the switch state field value corresponding to the switch state field, under the condition that the switch state field value is a preset first value, data synchronization from public cloud to private cloud is not performed, under the condition that the switch state field value is a preset second value, data synchronization from public cloud to private cloud is performed, a synchronization message is sent but the synchronization message is not consumed, under the condition that the switch state field value is a preset third value, data synchronization from public cloud to private cloud is performed, a synchronization message is sent and the synchronization message is consumed, so that the whole process of transferring from private cloud to public cloud to perform deployment is controlled according to the switch state field value, under the condition that the switch state field value is a preset second value, bidirectional synchronization of data between private cloud and public cloud can be realized, consistency of the data is ensured, if the storage middleware of the public cloud is unstable or even fails, user data stored by switching the service back to the public cloud can still be prevented from being accessed by the user data during gray scale.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a hybrid cloud data synchronization device, as shown in fig. 3, where the device may include: a field determining module 310, a field value obtaining module 320, a field value judging module 330, a message triggering module 340, a message sending module 350 and a data synchronizing module 360.
A field determining module 310, configured to 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;
a field value obtaining module 320, configured to obtain a switch state field value corresponding to the switch state field;
a field value judging module 330, configured to judge whether the switch status field value meets a preset requirement;
the message triggering module 340 is configured to trigger a synchronization message for synchronizing the public cloud incremental data to the private cloud when the switch status field value meets a preset requirement;
a message sending module 350, configured to send the synchronization message to a message cluster;
the data synchronization module 360 is configured to notify a private cloud consumer to consume the synchronization message in the message cluster, and synchronize incremental data in the public cloud to the private cloud.
The embodiment of the invention also provides an electronic device, as shown in fig. 4, which comprises 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 complete communication with each other through the communication bus 44,
a memory 43 for storing a computer program;
the processor 41 is configured to execute the program stored in the memory 43, and implement the following steps:
determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment; acquiring a switch state field value corresponding to the switch state field, and judging whether the switch state field value meets a preset requirement or not; triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets the preset requirement; and sending the synchronous message to a message cluster, notifying a private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a storage medium is further provided, where instructions are stored that, when executed on a computer, cause the computer to perform the hybrid cloud data synchronization method according to any of the above embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions that, when run on a computer, cause the computer to perform the hybrid cloud data synchronization method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage media may be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. 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 apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A hybrid cloud data synchronization method, characterized by being applied to public clouds, the method comprising:
determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment;
acquiring a switch state field value corresponding to the switch state field, and judging whether the switch state field value meets a preset requirement or not;
triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets the preset requirement;
and sending the synchronous message to a message cluster, notifying a private cloud consumer to consume the synchronous message in the message cluster, and synchronizing the incremental data in the public cloud to the private cloud.
2. The method of claim 1, wherein said determining whether the switch status field value meets a preset requirement comprises:
judging whether the switch state field value is a preset third value, wherein the preset third value represents sending and consuming synchronous messages;
triggering a synchronization message for synchronizing public cloud incremental data to private cloud under the condition that the switch state field value meets a preset requirement, wherein the synchronization message comprises the following steps:
and triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset third value.
3. The method according to claim 2, wherein the triggering the synchronization message for synchronizing the public cloud incremental data to the private cloud if the switch status field value is a preset third value includes:
detecting whether unidirectional data synchronization from private cloud to public cloud is interrupted or not under the condition that the switch state field value is a preset third value;
triggering a synchronization message of synchronizing public cloud incremental data to the private cloud under the condition that unidirectional data synchronization from the private cloud to the public cloud is interrupted;
under the condition that the unidirectional data synchronization from the private cloud to the public cloud is not interrupted, the unidirectional data synchronization from the private cloud to the public cloud is interrupted, and a synchronization message of the public cloud incremental data synchronization to the private cloud is triggered.
4. The method of claim 1, wherein after the obtaining the switch state field value corresponding to the switch state field, the method further comprises:
judging whether the switch state field value is a preset first value or not, wherein the preset first value represents that the synchronous message is not sent and is not consumed;
acquiring a state corresponding to the target service under the condition that the switch state field value is a preset first value;
and storing the incremental data to public cloud or private cloud according to the state corresponding to the target service.
5. The method of claim 1, wherein after the obtaining the switch state field value corresponding to the switch state field, the method further comprises:
judging whether the switch state field value is a preset second value, wherein the preset second value represents that the synchronous message is sent and is not consumed;
and triggering a synchronization message for synchronizing the public cloud incremental data to the private cloud under the condition that the switch state field value is a preset second value, and sending the synchronization message to a message cluster.
6. The method of claim 5, wherein the method further comprises:
and under the condition that the switch state field value is a preset second value, executing unidirectional data synchronization from private cloud to public cloud.
7. The method of claim 1, wherein the notifying the private cloud consumer to consume the synchronization message in the message cluster to synchronize delta data in the public cloud to the private cloud comprises:
and notifying a private cloud consumer to consume the synchronous message in the message cluster according to the triggering time of the synchronous message, and synchronizing the incremental data in the public cloud to the private cloud.
8. A hybrid cloud data synchronization device, the device comprising:
the field determining module is used for determining a switch state field corresponding to a target service, wherein the target service is a service which is migrated from a private cloud to a public cloud for deployment;
the field value acquisition module is used for acquiring a switch state field value corresponding to the switch state field;
the field value judging module is used for judging whether the switch state field value meets a preset requirement;
the message triggering module is used for triggering the synchronization message of the public cloud incremental data to the private cloud under the condition that the switch state field value meets the preset requirement;
the message sending module is used for sending the synchronous message to a message cluster;
and the data synchronization module is used for notifying a 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.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1-7 when executing a program stored on a memory.
10. A storage medium having stored thereon a computer program, which when executed by a processor performs the method of any of claims 1-7.
CN202310279490.2A 2023-03-21 2023-03-21 Hybrid cloud data synchronization method and device, electronic equipment and storage medium Pending CN116233155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310279490.2A CN116233155A (en) 2023-03-21 2023-03-21 Hybrid cloud data synchronization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310279490.2A CN116233155A (en) 2023-03-21 2023-03-21 Hybrid cloud data synchronization method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116233155A true CN116233155A (en) 2023-06-06

Family

ID=86573068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310279490.2A Pending CN116233155A (en) 2023-03-21 2023-03-21 Hybrid cloud data synchronization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116233155A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024169432A1 (en) * 2023-12-14 2024-08-22 天翼云科技有限公司 Resource status data synchronization method for hybrid cloud management platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024169432A1 (en) * 2023-12-14 2024-08-22 天翼云科技有限公司 Resource status data synchronization method for hybrid cloud management platform

Similar Documents

Publication Publication Date Title
CN107526659B (en) Method and apparatus for failover
US11907561B2 (en) Data backup method and apparatus
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN106909411B (en) File updating method and device
CN109788068B (en) Heartbeat state information reporting method, device and equipment and computer storage medium
CN109788027B (en) Data synchronization method, device, server and computer storage medium
CN111049928B (en) Data synchronization method, system, electronic device and computer readable storage medium
CN109450701B (en) Virtual switch switching method and device, host machine and computer readable storage medium
CN104239156A (en) External service call method and system
CN110659262A (en) Master-slave switching method and device for redis node
WO2023165307A1 (en) Function calling method and apparatus
CN116233155A (en) Hybrid cloud data synchronization method and device, electronic equipment and storage medium
CN108108126B (en) Data processing method, device and equipment
CN110113187B (en) Configuration updating method and device, configuration server and configuration system
CN111200651A (en) Method, system, device and medium for timed calling of microservice
CN112948098B (en) Service unit offline method based on micro-service unit architecture and related device
CN114640709A (en) Edge node processing method, device and medium
CN112363980B (en) Data processing method and device of distributed system
CN110737543B (en) Method, device and storage medium for recovering distributed file system data
CN111200833B (en) Method and device for determining network element state
CN113656215B (en) Automatic disaster recovery method, system, medium and equipment based on centralized configuration
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN110908792B (en) Data processing method and device
CN110795211A (en) Method and device for upgrading configuration of virtual machine, electronic equipment and readable storage medium
CN114297033B (en) Application resource restoration method and device, electronic equipment and storage medium

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