A cross-machine room image synchronization method and device, computer equipment and storage medium

By dynamically selecting the number of servers in the data center and the synchronization source, the limitation of the main data center is removed, enabling flexible synchronization of cross-data center mirrors. This solves the problems of high bandwidth consumption and failure impact caused by fixed links in mirror synchronization methods, and achieves fast and efficient mirror synchronization.

CN114296874BActive Publication Date: 2025-10-24SHENZHEN WEIKE SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111621405.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-10-24
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In existing technologies, the fixed link of the mirror synchronization method results in high bandwidth consumption, which affects business services during peak periods, and synchronization cannot continue when the main data center fails.

Method used

By dynamically determining the number of servers in each data center, selecting the smallest data center as the target data center, and selecting a suitable synchronization source for mirror synchronization in real time, the limitation of the main data center is removed, enabling flexible synchronization of cross-data center mirrors.

Benefits of technology

This reduced the impact on business services, avoided synchronization interruptions caused by single data center failures, and achieved fast and efficient mirror synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296874B_ABST
    Figure CN114296874B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a cross-machine room image synchronization method and device, computer equipment and a storage medium. The method comprises: determining a first number of machines in all machine rooms, and determining a first target machine room to produce a target image according to the first number; querying a second number of machines in each machine room to be synchronized, and determining a second target machine room in the machine room to be synchronized according to the second number; querying a third number of machines in each synchronization source machine room that already has the target image, and determining a third target machine room in the synchronization source machine room according to the third number; synchronizing the target image of the second target machine room from the third target machine room as a synchronization source, and repeating the above machine room determination process and synchronization process until the synchronization of all machine rooms is completed. Thus, the influence on business services is reduced, and the problem of being unable to continue synchronization due to synchronization failure of a certain machine room is avoided, and fast and efficient synchronization of images for each machine room is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of virtual machines, and particularly relate to a cross-machine room image synchronization method and device, computer equipment and storage medium. BACKGROUND

[0002] Because the business needs a large number of images to start virtual machines to provide services, in order to ensure the high availability of the entire system, it is necessary to ensure that each machine room has full images.

[0003] The current implementation is to first limit a master machine room and make images, and then synchronize from the master machine room to other slave machine rooms, wherein the master machine room cannot be changed at will, and the synchronization link is fixed, and the master machine room can only synchronize to other slave machine rooms, and the synchronization image has a large bandwidth occupation problem, which has a greater impact on the provision of business services during the use peak period, and when the master machine room synchronization fails, the synchronization process cannot continue. SUMMARY

[0004] Embodiments of the present application provide a cross-machine room image synchronization method, device, computer equipment and storage medium to avoid the problem of fixed synchronization link, thereby reducing the impact on business services, and avoiding the problem that the synchronization cannot continue due to the synchronization failure of a certain machine room.

[0005] In a first aspect, embodiments of the present application provide a cross-machine room image synchronization method, which comprises:

[0006] Step A, determining a first number of machines in all machine rooms, and determining a first target machine room to make a target image according to the first number in all machine rooms;

[0007] Step B, querying a second number of machines in each to-be-synchronized machine room, and determining a second target machine room in the to-be-synchronized machine room according to the second number;

[0008] Step C, querying a third number of machines in each synchronization source machine room that already has the target image, and determining a third target machine room in the synchronization source machine room according to the third number, wherein the synchronization source machine room includes the first target machine room;

[0009] Step D, synchronizing the target image to the second target machine room by taking the third target machine room as a synchronization source, and returning to execute step B until the synchronization of all machine rooms is completed.

[0010] Optionally, the step of determining a first target machine room to make a target image according to the first number in all machine rooms comprises:

[0011] determining the machine room with the smallest first number in all machine rooms as the first target machine room;

[0012] The second target machine room is determined according to the second quantity in the machine room to be synchronized.

[0013] The second target machine room is determined as the machine room with the minimum second quantity in the machine room to be synchronized.

[0014] The third target machine room is determined according to the third quantity in the synchronization source machine room.

[0015] The third target machine room is determined as the machine room with the minimum third quantity in the synchronization source machine room.

[0016] Optionally, the third quantity of machines in each synchronization source machine room that has the target image is queried, and a third target machine room is determined in the synchronization source machine room according to the third quantity, and the method comprises:

[0017] A target synchronization source machine room with the same cloud vendor as the second target machine room is determined in the synchronization source machine room.

[0018] The fourth quantity of machines in each target synchronization source machine room is queried, and the third target machine room is determined in the target synchronization source machine room according to the fourth quantity.

[0019] Optionally, the third quantity of machines in each synchronization source machine room that has the target image is queried, and a third target machine room is determined in the synchronization source machine room according to the third quantity, and the method further comprises:

[0020] If the target synchronization source machine room does not exist in the synchronization source machine room, a third target machine room is determined in the synchronization source machine room according to the third quantity.

[0021] Optionally, the synchronization of the target image of the second target machine room is performed by the third target machine room as a synchronization source, and the method comprises:

[0022] A synchronization source request is sent to a synchronization service of the second target machine room through the third target machine room.

[0023] Optionally, after the synchronization source request is sent to the synchronization service of the second target machine room through the third target machine room, the method further comprises:

[0024] The second target machine room is added to a synchronization task queue information table.

[0025] The synchronization task queue information table is queried at a preset period to determine the synchronization of the second target machine room until the synchronization is completed.

[0026] Optionally, after the first target machine room is determined according to the first quantity in all machine rooms to make a target image, the method further comprises:

[0027] Adding the first target computer room to the synchronization source list;

[0028] After synchronizing the target mirror image of the second target computer room using the third target computer room as a synchronization source, the method further includes:

[0029] The second target computer room is added to the synchronization source list, so as to determine the synchronization source computer room according to the synchronization source list.

[0030] In a second aspect, an embodiment of the present invention further provides a cross-machine room mirror synchronization device, the device comprising:

[0031] A first target computer room determination module is configured to determine a first number of machines in all computer rooms, and determine a first target computer room from among all computer rooms based on the first number to create a target image;

[0032] a second target computer room determining module, configured to query a second number of machines in each computer room to be synchronized, and determine a second target computer room in the computer rooms to be synchronized according to the second number;

[0033] a third target computer room determining module, configured to query a third number of machines in each synchronization source computer room that already has the target mirror, and determine a third target computer room in the synchronization source computer rooms according to the third number, wherein the synchronization source computer rooms include the first target computer room;

[0034] The target mirror synchronization module is used to synchronize the target mirror of the second target computer room with the third target computer room as the synchronization source, and return to the second target computer room determination module to continue execution until the synchronization of all computer rooms is completed.

[0035] In a third aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:

[0036] one or more processors;

[0037] a memory for storing one or more programs;

[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the cross-computer room mirror synchronization method provided by any embodiment of the present invention.

[0039] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cross-computer room mirror synchronization method provided by any embodiment of the present invention.

[0040] The embodiment of the present application provides a cross-machine room image synchronization method, first determines a first quantity of machines in all machine rooms, and determines a first target machine room to make a target image according to the first quantity, then respectively inquires a second quantity of machines in each machine room to be synchronized and a third quantity of machines in each synchronization source machine room, and determines a second target machine room in the machine room to be synchronized according to the second quantity, and determines a third target machine room in the synchronization source machine room according to the third quantity, so as to take the third target machine room as a synchronization source to synchronize the target image of the second target machine room, and then repeats the determination process and the synchronization process of the second target machine room and the third target machine room until the synchronization of all machine rooms is completed. The cross-machine room image synchronization method provided by the embodiment of the present application cancels the limitation on the main machine room, determines the available server quantity of each machine room in real time, and selects a suitable synchronization source and synchronization object to synchronize, avoids the problem of fixed link, thereby reducing the influence on the business service, avoiding the problem that the synchronization cannot continue due to the synchronization failure of a machine room, and realizing the fast and efficient synchronization image for each machine room. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 The flow chart of the cross-machine room image synchronization method provided by the first embodiment of the present application is shown in the figure.

[0042] Figure 2 The structural schematic diagram of the cross-machine room image synchronization device provided by the second embodiment of the present application is shown in the figure.

[0043] Figure 3 The structural schematic diagram of the computer equipment provided by the third embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0044] The present application will be further described below in combination with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0045] Before discussing the example embodiments in more detail, it is noted that some example embodiments are described as processes that are depicted as flow diagrams. Although each can describe the operations as a sequential process, many of the operations can be performed in parallel, concurrently or even in a different order than as described. In addition, the order of the operations can be re-arranged. The processes can be terminated when their operations are completed, but the processes can also have additional steps not included in the figure. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0046] In addition, the terms "first", "second", etc. can be used herein to describe various directions, actions, steps or elements, etc., but these directions, actions, steps or elements are not limited by these terms. These terms are only used to distinguish the first direction, action, step or element from another direction, action, step or element. For example, without departing from the scope of the present application, a first target machine room can be referred to as a second target machine room, and similarly, a second target machine room can be referred to as a first target machine room. Both the first target machine room and the second target machine room are target machine rooms, but they are not the same target machine room. The terms "first", "second", etc. cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.

[0047] Embodiment one

[0048] Figure 1 The flowchart of the cross-machine room mirroring synchronization method provided by the first embodiment of the present application. The present embodiment can be applied to the case of mirroring synchronization of multiple machine rooms. The method can be performed by the cross-machine room mirroring synchronization device provided by the embodiment of the present application. The device can be realized by hardware and / or software, and can be generally integrated in a computer device, which can be a service center in particular. As shown in Figure 1 The specific steps include the following steps:

[0049] S11, determine the first number of machines in all machine rooms, and determine a first target machine room to make a target mirror image according to the first number in all machine rooms.

[0050] Specifically, the machine, i.e., the server, can first determine the first number of machines providing services in each machine room at the beginning of the method, and then determine the first target machine room according to the first number, and provide the first target machine room to the administrator to make a target image (i.e., a required image), so that the first target machine room can be used as the first synchronization source. Each machine room can need to provide a large number of services to users, and providing services requires network demand and occupies the public network bandwidth of the machine room. At the same time, due to the existence of cross-cloud machine rooms, cross-cloud machine room synchronization can only go through the public network, which can also have a large probability to cause the services provided by the machine room to be unavailable. Therefore, the machine room with a smaller first number can be determined as the first target machine room to further reduce the impact on business services. Optionally, the method of determining the first target machine room to make a target image according to the first number in all machine rooms includes determining the machine room with the smallest first number in all machine rooms as the first target machine room to reduce the impact on business services as much as possible. Specifically, the first target machine room can be obtained by sorting the first numbers (e.g., from small to large).

[0051] S12, query the second number of machines in each machine room to be synchronized, and determine a second target machine room in the machine room to be synchronized according to the second number.

[0052] Specifically, after determining the first target machine room and making the target image, or after completing a synchronization process, the second number of machines providing services in each machine room to be synchronized can be queried, and then a second target machine room can be determined according to the second number, so that a machine room can be selected from the machine rooms to be synchronized as a synchronization object. The machine rooms to be synchronized are machine rooms that have not completed synchronization in all machine rooms. As described above, the machine room with a smaller second number can be determined as the second target machine room to further reduce the impact on business services. Optionally, the method of determining the second target machine room according to the second number in the machine room to be synchronized includes determining the machine room with the smallest second number in the machine room to be synchronized as the second target machine room to reduce the impact on business services as much as possible. Specifically, the second target machine room can be obtained by sorting the second numbers (e.g., from small to large).

[0053] S13, query the third number of machines in each synchronization source machine room that has the target image, and determine a third target machine room in the synchronization source machine room according to the third number, wherein the synchronization source machine room includes the first target machine room.

[0054] Specifically, after the second target machine room is determined, the third quantity of machines providing services in each synchronization source machine room can be queried, and then the third target machine room is determined according to the third quantity, so that a machine room can be selected from the synchronization source machine rooms as a synchronization source, wherein the synchronization source machine room is a machine room that has already owned the target image among all machine rooms, and specifically can include the first target machine room that initially makes the target image, the second target machine room that has completed synchronization, etc. The third target machine room is the first target machine room when initially determined. As described above, the machine room with a smaller third quantity can be specifically determined as the third target machine room to further reduce the impact on business services. Optionally, the third target machine room is determined in the synchronization source machine room according to the third quantity, including: determining the machine room with the smallest third quantity in the synchronization source machine room as the third target machine room to reduce the impact on business services as much as possible, and the third target machine room can be obtained by sorting the third quantity (such as from small to large).

[0055] Optionally, the third quantity of machines in each synchronization source machine room that has already owned the target image is queried, and the third target machine room is determined in the synchronization source machine room according to the third quantity, including: determining a target synchronization source machine room with the same cloud vendor as the second target machine room in the synchronization source machine room; querying the fourth quantity of machines in each target synchronization source machine room, and determining the third target machine room in the target synchronization source machine room according to the fourth quantity. Specifically, when synchronizing the second target machine room, the machine room with the same cloud vendor as the second target machine room in the synchronization source machine room can be preferentially selected to further reduce the impact on business services. Then the target synchronization source machine room with the same cloud vendor as the second target machine room can be first determined in all synchronization source machine rooms, and the fourth quantity of machines providing services in each target synchronization source machine room can be queried to determine the third target machine room according to the fourth quantity. As described above, the machine room with a smaller fourth quantity in the target synchronization source machine room can be determined as the third target machine room, and the machine room with the smallest fourth quantity can be further determined as the third target machine room to reduce the impact on business services as much as possible. Specifically, each synchronization source machine room can be grouped according to the cloud vendor first, and each group can be sorted according to the machine quantity, and then the group with the same cloud vendor as the second target machine room can be determined as the target group, so that the third target machine room can be determined according to the sorting result in the target group, and meanwhile, when updating the synchronization source machine room each time, the newly added synchronization source machine room can be added to the corresponding group and inserted into the sorting result according to the machine quantity to save the sorting process each time.

[0056] Further optionally, the query has a third number of machines in each of the target image's synchronization source machine rooms, and determines a third target machine room in the synchronization source machine rooms according to the third number, and the method further comprises: if the target synchronization source machine room does not exist in the synchronization source machine rooms, determining the third target machine room in the synchronization source machine rooms according to the third number. Specifically, if there is no target synchronization source machine room with the same cloud provider as the second target machine room in all the synchronization source machine rooms, the third target machine room can be determined directly according to the third number of machines in each of the synchronization source machine rooms, and the specific process is as described above, which is not repeated here.

[0057] S14, synchronizing the target image of the second target machine room by the third target machine room as a synchronization source, and returning to step S12 until the synchronization of all machine rooms is completed.

[0058] Specifically, after the second target machine room and the third target machine room are determined, the third target machine room can be used as a synchronization source to synchronize the target image of the second target machine room. After the synchronization is completed, the second target machine room can be updated from a machine room to be synchronized to a synchronization source machine room, and then step S12 is returned to determine the second target machine room and the third target machine room for synchronization again until the synchronization of all machine rooms is completed.

[0059] Optionally, the synchronizing the target image of the second target machine room by the third target machine room as a synchronization source comprises: sending a synchronization source request to a synchronization service of the second target machine room through the third target machine room. Further optionally, after the sending of the synchronization source request to the synchronization service of the second target machine room through the third target machine room, the method further comprises: adding the second target machine room to a synchronization task queue information table; and querying the synchronization task queue information table according to a preset period to determine the synchronization of the second target machine room until the synchronization is completed. Specifically, after the second target machine room and the third target machine room are determined, the third target machine room can send a synchronization source request to the synchronization service of the second target machine room as a synchronization source to request synchronization. After the synchronization starts, the second target machine room can be added to the synchronization task queue information table, and then the synchronization of the second target machine room, such as the synchronization progress and whether the synchronization is successful, can be checked by constantly querying the synchronization task queue information table according to a preset period until the synchronization is completed, and then the second target machine room can be updated to a synchronization source machine room and removed from the synchronization task queue information table.

[0060] On the basis of the technical scheme, optionally, after the first target machine room is determined to make the target image according to the first quantity in all machine rooms, the first target machine room is added to a synchronization source list; after the second target machine room is synchronized with the target image by taking the third target machine room as the synchronization source, the second target machine room is added to the synchronization source list, so as to determine the synchronization source machine room according to the synchronization source list. Specifically, after the first target machine room that can be the synchronization source and the second target machine room that is synchronized are obtained, the corresponding machine rooms can be added to the synchronization source list, so that the third target machine room that is newly taken as the synchronization source can be determined from the synchronization source list.

[0061] The technical scheme provided by the embodiment of the application first determines the first quantity of machines in all machine rooms, and determines a first target machine room to make a target image according to the first quantity in all machine rooms, then respectively queries a second quantity of machines in each machine room to be synchronized and a third quantity of machines in each synchronization source machine room, and determines a second target machine room in the machine room to be synchronized according to the second quantity, and determines a third target machine room in the synchronization source machine room according to the third quantity, so as to synchronize the second target machine room with the target image by taking the third target machine room as the synchronization source, and then repeats the determination process and the synchronization process of the second target machine room and the third target machine room until the synchronization of all machine rooms is completed. The technical scheme provided by the embodiment of the application cancels the limitation of the main machine room, determines the number of available servers in each machine room in real time, and selects appropriate synchronization sources and synchronization objects for synchronization, thereby avoiding the problem of fixed link, reducing the influence on the business service, avoiding the problem that the synchronization cannot continue due to the synchronization failure of a machine room, and realizing the fast and efficient synchronization mirroring for each machine room.

[0062] Embodiment two

[0063] Figure 2 The structure diagram of the cross-machine room mirroring synchronization device provided by the embodiment two of the application is shown in the figure. The device can be realized by hardware and / or software, and can be integrated in a computer device to execute the cross-machine room mirroring synchronization method provided by any embodiment of the application. As shown in the figure, the device comprises: Figure 2

[0064] A first target machine room determination module 21 is configured to determine the first quantity of machines in all machine rooms, and determine a first target machine room to make a target image according to the first quantity in all machine rooms;

[0065] A second target machine room determination module 22 is configured to query a second quantity of machines in each machine room to be synchronized, and determine a second target machine room in the machine room to be synchronized according to the second quantity;

[0066] ​The third target machine room determination module 23 is configured to query a third number of machines in each synchronization source machine room which has the target image, and determine a third target machine room in the synchronization source machine room according to the third number, wherein the synchronization source machine room includes the first target machine room;

[0067] The target image synchronization module 24 is configured to synchronize the target image of the second target machine room by taking the third target machine room as a synchronization source, and return the second target machine room determination module to continue execution until the synchronization of all machine rooms is completed.

[0068] The technical scheme provided by the embodiment of the present application first determines a first number of machines in all machine rooms, and determines a first target machine room to make a target image according to the first number, then queries a second number of machines in each machine room to be synchronized and a third number of machines in each synchronization source machine room, and determines a second target machine room in the machine room to be synchronized according to the second number, and determines a third target machine room in the synchronization source machine room according to the third number, so as to synchronize the target image of the second target machine room by taking the third target machine room as a synchronization source, and repeat the determination process and the synchronization process of the second target machine room and the third target machine room until the synchronization of all machine rooms is completed. The technical scheme provided by the embodiment of the present application cancels the limitation of the main machine room, determines the number of available server stations of each machine room in real time, and selects appropriate synchronization source and synchronization object for synchronization, thereby avoiding the problem of fixed link, reducing the influence on business service, avoiding the problem that the synchronization cannot continue due to the synchronization failure of a machine room, and realizing the fast and efficient synchronization of the mirror image for each machine room.

[0069] On the basis of the above technical scheme, optionally, the first target machine room determination module 21 is specifically configured to:

[0070] determine the machine room with the smallest first number in all machine rooms as the first target machine room;

[0071] The second target machine room determination module 22 is specifically configured to:

[0072] determine the machine room with the smallest second number in the machine room to be synchronized as the second target machine room;

[0073] The third target machine room determination module 23 is specifically configured to:

[0074] determine the machine room with the smallest third number in the synchronization source machine room as the third target machine room.

[0075] On the basis of the above technical scheme, optionally, the third target machine room determination module 23 includes:

[0076] A target synchronization source machine room determination unit is configured to determine a target synchronization source machine room that is the same as a cloud vendor of the second target machine room in the synchronization source machine rooms.

[0077] A first determination unit is configured to query a fourth number of machines in each of the target synchronization source machine rooms, and determine the third target machine room in the target synchronization source machine rooms according to the fourth number.

[0078] On the basis of the above technical solution, optionally, the third target machine room determination module 23 further comprises:

[0079] A second determination unit is configured to determine a third target machine room in the synchronization source machine rooms according to the third number if the target synchronization source machine room does not exist in the synchronization source machine rooms.

[0080] On the basis of the above technical solution, optionally, the target mirror image synchronization module 24 comprises:

[0081] A synchronization source request sending unit is configured to send a synchronization source request to a synchronization service of the second target machine room through the third target machine room.

[0082] On the basis of the above technical solution, optionally, the target mirror image synchronization module 24 further comprises:

[0083] An information table adding unit is configured to add the second target machine room to a synchronization task queue information table after the synchronization source request is sent to the synchronization service of the second target machine room through the third target machine room.

[0084] An information table querying unit is configured to query the synchronization task queue information table according to a preset period to determine a synchronization situation of the second target machine room until the synchronization is completed.

[0085] On the basis of the above technical solution, optionally, the cross-machine room mirror image synchronization device further comprises:

[0086] A first synchronization source list adding module is configured to add the first target machine room to a synchronization source list after the first target machine room is determined according to the first number.

[0087] A second synchronization source list adding module is configured to add the second target machine room to the synchronization source list after the second target machine room is synchronized with the target mirror image by taking the third target machine room as a synchronization source, so as to determine the synchronization source machine rooms according to the synchronization source list.

[0088] The cross-machine room mirror image synchronization device provided by the embodiment of the application can execute the cross-machine room mirror image synchronization method provided by any embodiment of the application, and has the corresponding function modules and beneficial effects of the execution method.

[0089] It is worth noting that in the above embodiment of the cross-machine room image synchronization device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, the specific names of each functional unit are only for easy mutual differentiation, and do not serve to limit the protection scope of the present application.

[0090] Embodiment three

[0091] Figure 3 The structural schematic diagram of the computer device provided for the third embodiment of the present application shows a block diagram of an exemplary computer device suitable for implementing the embodiments of the present application. Figure 3 The computer device shown is only an example and should not impose any limitation on the functions and use range of the third embodiment of the present application. As Figure 3 shown, the computer device includes a processor 31, a memory 32, an input device 33, and an output device 34; the number of processors 31 in the computer device can be one or more, Figure 3 For example, the processor 31 in the computer device, the memory 32, the input device 33, and the output device 34 can be connected through a bus or other means, Figure 3 For example, by connecting through a bus.

[0092] The memory 32, as a kind of computer readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the cross-machine room image synchronization method in the embodiments of the present application (for example, the first target machine room determination module 21, the second target machine room determination module 22, the third target machine room determination module 23, and the target image synchronization module 24 in the cross-machine room image synchronization device). The processor 31 executes the software programs, instructions and modules stored in the memory 32, thereby performing various functional applications and data processing of the computer device, i.e. implementing the above-mentioned cross-machine room image synchronization method.

[0093] The memory 32 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some examples, the memory 32 can further include a memory remotely arranged with respect to the processor 31, which can be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0094] The input device 33 can be used to acquire the number of available servers in each machine room in real time, and to generate key signal inputs related to user settings and function controls of the computer equipment, etc. The output device 34 can be used to send synchronization tasks to each machine room, etc.

[0095] Embodiment Four

[0096] Embodiment Four of the present application also provides a storage medium containing computer executable instructions for performing a cross-machine room image synchronization method when executed by a computer processor, the method comprising:

[0097] Step A, determining a first number of machines in all machine rooms, and determining a first target machine room to make a target image according to the first number in all machine rooms;

[0098] Step B, querying a second number of machines in each machine room to be synchronized, and determining a second target machine room according to the second number in the machine room to be synchronized;

[0099] Step C, querying a third number of machines in each synchronization source machine room that has the target image, and determining a third target machine room according to the third number in the synchronization source machine room, wherein the synchronization source machine room includes the first target machine room;

[0100] Step D, synchronizing the target image from the third target machine room as a synchronization source to the second target machine room, and returning to Step B until the synchronization of all machine rooms is completed.

[0101] The storage medium can be any of various types of memory devices or storage devices. The term "storage medium" is intended to include an installation medium, e.g., a CD-ROM, floppy disks, or tape device; a computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; a non-volatile memory such as a magnetic medium (e.g., a hard drive or optical storage); registers or other similar types of memory elements upon which a computer processes data. The storage medium can also include other types of storage. Furthermore, the storage medium can be located in a computer system at which the program is executed, or located at a second computer system at which the program is executed, via a network such as the Internet. The second computer system can provide program instructions to a computer for execution. The term "storage medium" can include two or more storage mediums that can reside in different locations, e.g., in different computer systems that are connected over a network. The storage medium can store a program of instructions that can be executed by one or more processors.

[0102] Of course, the storage medium provided by the embodiment of the present application includes computer executable instructions, and the computer executable instructions are not limited to the method operations described above, but can also perform the related operations in the cross-machine room image synchronization method provided by any embodiment of the present application.

[0103] The computer readable signal medium can include a data signal transmitted, propagated or transmitted in baseband or as part of a carrier wave in which computer readable program code is embedded. Such propagated data signals can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals or any suitable combination thereof. Computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.

[0104] The program code contained on the computer readable medium can be transmitted in any suitable form, including but not limited to wireless, wire line, optical cable, RF or any suitable combination thereof.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by software and necessary general hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of software products, which can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH memory, a hard disk or an optical disk, etc., including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute the methods described in various embodiments of the present application.

[0106] Note that the above is only the preferred embodiment of the present application and the technical principle applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and those skilled in the art can make various obvious changes, readjustments and substitutions without departing from the scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A cross-machine room mirror image synchronization method, characterized in that, The method comprises the following steps: Step A: determining a first quantity of machines in all machine rooms, and determining a first target machine room in all machine rooms according to the first quantity to make a target image; Step B: inquiring a second quantity of machines in each machine room to be synchronized, and determining a second target machine room in the machine room to be synchronized according to the second quantity; Step C: inquiring a third quantity of machines in each synchronization source machine room that has the target image, and determining a third target machine room in the synchronization source machine room according to the third quantity, wherein the synchronization source machine room comprises the first target machine room; Step D: synchronizing the target image of the second target machine room by taking the third target machine room as a synchronization source, updating the second target machine room from a machine room to be synchronized to a synchronization source machine room, and returning to execute Step B until the synchronization of all machine rooms is completed; After the first target machine room is determined to make the target image according to the first quantity in all machine rooms, the method further comprises the following steps: adding the first target machine room to a synchronization source list; After the target image of the second target machine room is synchronized by taking the third target machine room as a synchronization source, the method further comprises the following step: adding the second target machine room to the synchronization source list to determine the synchronization source machine room according to the synchronization source list.

2. The cross-machine room mirror image synchronization method of claim 1, wherein, The first target machine room is determined to make the target image according to the first quantity in all machine rooms, and the method comprises the following step: determining the machine room with the smallest first quantity in all machine rooms as the first target machine room. The second target machine room is determined in the machine room to be synchronized according to the second quantity, and the method comprises the following step: determining the machine room with the smallest second quantity in the machine room to be synchronized as the second target machine room. The third target machine room is determined in the synchronization source machine room according to the third quantity, and the method comprises the following step: determining the machine room with the smallest third quantity in the synchronization source machine room as the third target machine room.

3. The cross-machine room mirror image synchronization method of claim 1, wherein, The third quantity of machines in each synchronization source machine room that has the target image is inquired, and the third target machine room is determined in the synchronization source machine room according to the third quantity, and the method comprises the following steps: determining a target synchronization source machine room with the same cloud manufacturer as the second target machine room in the synchronization source machine room; inquiring a fourth quantity of machines in each target synchronization source machine room, and determining the third target machine room in the target synchronization source machine room according to the fourth quantity.

4. The cross-machine room mirror image synchronization method of claim 3, wherein, The third quantity of machines in each synchronization source machine room that has the target image is inquired, and the third target machine room is determined in the synchronization source machine room according to the third quantity, and the method further comprises the following step: if the target synchronization source machine room does not exist in the synchronization source machine room, determining the third target machine room in the synchronization source machine room according to the third quantity.

5. The cross-machine room mirror image synchronization method of claim 1, wherein, The target image of the second target machine room is synchronized by taking the third target machine room as a synchronization source, and the method comprises the following step: sending a synchronization source request to a synchronization service of the second target machine room through the third target machine room.

6. The cross-machine room mirror image synchronization method of claim 5, wherein, After the synchronization source request is sent to the synchronization service of the second target machine room through the third target machine room, the method further comprises the following step: adding the second target machine room to a synchronization task queue information table. According to a preset period, the synchronization task queue information table is inquired to determine the synchronization of the second target machine room until the synchronization is completed.

7. A cross-machine room mirroring synchronization apparatus, characterized by, The method comprises the following steps: A first target machine room determining module is configured to determine a first number of machines in all machine rooms and determine a first target machine room to make a target image according to the first number; A second target machine room determining module is configured to inquire a second number of machines in each machine room to be synchronized and determine a second target machine room according to the second number; A third target machine room determining module is configured to inquire a third number of machines in each synchronization source machine room that has the target image and determine a third target machine room according to the third number, wherein the synchronization source machine room comprises the first target machine room; A target image synchronization module is configured to synchronize the target image in the second target machine room by taking the third target machine room as a synchronization source, update the second target machine room from a machine room to be synchronized to a synchronization source machine room after the synchronization is completed, and return the second target machine room determining module to continue the execution until the synchronization of all machine rooms is completed. The device further comprises: A first synchronization source list adding module is configured to add the first target machine room to a synchronization source list after the first target machine room to make a target image is determined according to the first number in all machine rooms; A second synchronization source list adding module is configured to add the second target machine room to the synchronization source list after the target image in the second target machine room is synchronized by taking the third target machine room as a synchronization source, so as to determine the synchronization source machine room according to the synchronization source list.

8. A computer device, comprising: The device further comprises: One or more processors; A memory configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the cross-machine room image synchronization method as claimed in any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the cross-machine room image synchronization method as claimed in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for creating virtual machines on batch, equipment and storage medium

    CN108170508A