Multi-scene compatible mirror synchronization method and device, equipment and medium
By monitoring image synchronization events at the central endpoint, obtaining network reachability status, and determining operation instructions, the problem of image data synchronization between different resource pools is solved, and efficient image data transmission is achieved in a multi-cloud environment.
Patent Information
- Application Number
- CN202311696876.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-12-11
AI Technical Summary
In multi-cloud or hybrid cloud environments, existing technical solutions are limited in their ability to achieve mirrored data synchronization between different resource pools, especially when networks are not interconnected.
By monitoring image synchronization events at the central end, the current network reachability status of the image source and image synchronization ends is obtained. Based on the preset image synchronization operation table, the corresponding operation instructions are determined and the image data synchronization operation is executed, including the data transmission paths of the storage end, the proxy server end, and the central end, so as to realize the synchronization of image data.
It enables image data synchronization between different image resource pools, improves the applicability and reliability of the synchronization method, and adapts to image synchronization needs in various scenarios.
Smart Images

Figure CN117857578B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a mirror image synchronization method and device compatible with multiple scenarios, equipment and medium. BACKGROUND
[0002] In today's era of software application architecture evolving into cloud-native architecture, containers and images have become an indispensable part of IT operation and development. A container image contains a packaged application and its dependencies, as well as process information running at startup, including all dependencies required by the application program.
[0003] Each application can be packaged into an image, and each version of an application can also be packaged into an image. Even each image needs another image as a base image. So many images need an image repository to store and manage them. The simplest and lightest component is the Registry officially launched by docker. It is a storage and content delivery system that can maintain several named container images. These images can have different versions, and it itself supports TLS and Basic authentication for image protection.
[0004] However, when the images in the Registry need to be managed by project, and the users of the project need to be controlled in more detail, and the public and private image repositories need to be distinguished, Harbor needs to be used. Harbor uses the capabilities of Registry for image management at the bottom layer, and encapsulates many enterprise-level application scenarios at the upper application layer. It provides a role-based access control mechanism and controls image organization and access permissions through projects. Especially in a multi-tenant scenario, the management and access control of multi-tenant image resources can be realized through the combination of tenants, namespaces and projects.
[0005] In the current public cloud, private cloud or hybrid cloud scenarios, container artifact management is still a problem that must be faced. When a development team releases a new version of a container image, how to quickly synchronize it to each cloud or different resource pools in the same cloud. Of course, some well-known public cloud vendors already have a mature and feasible solution for their own cloud environment, but this solution is only applicable to their own cloud environment. For hybrid cloud scenarios and cross-cloud scenarios, additional customization and integration testing are required. For the above-mentioned Harbor, it also has a replication function to synchronize images between different instances or different types of image repositories, but the network of the image source and the image synchronization end needs to be interconnected. When the network between different resource pools is not interconnected, this solution will be limited.
[0006] Therefore, how to realize the synchronization of mirror data between different resource pools becomes a technical problem to be solved. SUMMARY
[0007] The application provides a multi-scene compatible mirror synchronization method and device, equipment and a storage medium, aiming to realize the synchronization of mirror data between different resource pools.
[0008] In a first aspect, the application provides a multi-scene compatible mirror synchronization method, which comprises the following steps:
[0009] When the center end listens to a mirror synchronization event, the current network reachable state of a mirror source end and a mirror synchronization end is acquired;
[0010] The center end determines a mirror synchronization operation instruction corresponding to the current network reachable state according to a preset mirror synchronization operation table;
[0011] According to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the target mirror data of the mirror source end is synchronized and stored to the mirror synchronization end, so as to realize mirror synchronization.
[0012] In a second aspect, the application further provides a multi-scene compatible mirror synchronization device, which comprises:
[0013] A network reachable state acquisition module is configured to acquire the current network reachable state of a mirror source end and a mirror synchronization end when the center end listens to a mirror synchronization event;
[0014] An instruction determination module is configured to determine a mirror synchronization operation instruction corresponding to the current network reachable state according to a preset mirror synchronization operation table;
[0015] A mirror synchronization module is configured to synchronize and store the target mirror data of the mirror source end to the mirror synchronization end according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, so as to realize mirror synchronization.
[0016] In a third aspect, the application further provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the multi-scene compatible mirror synchronization method described above are realized.
[0017] In a fourth aspect, the application further provides a computer readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, the steps of the multi-scene compatible mirror synchronization method described above are realized.
[0018] The application provides a multi-scene compatible mirror image synchronization method and device, equipment and a storage medium. The method comprises the following steps: when a mirror image synchronization event is listened to by a center end, the current network reachable state of a mirror image source end and a mirror image synchronization end is acquired; the mirror image synchronization operation instruction corresponding to the current network reachable state is determined according to a preset mirror image synchronization operation table; and the target mirror image data of the mirror image source end is synchronized and stored to the mirror image synchronization end according to the mirror image synchronization operation corresponding to the mirror image synchronization operation instruction, so as to realize mirror image synchronization. In the above manner, the mirror image synchronization event of different mirror image resource pools is listened to by the center end. When the mirror image synchronization event of the mirror image source end is triggered, the current network reachable state between the mirror image source end and the mirror image synchronization end is acquired. The mirror image synchronization operation instruction suitable for the mirror image source end and the mirror image synchronization end to execute the mirror image data synchronization operation is determined according to the mirror image synchronization operation table. Then, the target mirror image data is synchronized from the mirror image source end to the mirror image synchronization end according to the mirror image synchronization operation instruction. Therefore, the mirror image data synchronization between different mirror image resource pools can be realized. Therefore, the mirror image synchronization scheme of multiple scenes can be adapted. The mirror image can be synchronized in different environments. Even if the source and the mirror image synchronization end are not connected to each other, as long as they can communicate with the center end at the same time, the synchronization can be completed. The applicability and reliability of the mirror image resource data synchronization method are improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are some embodiments of the application. Those skilled in the art can also obtain other drawings according to these drawings without any creative effort.
[0020] Figure 1 A flowchart of a first embodiment of a multi-scene compatible mirror image synchronization method provided by the application is shown in the figure.
[0021] Figure 2 A data interaction schematic diagram between components in a multi-scene compatible mirror image synchronization method provided by the embodiment of the application is shown in the figure.
[0022] Figure 3 A flowchart of a second embodiment of a multi-scene compatible mirror image synchronization method provided by the application is shown in the figure.
[0023] Figure 4 A structure schematic diagram of a first embodiment of a multi-scene compatible mirror image synchronization device provided by the application is shown in the figure.
[0024] Figure 5 A structure schematic diagram of a computer device provided by the embodiment of the application is shown in the figure.
[0025] The objectives, functional features and advantages of the present application will be further described with reference to the embodiments in combination with the accompanying drawings. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0027] The flowchart shown in the accompanying drawings is only an example and does not necessarily include all the contents and operations / steps, nor does it necessarily be executed in the described order. For example, some operations / steps can be further divided, combined or partially merged, so that the actual execution order can be changed according to the actual situation.
[0028] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features in the embodiments can be combined with each other without conflict.
[0029] Please refer to Figure 1 , Figure 1 A flowchart of a first embodiment of a multi-scenario compatible image synchronization method provided by the present application is shown in the accompanying drawings.
[0030] As shown in Figure 1 , the multi-scenario compatible image synchronization method includes steps S101 to S103.
[0031] S101, when the center end listens to an image synchronization event, the current network reachable state of the image source end and the image synchronization end is acquired;
[0032] In an embodiment, when a user pushes an image in one of the resource pools and triggers an image synchronization event, the center end will issue different synchronization operation instructions to the image source end and the image synchronization end according to the network reachable state of the image source end and the image synchronization end.
[0033] In an embodiment, after each image resource pool is deployed, it can be managed to the center end. The center end can test the network reachability between the image resource pool and other image resource pools managed by the center end when managing each image resource pool, and construct a reachability topology graph between the image resource pools according to the test results. The reachability topology graph can include the network reachable state between each pair of image resource pools.
[0034] In an embodiment, when a user uploads a new image in the image source end and triggers an image synchronization event, the center end can acquire the current network reachable state of the image source end and the image synchronization end according to the reachability topology graph.
[0035] In one embodiment, the current network reachability status includes storage-side reachability, proxy server-side reachability, and network unreachability.
[0036] Wherein, the storage end can be a communication connection between the first storage end of the mirror synchronization end and the second storage end of the mirror source end; the proxy server end can be a communication connection between the first proxy server end of the mirror synchronization end and the second proxy server end of the mirror source end; the network unreachable means that the mirror synchronization end and the mirror source end have no communication connection.
[0037] In one embodiment, when the image source and the image synchronization end can communicate directly through the data port of the storage end, that is, the image synchronization end can directly read image data from the storage end of the image source end, then the two are storage-reachable.
[0038] In one embodiment, when the two storage ends of the image source end and the image synchronization end cannot communicate directly, but can communicate through their corresponding proxy servers, data transmission between them can be achieved through the proxy servers, and thus the two ends are reachable through the proxy servers.
[0039] In one embodiment, when the two storage terminals corresponding to the image source and the image synchronization terminal cannot communicate with each other, and the proxy server terminals corresponding to the image source and the image synchronization terminal also cannot communicate with each other, that is, the two cannot directly transmit data, then the two are network unreachable.
[0040] S102. The central terminal determines the mirror synchronization operation instruction corresponding to the current network reachability state according to the preset mirror synchronization operation table.
[0041] In one embodiment, when the communication methods between the mirror source and the mirror synchronization end are different, the data synchronization process of the mirror data is also different, and the mirror synchronization operation instructions issued by the mirror source and the mirror synchronization end are also different. Therefore, a mirror synchronization operation table can be pre-configured according to the mirror synchronization operation instructions corresponding to different network reachability states. When the current network reachability state between the mirror source and the mirror synchronization end is determined, the corresponding mirror synchronization operation instruction can be queried in the mirror synchronization operation table according to the current network reachability state.
[0042] S103. According to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the target mirror data of the mirror source end is synchronously stored to the mirror synchronization end to achieve mirror synchronization.
[0043] In one embodiment, such as Figure 2As shown, the central end sends the mirror synchronization operation command to the mirror source end and the mirror synchronization end (resource pool A and resource pool B), so that the mirror source end and the mirror synchronization end can execute the corresponding mirror synchronization operation, thereby copying the target mirror data from the mirror source end and transmitting it to the mirror synchronization end, and storing it in the database of the mirror synchronization end, so as to realize the data synchronization of the target mirror data.
[0044] Furthermore, when the current network reachability status is such that the storage terminal is reachable, the target image data is synchronously stored in the first storage terminal based on the communication channel between the first storage terminal and the second storage terminal to complete the image synchronization.
[0045] In one embodiment, if the image source and the image synchronization end are interconnected via storage, then only the storage end needs to synchronize the information of each layer of the image. After synchronization is complete, the central end records the image information of the image synchronization end. This method is the fastest and most efficient.
[0046] Furthermore, when the current network reachability status is such that the proxy server is reachable, the target image data is transmitted to the first proxy server based on the communication channel between the first proxy server and the second proxy server; after the first proxy server receives the target image data, it stores the target image data in the first storage terminal to complete image synchronization.
[0047] In one embodiment, if the image source and image synchronization end only communicate through a proxy agent, the target's proxy agent needs to pull the image from the source's proxy agent and then push it back to the target's storage. This method is less efficient than the storage-side data transfer method because it involves processing through two additional proxy agents and incurs performance overhead during the image push and pull process.
[0048] Furthermore, when the current network reachability status is that the network is unreachable, the target mirror data is transmitted to the central end based on the communication channel between the central end and the mirror source end; after the central end receives the target mirror data, it transmits the target mirror data to the mirror synchronization end based on the communication channel between the central end and the mirror synchronization end, and stores it in the first storage end to complete the mirror synchronization.
[0049] In one embodiment, if the image source and the image synchronization point are not interconnected, a central terminal is needed to perform a task to pull the image from the image source and then push it to the image synchronization point. This method has the best compatibility, but the image needs to travel from the image source to the central terminal and then from the central terminal to the image synchronization point, which is inefficient.
[0050] This embodiment provides a mirror synchronization method compatible with multiple scenarios. The method involves a central endpoint monitoring mirror synchronization events from different mirror resource pools. When a mirror synchronization event is triggered at the mirror source, the current network reachability between the mirror source and the mirror synchronization endpoint is obtained. Based on the mirror synchronization operation table, a mirror synchronization operation instruction suitable for performing mirror data synchronization operations on both the mirror source and the mirror synchronization endpoint is determined. Then, according to this instruction, the target mirror data is synchronized from the mirror source to the mirror synchronization endpoint. This enables mirror data synchronization between different mirror resource pools, thus providing a mirror synchronization solution adaptable to various scenarios and capable of synchronizing mirrors in different environments. Even if the source and mirror synchronization endpoints are not interconnected, as long as they can both communicate with the central endpoint simultaneously, synchronization can be completed, improving the applicability and reliability of the mirror resource data synchronization method.
[0051] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the mirror synchronization method compatible with multiple scenarios provided in this application.
[0052] In this embodiment, based on the above... Figure 1 In the illustrated embodiment, step S101 specifically includes:
[0053] S201. Obtain the first data port corresponding to the mirror synchronization end and the second data port corresponding to the mirror source end, wherein the first data port is the data communication interface of the first storage end and the second data port is the data communication interface of the second storage end.
[0054] In one embodiment, when the network environment of one of the resource pools managed by the central end changes, or when a mirror resource synchronization event is triggered, the network reachability between the mirror source end and the mirror synchronization end can be retested.
[0055] In one embodiment, when testing the network reachability between the mirror source and the mirror synchronization end, the tests can be performed in the order of storage end, proxy server end, and central end.
[0056] In one embodiment, both the proxy agent (i.e., the proxy server) and the storage end corresponding to the image source and the image synchronization end expose a Ping API. This API (Application Programming Interface) has no actual business function and is only used for reachability testing. The API returns a Pong string as a response, indicating that the image is reachable and connected.
[0057] S202. Establish a communication connection between the first data port and the second data port, and obtain the first communication connection result;
[0058] S203. When the first communication connection result is communication reachable, determine that the current network reachability status of the mirror synchronization end and the mirror source end is that the storage end is reachable.
[0059] In one embodiment, the central end will inform the storage end of the address of the peer storage end through the agent end, so that the storage end can access the peer's Ping interface. That is, the first storage end corresponding to the mirror synchronization end accesses the second storage end corresponding to the mirror source end. After the access is completed, the results are returned to the central end. If it is reachable, the access direction is marked as storage end reachable, and this reachability test ends.
[0060] In one embodiment, if the network between the first storage terminal corresponding to the mirror synchronization terminal and the second storage terminal corresponding to the mirror source terminal is unreachable, i.e., a communication connection cannot be established, then a network reachability test is performed on the proxy server side.
[0061] Further, when the first communication connection result is communication unreachable, the third data port corresponding to the mirror synchronization end and the fourth data port corresponding to the mirror source end are obtained, wherein the third data port is the data communication interface of the first proxy server end and the fourth data port is the data communication interface of the second proxy server end; a communication connection is established between the third data port and the fourth data port to obtain a second communication connection result; when the second communication connection result is communication reachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the proxy server end is reachable; when the second communication connection result is communication unreachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the network is unreachable.
[0062] In one embodiment, if the network reachability test result for the storage end between the mirror source end and the mirror synchronization end is unreachable, a network reachability test can be performed on the proxy server end. The central end sends the address of the peer proxy agent end to each of the two proxy agents ends, allowing the proxy agents ends to access the peer Ping interface, that is, the third data port corresponding to the mirror synchronization end accesses the fourth data port corresponding to the mirror source end.
[0063] In one embodiment, after the access is completed, the results are returned to the central end. If the access is reachable, the access direction is marked as reachable by the Agent. If the access is not reachable, the direction is marked as unreachable, and the test ends.
[0064] In one embodiment, the central end can issue two reachability tests in two directions at once, thus generating two reachability records. These records are stored as a reachability topology map according to the addresses of the mirror source end and the mirror synchronization end, and the reachability level (including three types: storage end reachable, agent end reachable, and unreachable). This topology map is stored at the central end as a basis for selecting a synchronization scheme when performing synchronization tasks according to the synchronization rules.
[0065] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a first embodiment of a multi-scenario compatible mirror synchronization device provided in this application. This multi-scenario compatible mirror synchronization device is used to execute the aforementioned multi-scenario compatible mirror synchronization method. The multi-scenario compatible mirror synchronization device can be configured in a server.
[0066] like Figure 4 As shown, the multi-scenario compatible mirror synchronization device 300 includes: a network reachability status acquisition module 301, an instruction determination module 302, and a mirror synchronization module 303.
[0067] The network reachability status acquisition module 301 is used by the central end to acquire the current network reachability status of the image source end and the image synchronization end when it listens for the image synchronization event;
[0068] The instruction determination module 302 is used by the central end to determine the mirror synchronization operation instruction corresponding to the current network reachability state according to the preset mirror synchronization operation table.
[0069] The mirror synchronization module 303 is used to synchronize and store the target mirror data from the mirror source end to the mirror synchronization end according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, so as to achieve mirror synchronization.
[0070] In one embodiment, the current network reachability status includes storage-side reachability, proxy server-side reachability, and network unreachability;
[0071] The storage end can be a communication connection between the first storage end of the mirror synchronization end and the second storage end of the mirror source end;
[0072] The proxy server can be a communication connection between the first proxy server of the mirror synchronization end and the second proxy server of the mirror source end;
[0073] The network is unreachable because there is no communication connection between the mirror synchronization end and the mirror source end.
[0074] In one embodiment, the mirror synchronization module 303 is further configured to, when the current network reachability status is that the storage terminal is reachable, synchronize the target mirror data to the first storage terminal based on the communication channel between the first storage terminal and the second storage terminal, so as to complete the mirror synchronization.
[0075] In one embodiment, the mirror synchronization module 303 is further configured to transmit the target mirror data to the first proxy server based on the communication channel between the first proxy server and the second proxy server when the current network reachability status is that the proxy server is reachable;
[0076] After receiving the target image data on the first proxy server, the target image data is stored on the first storage terminal to complete image synchronization.
[0077] In one embodiment, the mirror synchronization module 303 is further configured to transmit the target mirror data to the central terminal based on the communication channel between the central terminal and the mirror source terminal when the current network reachability status is that the network is unreachable;
[0078] After receiving the target image data at the central end, the target image data is transmitted to the image synchronization end and stored in the first storage end based on the communication channel between the central end and the image synchronization end, so as to complete the image synchronization.
[0079] In one embodiment, the network reachability acquisition module 301 is further configured to acquire a first data port corresponding to the mirror synchronization end and a second data port corresponding to the mirror source end, wherein the first data port is the data communication interface of the first storage end and the second data port is the data communication interface of the second storage end; construct a communication connection between the first data port and the second data port to obtain a first communication connection result; and when the first communication connection result indicates that communication is reachable, determine that the current network reachability status of the mirror synchronization end and the mirror source end is that the storage end is reachable.
[0080] In one embodiment, the network reachability acquisition module 301 is further configured to, when the first communication connection result is communication unreachable, acquire the third data port corresponding to the mirror synchronization end and the fourth data port corresponding to the mirror source end, wherein the third data port is the data communication interface of the first proxy server end and the fourth data port is the data communication interface of the second proxy server end; construct a communication connection between the third data port and the fourth data port to obtain a second communication connection result; when the second communication connection result is communication reachable, determine that the current network reachability status of the mirror synchronization end and the mirror source end is that the proxy server end is reachable; when the second communication connection result is communication unreachable, determine that the current network reachability status of the mirror synchronization end and the mirror source end is that the network is unreachable.
[0081] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the device and each module described above can be referred to the corresponding processes in the aforementioned multi-scenario compatible mirror synchronization method embodiments, and will not be repeated here.
[0082] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 5 It runs on the computer device shown.
[0083] Please see Figure 5 , Figure 5 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0084] See Figure 5 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0085] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any multi-scenario compatible mirror synchronization method.
[0086] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0087] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to execute any mirror synchronization method compatible with multiple scenarios.
[0088] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0089] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0090] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0091] When the central terminal detects a mirror synchronization event, it obtains the current network reachability status of the mirror source and mirror synchronization terminals.
[0092] The central terminal determines the mirror synchronization operation instruction corresponding to the current network reachability state based on a preset mirror synchronization operation table.
[0093] According to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the target mirror data at the mirror source end is synchronously stored at the mirror synchronization end to achieve mirror synchronization.
[0094] In one embodiment, the current network reachability status includes storage-side reachability, proxy server-side reachability, and network unreachability;
[0095] The storage end can be a communication connection between the first storage end of the mirror synchronization end and the second storage end of the mirror source end;
[0096] The proxy server can be a communication connection between the first proxy server of the mirror synchronization end and the second proxy server of the mirror source end;
[0097] The network is unreachable because there is no communication connection between the mirror synchronization end and the mirror source end.
[0098] In one embodiment, when the processor performs the mirror synchronization operation corresponding to the mirror synchronization operation instruction, and synchronously stores the target mirror data from the mirror source end to the mirror synchronization end to achieve mirror synchronization, it is used to implement:
[0099] When the current network reachability status is such that the storage terminal is reachable, the target image data is synchronously stored in the first storage terminal based on the communication channel between the first storage terminal and the second storage terminal to complete the image synchronization.
[0100] In one embodiment, when the processor performs the mirror synchronization operation corresponding to the mirror synchronization operation instruction, synchronously storing the target mirror data from the mirror source end to the mirror synchronization end to achieve mirror synchronization, it is also configured to perform:
[0101] When the current network reachability status is such that the proxy server is reachable, the target image data is transmitted to the first proxy server based on the communication channel between the first proxy server and the second proxy server.
[0102] After receiving the target image data on the first proxy server, the target image data is stored on the first storage terminal to complete image synchronization.
[0103] In one embodiment, when the processor performs the mirror synchronization operation corresponding to the mirror synchronization operation instruction, synchronously storing the target mirror data from the mirror source end to the mirror synchronization end to achieve mirror synchronization, it is also configured to perform:
[0104] When the current network reachability status is that the network is unreachable, the target mirror data is transmitted to the central terminal based on the communication channel between the central terminal and the mirror source terminal;
[0105] After receiving the target image data at the central end, the target image data is transmitted to the image synchronization end and stored in the first storage end based on the communication channel between the central end and the image synchronization end, so as to complete the image synchronization.
[0106] In one embodiment, when the processor acquires the current network reachability status of the mirror source and mirror synchronization endpoints, it is configured to:
[0107] Obtain the first data port corresponding to the mirror synchronization end and the second data port corresponding to the mirror source end, wherein the first data port is the data communication interface of the first storage end and the second data port is the data communication interface of the second storage end;
[0108] Establish a communication connection between the first data port and the second data port, and obtain the first communication connection result;
[0109] When the first communication connection result is communication reachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the storage end is reachable.
[0110] In one embodiment, after establishing the communication connection between the first data port and the second data port and obtaining the first communication connection result, the processor is further configured to implement:
[0111] When the first communication connection result is communication unreachable, the third data port corresponding to the mirror synchronization end and the fourth data port corresponding to the mirror source end are obtained, wherein the third data port is the data communication interface of the first proxy server and the fourth data port is the data communication interface of the second proxy server.
[0112] Establish a communication connection between the third data port and the fourth data port to obtain a second communication connection result;
[0113] When the second communication connection result is communication reachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the proxy server end is reachable;
[0114] When the second communication connection result is communication unreachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be network unreachable.
[0115] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the multi-scenario compatible mirror synchronization methods provided in the embodiments of this application.
[0116] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard equipped on the computer device.
[0117] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A mirror synchronization method compatible with multiple scenarios, characterized in that, The method includes: When the central terminal detects a mirror synchronization event, it obtains the current network reachability status of the mirror source and mirror synchronization terminals. The central terminal determines the mirror synchronization operation instruction corresponding to the current network reachability state based on a preset mirror synchronization operation table. According to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, the target mirror data at the mirror source end is synchronously stored at the mirror synchronization end to achieve mirror synchronization; The current network reachability status includes storage end reachability, proxy server end reachability, and network unreachability; storage end reachability means that the first storage end of the mirror synchronization end and the second storage end of the mirror source end are connected in communication; proxy server end reachability means that the first proxy server end of the mirror synchronization end and the second proxy server end of the mirror source end are connected in communication; network unreachability means that the mirror synchronization end and the mirror source end are not connected in communication. When the image source and the image synchronization end can communicate directly through their respective storage ports, then the two are storage-reachable. When the two storage ends of the image source and the image synchronization end cannot communicate directly, but their corresponding proxy servers can communicate, then the two are reachable through the proxy server. When the two storage terminals corresponding to the image source and the image synchronization terminal cannot communicate with each other, and the proxy servers corresponding to the image source and the image synchronization terminal also cannot communicate with each other, then the two are considered network unreachable.
2. The mirror synchronization method compatible with multiple scenarios according to claim 1, characterized in that, The step of synchronously storing the target image data from the image source end to the image synchronization end according to the image synchronization operation corresponding to the image synchronization operation instruction to achieve image synchronization includes: When the current network reachability status is such that the storage terminal is reachable, the target image data is synchronously stored in the first storage terminal based on the communication channel between the first storage terminal and the second storage terminal to complete the image synchronization.
3. The mirror synchronization method compatible with multiple scenarios according to claim 1, characterized in that, The step of synchronously storing the target image data from the image source end to the image synchronization end according to the image synchronization operation corresponding to the image synchronization operation instruction to achieve image synchronization further includes: When the current network reachability status is such that the proxy server is reachable, the target image data is transmitted to the first proxy server based on the communication channel between the first proxy server and the second proxy server. After receiving the target image data on the first proxy server, the target image data is stored on the first storage terminal to complete image synchronization.
4. The mirror synchronization method compatible with multiple scenarios according to claim 1, characterized in that, The step of synchronously storing the target image data from the image source end to the image synchronization end according to the image synchronization operation corresponding to the image synchronization operation instruction to achieve image synchronization further includes: When the current network reachability status is that the network is unreachable, the target mirror data is transmitted to the central terminal based on the communication channel between the central terminal and the mirror source terminal; After receiving the target image data at the central end, the target image data is transmitted to the image synchronization end and stored in the first storage end based on the communication channel between the central end and the image synchronization end, so as to complete the image synchronization.
5. The mirror synchronization method compatible with multiple scenarios according to claim 1, characterized in that, The process of obtaining the current network reachability status of the mirror source and mirror synchronization ends includes: Obtain the first data port corresponding to the mirror synchronization end and the second data port corresponding to the mirror source end, wherein the first data port is the data communication interface of the first storage end and the second data port is the data communication interface of the second storage end; Establish a communication connection between the first data port and the second data port, and obtain the first communication connection result; When the first communication connection result is communication reachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the storage end is reachable.
6. The mirror synchronization method compatible with multiple scenarios according to claim 5, characterized in that, After establishing the communication connection between the first data port and the second data port and obtaining the first communication connection result, the method further includes: When the first communication connection result is communication unreachable, the third data port corresponding to the mirror synchronization end and the fourth data port corresponding to the mirror source end are obtained, wherein the third data port is the data communication interface of the first proxy server and the fourth data port is the data communication interface of the second proxy server. Establish a communication connection between the third data port and the fourth data port to obtain a second communication connection result; When the second communication connection result is communication reachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be that the proxy server end is reachable; When the second communication connection result is communication unreachable, the current network reachability status of the mirror synchronization end and the mirror source end is determined to be network unreachable.
7. A mirror synchronization device compatible with multiple scenarios, characterized in that, The multi-scenario compatible mirror synchronization device includes: The network reachability status acquisition module is used by the central end to obtain the current network reachability status of the image source and the image synchronization end when it listens for the image synchronization event; The instruction determination module is used by the central end to determine the mirror synchronization operation instruction corresponding to the current network reachability state based on a preset mirror synchronization operation table. The mirror synchronization module is used to synchronize and store the target mirror data from the mirror source end to the mirror synchronization end according to the mirror synchronization operation corresponding to the mirror synchronization operation instruction, so as to achieve mirror synchronization. The current network reachability status includes storage end reachability, proxy server end reachability, and network unreachability; storage end reachability means that the first storage end of the mirror synchronization end and the second storage end of the mirror source end are connected in communication; proxy server end reachability means that the first proxy server end of the mirror synchronization end and the second proxy server end of the mirror source end are connected in communication; network unreachability means that the mirror synchronization end and the mirror source end are not connected in communication. When the image source and the image synchronization end can communicate directly through their respective storage ports, then the two are storage-reachable. When the two storage ends of the image source and the image synchronization end cannot communicate directly, but their corresponding proxy servers can communicate, then the two are reachable through the proxy server. When the two storage terminals corresponding to the image source and the image synchronization terminal cannot communicate with each other, and the proxy servers corresponding to the image source and the image synchronization terminal also cannot communicate with each other, then the two are considered network unreachable.
8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the multi-scenario compatible mirror synchronization method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the multi-scenario compatible mirror synchronization method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Double-sending redundancy method based on traffic mirror image and storage medium
CN115766571A
Transparent input / output switching between synchronously mirrored storage volumes
US20120278568A1