Data synchronization method, data synchronization device, electronic device and storage medium

By searching the database of the virtual system and the local system in the electronic device, real-time data synchronization is achieved, which solves the problem of data desynchronization in the VMware system, ensures the integrity and consistency of the data, and achieves effective management of the virtual system.

CN113722338BActive Publication Date: 2024-10-18CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010450758.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-25
Publication Date
2024-10-18
Estimated Expiration
2040-05-25

AI Technical Summary

Technical Problem

In the existing technology, only physical machine-based data information in the VMware system is collected, which leads to the problem of missing data information on the business system platform and out-of-synchronization between the data in the business system platform and the data in the VMware system.

Method used

By finding a real-time updated first database with a target identification in the virtual system of the electronic device and synchronizing it to a second database with the same target identification in the local system, the consistency and integrity of the data are ensured.

Benefits of technology

It realizes the synchronization of business system platform data and VMware system data, ensuring the unity and consistency of data, thereby effectively managing the virtual system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113722338B_ABST
    Figure CN113722338B_ABST
Patent Text Reader

Abstract

The present application discloses a data synchronization method, a data synchronization device, an electronic device and a storage medium. The method comprises: searching a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time; searching a second database having a target identifier in a local system of the electronic device; synchronizing the data in the first database to the second database, thereby achieving synchronization between the data in the local system of the electronic device and the data in the virtual system, ensuring consistency between the data in the local system of the electronic device and the data in the virtual system, and further achieving effective management of the virtual system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data synchronization method, a data synchronization device, an electronic device and a storage medium. Background Art

[0002] With the continuous development of virtualization technology, virtualization technology such as VMware system has been widely used in various business platform systems. In related technologies, the business system platform only collects data information in the VMware system based on physical machines through the interface provided by the Software Development Kit (SDK) released by a third-party partner. This method leads to the problem of missing data information of the business system platform and the data in the business system platform being out of sync with the data in the VMware system. Summary of the invention

[0003] The present application hopes to provide a data synchronization method, a data synchronization device, an electronic device and a storage medium to solve the problem that the related technology only collects data information in the VMware system in units of physical machines, resulting in missing data information of the business system platform and the data in the business system platform is out of synchronization with the data in the VMware system.

[0004] The technical solution of this application is implemented as follows:

[0005] The present application provides a data synchronization method, the method comprising:

[0006] Searching a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time;

[0007] Searching a second database having the target identifier in the local system of the electronic device;

[0008] The data of the first database is synchronized to the second database.

[0009] Optionally, the second database having the target identifier in the local system of the electronic device is searched, including:

[0010] Searching whether there is a database with the target identifier in the local system;

[0011] If the database with the target identifier does not exist in the local system, the second database with the target identifier is established in the local system.

[0012] Optionally, the step of searching for a first database having a target identifier in a virtual system of an electronic device includes:

[0013] Obtaining the target identifier of the target object included in each level of the virtual system;

[0014] Based on the target identifier, the first database is searched.

[0015] Optionally, searching the first database based on the target identifier includes:

[0016] Based on the target identifier, searching a third database in the virtual system;

[0017] Acquiring current attribute information and historical attribute information of the third database;

[0018] If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0019] Optionally, the target object includes a first sub-target object, and the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an Internet protocol object.

[0020] A data synchronization device, comprising:

[0021] A first processing unit, used to search a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time;

[0022] A second processing unit, configured to search a second database having the target identifier in a local system of the electronic device;

[0023] The third processing unit is used to synchronize the data in the first database to the second database.

[0024] An electronic device, comprising:

[0025] A memory for storing executable instructions;

[0026] The processor is configured to execute the executable instructions stored in the memory to implement the following steps:

[0027] Searching a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time;

[0028] Searching a second database having the target identifier in the local system of the electronic device;

[0029] The data of the first database is synchronized to the second database.

[0030] Optionally, the processor is further configured to execute executable instructions stored in the memory to implement the following steps:

[0031] Obtaining the target identifier of the target object included in each level of the virtual system;

[0032] Based on the target identifier, the first database is searched.

[0033] Optionally, the processor is further configured to execute executable instructions stored in the memory to implement the following steps:

[0034] Based on the target identifier, searching a third database in the virtual system;

[0035] Acquiring current attribute information and historical attribute information of the third database;

[0036] If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0037] A computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data synchronization method as described above.

[0038] The present application provides a data synchronization method, a data synchronization device, an electronic device and a storage medium, which search for a first database with a target identifier in a virtual system of an electronic device, wherein the first database is a database that is updated in real time; search for a second database with a target identifier in a local system of the electronic device; synchronize the data of the first database to the second database; in this way, after the first database of the electronic device in the virtual system is updated in real time, the data of the first database is synchronized to the second database with the same target identifier in the local system; in this way, the problem of incomplete local system data and the lack of synchronization between local system data and data in a virtual system such as a VMware system is solved, and the integrity and uniformity of local system data and data in the VMware system are guaranteed, thereby realizing the synchronization of data in the local system of the electronic device and data in the virtual system, ensuring the consistency of data in the local system of the electronic device and data in the virtual system, and further realizing the effective management of the virtual system. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a data synchronization method provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of the composition structure of a virtual system provided in an embodiment of the present application;

[0041] Figure 3 A flowchart of another data synchronization method provided in an embodiment of the present application;

[0042] Figure 4 A flowchart of another data synchronization method provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of the structure of a data synchronization device provided in an embodiment of the present application;

[0044] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0046] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0047] The present application embodiment provides a data synchronization method applied to electronic equipment, referring to Figure 1 As shown, the method comprises the following steps:

[0048] Step 101: Search a first database having a target identifier in a virtual system of an electronic device.

[0049] The first database is a database updated in real time.

[0050] In an embodiment of the present application, the electronic device may be a device with storage space. When a user performs relevant operations on the electronic device, the electronic device generates operation data corresponding to the relevant operations, and then stores the operation data in the memory space of the electronic device, thereby achieving complete recording of the operation data.

[0051] In the embodiment of the present application, the target identifier can be understood as an identifier inherent to the target object, and the target identifier is the identifier of the target object contained in each level of the virtual system; it should be noted that there is a one-to-one correspondence between the target object and the target identifier.

[0052] In the embodiment of the present application, the first database can be understood as a database storing data generated by the target object in the virtual system, wherein the data in the first database includes the attribute information of the target object in the virtual system at the current moment. It should be noted that the first database is a database updated in real time. The electronic device finds the first database with the target identifier in the virtual system, and determines that the data in the first database is the data updated in real time.

[0053] Here, the virtual system can be a system that manages the virtual infrastructure. Figure 2 As shown, a virtual system 2 is installed on the electronic device, and the virtual system 2 is composed of multiple objects included in multiple levels. Multiple vcenters can be set in a virtual system 2, such as Figure 2 The vcenter referred to by 201 in the figure can have multiple data centers, such as Figure 2 The datacenter referred to by 202 in the figure can be divided into multiple clusters under each datacenter, such as Figure 2 The cluster referred to by 203 in the figure can contain multiple physical machines. Figure 2 The physical machine 204 in the figure can create multiple virtual machines under each physical machine, such as Figure 2 The virtual machine referred to by 205 .

[0054] In practical applications, reference Figure 2 As shown, the target identifier can be the identifier of each target object contained in each level of the virtual system 2, such as vcenter, datacenter, cluster, physical machine, and virtual machine; for example, the target identifier of the target object vcenter can be VC1, the target identifier of the target object datacenter can be DC1, and the target identifier of the target object cluster can be cluster1. Here, the marking method of the target identifier is not described in detail in the embodiment of the present application.

[0055] In actual applications, there are virtual system management tools in the virtual system, and the virtual system management tool can be VMware vCenter Server. VMware vCenter Server can quickly provision new server virtual machines and create a standardized virtual machine template library, so that the newly provisioned system can always meet the requirements of the data center. In addition, through VMware vCenter Server, running virtual machines can be migrated between host servers, so that hardware maintenance can be performed with minimal downtime. Other functions included in VMware vCenter Server, but not limited to other functions, can be used to balance the virtual machine load between hosts and manage virtual machines, thereby improving the high availability and disaster recovery capabilities of virtual machines.

[0056] In actual applications, each level in the virtual system includes different target objects, each object has a unique target identifier, and a first database corresponding to the target identifier exists. For example, the first level in the virtual system includes an object such as vcenter, and the attribute information in vcenter includes vcenter type, vcenter version, Internet Protocol (IP) address, user name, and password.

[0057] The second level of the virtual system includes objects such as datacenter, and the attribute information in the datacenter includes an identity document (ID) and a datacenter name.

[0058] The third level in the virtual system contains objects such as clusters. The attribute information in the cluster includes ID, cluster name, total number of active virtual machines, available memory, available storage, total number of physical machines, and total number of networks.

[0059] The fourth level in the virtual system includes objects such as physical machines, whose attribute information includes ID, number of storage pools, remaining memory, status, available local storage size, and remaining central processing unit (CPU).

[0060] The fifth level of the virtual machine system contains objects such as virtual machines. The attribute information of the virtual machine includes ID, name, status, number of CPUs, memory, system disk size, operating system, physical machine, and power-on password.

[0061] Among them, the attribute information can also be the information of the standard switch and standard port group associated with the physical machine. The attribute information contained in the standard switch includes ID, standard switch name, number of ports, physical network card list, maximum transmission unit, etc.; the attribute information contained in the standard port group includes ID, standard port group name, number of ports, standard switch ID and virtual local area network (VLAN) ID, etc.

[0062] Among them, the attribute information can also be the attribute information of the distributed switch and distributed port group associated with the physical machine. The attribute information contained in the distributed switch includes ID, distributed switch name, number of physical machines, number of virtual machines, total number of ports and number of distributed port groups, etc.; the attribute information contained in the distributed port group includes ID, distributed port group name, number of ports, and the ID of the distributed switch and VLAN to which it belongs, as well as the number of virtual machines, etc.

[0063] Among them, the attribute information can also be the snapshots, virtual networks, mounted hard disks and IPs contained in the virtual machines under the physical machines; the attribute information contained in the snapshots includes ID, snapshot name, description and the virtual machine to which it belongs; the attribute information contained in the virtual network includes ID, virtual network name, connection status, physical address (Media Access ControlAddress, MAC address), the physical machine to which it belongs and the speed, etc.

[0064] Among them, the attribute information can also be the storage pool, hard disk and physical network contained in the physical machine; the attribute information contained in the storage pool includes ID, storage type, total capacity, allocated storage space, unallocated storage space, number of virtual machines, number of templates and storage pool path, etc.; the attribute information contained in the hard disk includes ID, hard disk name, hard disk size, storage pool to which it belongs, whether it is shared, whether it is a system disk and path, etc.; the attribute information contained in the physical network includes ID, physical network name, connection status, MAC address, physical machine to which it belongs and speed, etc.

[0065] It should be noted that the attribute information mentioned above is the current attribute information of the target object, that is, the first database storing the current attribute information of the target object is a database updated in real time.

[0066] Step 102: Search a second database having a target identifier in the local system of the electronic device.

[0067] In the embodiment of the present application, the second database is a database in the local system that is different from the first database. The data in the second database includes attribute information of the target object in the virtual system. After the electronic device searches for the first database with the target identifier in the virtual system, based on the target identifier, it searches for the second database with the target identifier in the local system of the electronic device; it can be seen that the first database and the second database are databases with the same target identifier.

[0068] Step 103: Synchronize the data in the first database to the second database.

[0069] In the embodiment of the present application, data synchronization can be understood as sharing the data stored in one storage unit with the data stored in another storage unit to ensure that the data in the two storage units are completely unified. It can be understood that data synchronization is achieved through the data transmission interface between the storage units.

[0070] In an embodiment of the present application, the electronic device finds a first database with a target identifier in the virtual system, and finds a second database with a target identifier in the local system, and then, based on the real-time updated first database, synchronizes the data in the first database to the second database; that is, if the data in the first database with the target identifier in the virtual system is inconsistent with the data in the second database with the target identifier in the local system, the data in the first database is synchronized to the second database.

[0071] In actual applications, for example, if the electronic device finds that the current IP address data in the first database of the target identifier VC1 of the target object vcenter in the first level in the virtual system is inconsistent with the IP address data in the second database of the target identifier VC1 in the local system, the IP address data in the second database of the first local system is replaced with the current IP address data in the first database of the virtual system to ensure the consistency of the data in the database of the local system contained in the electronic device and the data in the database of the virtual system contained in the electronic device.

[0072] A data synchronization method provided in an embodiment of the present application includes searching a first database with a target identifier in a virtual system of an electronic device, wherein the first database is a database updated in real time; searching a second database with a target identifier in a local system of the electronic device; synchronizing the data of the first database to the second database; in this way, after the first database of the electronic device in the virtual system is updated in real time, the data of the first database is synchronized to the second database with the same target identifier in the local system; in this way, the problem of incomplete local system data and the lack of synchronization between local system data and data in a virtual system such as a VMware system is solved, and the integrity and uniformity of local system data and data in the VMware system are ensured, thereby achieving synchronization of data in the local system of the electronic device and data in the virtual system, ensuring consistency of data in the local system of the electronic device and data in the virtual system, and further achieving effective management of the virtual system.

[0073] Based on the above embodiments, the present application provides a data synchronization method, which is applied to electronic devices. Figure 3 As shown, the method comprises the following steps:

[0074] Step 301: Obtain target identifiers of target objects included in each level of the virtual system.

[0075] In the embodiment of the present application, the virtual system may be a system composed of multiple hierarchical structures, and the target object may be understood as the target object contained in each hierarchical structure in the multiple hierarchical structures in the virtual system. The target identifier may be understood as the identifier inherent to the target object; it should be noted that there is a one-to-one correspondence between the target object and the target identifier.

[0076] Here, the virtual system can be a system that manages the virtual infrastructure. Figure 2 As shown, a virtual system 2 is installed on the electronic device, and the virtual system 2 is composed of multiple objects included in multiple levels. Multiple vcenters can be set in a virtual system 2, such as Figure 2 The vcenter referred to by 201 in the figure can have multiple data centers, such as Figure 2 The datacenter referred to by 202 in the figure can be divided into multiple clusters under each datacenter, such as Figure 2 The cluster referred to by 203 in the figure can contain multiple physical machines. Figure 2 The physical machine 204 in the figure can create multiple virtual machines under each physical machine, such as Figure 2The virtual machine 205 in the physical machine 204 may be associated with multiple standard switches and standard port groups, distributed switches and distributed port groups, and the storage pool and hard disk included in the physical machine 204 include a template library and templates, a physical network card, etc. The virtual machine 205 created under the physical machine 204 includes a snapshot, a virtual network, a mounted hard disk, and an IP.

[0077] In other embodiments of the present application, the electronic device may traverse each level of the virtual machine system from top to bottom, and obtain the target object contained in each level of the virtual system, and then obtain the target identifier of the target object.

[0078] Step 302: Search the third database in the virtual system based on the target identifier.

[0079] In the embodiment of the present application, the third database is a database in the virtual system, and the data in the third database includes the attribute information of the target object in the virtual system at the previous moment. Based on the target identifier, the electronic device finds the third database with the target identifier in the virtual system.

[0080] Step 303: Acquire current attribute information and historical attribute information of the third database.

[0081] In the embodiment of the present application, the attribute information also includes at least information used to characterize the update time and update result of the third database. The current attribute information can be understood as the attribute information of the target object stored in the third database at the current moment; the historical attribute information can be understood as the attribute information of the target object stored in the third database at the previous moment. It can be understood that the previous moment refers to the moment after the attribute information in the third database is last updated.

[0082] In actual applications, each level in the virtual system contains different target objects, each object has a unique target identifier, and a third database corresponding to the target identifier exists. For example, the first level of the virtual system contains objects such as vcenter, and the attribute information in vcenter includes vcenter type, vcenter version, IP address, user name, and password.

[0083] The second level in the virtual system includes objects such as datacenter, and the attribute information in the datacenter includes ID and datacenter name.

[0084] The third level in the virtual system contains objects such as clusters. The attribute information in the cluster includes ID, cluster name, total number of active virtual machines, available memory, available storage, total number of physical machines, and total number of networks.

[0085] The fourth level in the virtual system includes objects such as physical machines, and the attribute information of the physical machines includes ID, number of storage pools, remaining memory, status, available local storage size, and remaining CPU.

[0086] The fifth level of the virtual machine system contains objects such as virtual machines. The attribute information of the virtual machine includes ID, name, status, number of CPUs, memory, system disk size, operating system, physical machine, and power-on password.

[0087] Among them, the attribute information can also be the information of the standard switch and standard port group associated with the physical machine. The attribute information contained in the standard switch includes ID, standard switch name, number of ports, physical network card list, maximum transmission unit, etc.; the attribute information contained in the standard port group includes ID, standard port group name, number of ports, standard switch ID and VLAN ID, etc.

[0088] Among them, the attribute information can also be the attribute information of the distributed switch and distributed port group associated with the physical machine. The attribute information contained in the distributed switch includes ID, distributed switch name, number of physical machines, number of virtual machines, total number of ports and number of distributed port groups, etc.; the attribute information contained in the distributed port group includes ID, distributed port group name, number of ports, and the ID of the distributed switch and VLAN to which it belongs, as well as the number of virtual machines, etc.

[0089] Among them, the attribute information can also be the snapshots, virtual networks, mounted hard disks and IPs contained in the virtual machines under the physical machines; the attribute information contained in the snapshots includes ID, snapshot name, description and the virtual machine to which it belongs; the attribute information contained in the virtual network includes ID, virtual network name, connection status, MAC address, physical machine to which it belongs and rate, etc.

[0090] Among them, the attribute information can also be the storage pool, hard disk and physical network contained in the physical machine; the attribute information contained in the storage pool includes ID, storage type, total capacity, allocated storage space, unallocated storage space, number of virtual machines, number of templates and storage pool path, etc.; the attribute information contained in the hard disk includes ID, hard disk name, hard disk size, storage pool to which it belongs, whether it is shared, whether it is a system disk and path, etc.; the attribute information contained in the physical network includes ID, physical network name, connection status, MAC address, physical machine to which it belongs and speed, etc.

[0091] In an embodiment of the present application, the electronic device obtains the current attribute information and historical attribute information of the third database, and then compares the current attribute information of the third database with the historical attribute information. There are two comparison situations. Situation 1: the current attribute information of the third database is the same as the historical attribute information, indicating that the electronic device has not modified and / or added data in the third database, and then there is no need to update the data in the third database at this time; Situation 2: the current attribute information of the third database is inconsistent with the historical attribute information, indicating that the electronic device has modified and / or added data in the third database, and then it is necessary to update the data in the third database to obtain an updated third database.

[0092] Step 304: If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0093] In an embodiment of the present application, the electronic device compares the current attribute information of the third database with the historical attribute information. When it is determined that the current attribute information is different from the historical attribute information, the data in the third database needs to be updated to obtain an updated third database. It can be understood that the updated third database is the first database.

[0094] In actual applications, in order to reduce the update operations on the third database, the electronic device rewrites a verification method for each attribute information in the third database according to the equals method to determine whether the current attribute information is the same as the historical attribute information. Only when the current attribute information in the third database is different from the historical attribute information, the third database will be updated to obtain the first database.

[0095] In other embodiments of the present application, in step 304, if the current attribute information and the historical attribute information are different, the data of the third database is updated. After obtaining the first database, the following operations need to be performed on the target object: If the target object includes a first sub-target object, the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an IP object, it is necessary to update the correspondence between the objects of the upper level associated with the first sub-target object, so as to obtain the first database.

[0096] In actual applications, after the electronic device obtains the third database contained in the snapshot of the virtual machine under the physical machine contained in the virtual system, the electronic device receives the user adding a new snapshot under the virtual machine, and stores the newly added database in the third database, such as the attribute information ID of the added snapshot is 001, the snapshot name is snapshot 1, and the description is used to record the state of data storage at a certain moment and the virtual machine to which it belongs is virtual machine A. The electronic device updates the added third database to obtain the first database. At the same time, the electronic device also obtains the target identifier of the target object virtual machine A, updates the corresponding relationship between virtual machine A and snapshot 1 contained in the database of virtual machine A, and obtains the updated database of virtual machine A.

[0097] Step 305: Find whether there is a database with the target identifier in the local system.

[0098] In an embodiment of the present application, the electronic device searches the local system for a database with the target identifier based on the target identifier. If the database with the target identifier does not exist in the local system, a second database with the target identifier is established in the local system.

[0099] In actual applications, after the electronic device obtains the target identifier of the target object contained in each level of the virtual system, it obtains the data contained in this level in the virtual system based on the target identifier. For example, after obtaining the vcenter data, based on the same target identifier such as VC1, it searches the local system for a second database with the target identifier VC1, and then determines whether the second database exists.

[0100] Step 306: If the database with the target identifier does not exist in the local system, a second database with the target identifier is established in the local system.

[0101] In an embodiment of the present application, the electronic device searches the local system for a database with the target identifier based on the target identifier. If no database with the target identifier is found in the local system, a second database with the target identifier is newly created in the local system.

[0102] Step 307: Synchronize the data in the first database to the second database.

[0103] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0104] Based on the above embodiments, the present application provides a data synchronization method, which is applied to electronic devices. Figure 4 As shown, the method comprises the following steps:

[0105] Step 401: Obtain data corresponding to each level object in the virtual system, such as vcenter data corresponding to the bottom vcenter object.

[0106] Among them, the virtual system includes multiple levels of data, and the electronic device obtains data corresponding to each level of objects in the virtual system, such as vcenter data corresponding to vcenter, datacenter data corresponding to datacenter, cluster data corresponding to cluster, physical machine data corresponding to physical machine, all storage pool data under the physical machine, all associated standard switch data under the physical machine, all associated standard switch port group data under the physical machine, all associated distributed switch data under the physical machine, all associated distributed switch port group data under the physical machine, all network adapter data under the physical machine, all template warehouse data under the physical machine, all template data under the template warehouse, and all virtual machine data under the physical machine object such as snapshot data, virtual network data, mounted hard disk data, and IP address data.

[0107] Step 402: Query the database in the local system to see whether there is any vcenter data.

[0108] In the embodiment of the present application, if the electronic device finds that the database in the local system does not contain vcenter data, step 403 is executed; if the electronic device finds that the database in the local system contains vcenter data, steps 404 to 406 are executed;

[0109] Step 403: Insert vcenter data into the database in the local system.

[0110] Step 404: Determine whether the attribute information in the underlying vcenter data in the virtual system has changed.

[0111] In the embodiment of the present application, the attribute information contained in the vcenter data in the virtual system includes vcenter type, vcenter version, IP address, user name and password, etc.

[0112] In the embodiment of the present application, if the electronic device determines that each attribute information in the underlying vcenter data in the virtual system changes, step 405 is executed;

[0113] Step 405: Update the vcenter data in the virtual system.

[0114] Step 406: Synchronize the vcenter data in the virtual system to the database in the local system.

[0115] Wherein, synchronizing the vcenter data in the virtual system to the database in the local system includes deleting data in the vcenter data that does not exist in the local system database.

[0116] It can be seen from the above scheme that the electronic device, based on the hierarchical logic of the virtual system's own architecture, obtains the data of each hierarchical object in the virtual system, and synchronizes the data in the database of the electronic device's local system with the data corresponding to each hierarchical object, thereby ensuring that the data in the local system is consistent with the data in the virtual system. At the same time, the electronic device directly operates on the data in the local system, thereby improving the operating speed of the electronic device.

[0117] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0118] The embodiment of the present application provides a data synchronization device, which can be applied to Figure 1 , Figure 3 In a data synchronization method provided in a corresponding embodiment, referring to Figure 5 As shown, the data synchronization device 5 includes:

[0119] A first processing unit 501 is used to search a first database having a target identifier in a virtual system of an electronic device, where the first database is a database updated in real time;

[0120] A second processing unit 502 is used to search a second database having a target identifier in a local system of the electronic device;

[0121] The third processing unit 503 is used to synchronize the data in the first database to the second database.

[0122] In other embodiments of the present application, the second processing unit 502 is further used to search whether there is a database with a target identifier in the local system;

[0123] If a database having the target identifier does not exist in the local system, a second database having the target identifier is established in the local system.

[0124] In other embodiments of the present application, the first processing unit 501 is further used to obtain the target identifier of the target object included in each level of the virtual system;

[0125] Based on the target identifier, a first database is searched.

[0126] In other embodiments of the present application, the first processing unit 501 is further configured to search a third database in the virtual system based on the target identifier;

[0127] Acquiring current attribute information and historical attribute information from a third database;

[0128] If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0129] In other embodiments of the present application, the target object includes a first sub-target object, and the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an Internet protocol object.

[0130] A data synchronization device provided by the present application searches for a first database with a target identifier in a virtual system of an electronic device, wherein the first database is a database updated in real time; searches for a second database with a target identifier in a local system of the electronic device; and synchronizes the data of the first database to the second database; in this way, after the first database of the electronic device in the virtual system is updated in real time, based on the target identifier of the first database, the second database with the same target identifier in the local system is determined, and then the data of the first database is synchronized to the second database in the local system, thereby solving the problem of incomplete local system data and the problem of local system data being out of sync with data in a virtual system such as a VMware system, and ensuring the integrity and uniformity of local system data and data in the VMware system, thereby achieving synchronization of data in the local system of the electronic device with data in the virtual system, ensuring consistency of data in the local system of the electronic device with data in the virtual system, and thereby achieving effective management of the virtual system.

[0131] It should be noted that the specific implementation process of the steps performed by each unit in this embodiment can refer to Figure 1 , Figure 3 The implementation process of the data synchronization method provided in the corresponding embodiment will not be repeated here.

[0132] The embodiment of the present application provides an electronic device, which can be applied to Figure 1 , Figure 3 In a data synchronization method provided in a corresponding embodiment, referring to Figure 6 As shown, the electronic device 6 includes: a processor 601 and a memory 602, wherein:

[0133] Memory 602, used to store executable instructions;

[0134] The processor 601 is configured to execute the executable instructions stored in the memory 602 to implement the following steps:

[0135] Searching for a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time;

[0136] Searching a second database having a target identifier in a local system of the electronic device;

[0137] Synchronize the data in the first database to the second database.

[0138] In other embodiments of the present application, the processor 601 is configured to execute the executable instructions stored in the memory 602 to implement the following steps:

[0139] Check whether there is a database with the target ID in the local system;

[0140] If a database having the target identifier does not exist in the local system, a second database having the target identifier is established in the local system.

[0141] In other embodiments of the present application, the processor 601 is configured to execute the executable instructions stored in the memory 602 to implement the following steps:

[0142] Obtaining target identifiers of target objects included in each level of the virtual system;

[0143] Based on the target identifier, a first database is searched.

[0144] In other embodiments of the present application, the processor 601 is configured to execute the executable instructions stored in the memory 602 to implement the following steps:

[0145] Based on the target identifier, searching a third database in the virtual system;

[0146] Acquiring current attribute information and historical attribute information from a third database;

[0147] If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0148] In other embodiments of the present application, the target object includes a first sub-target object, and the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an Internet protocol object.

[0149] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figure 1 , Figure 3 The implementation process of the data synchronization method provided in the corresponding embodiment will not be repeated here.

[0150] An embodiment of the present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the following steps:

[0151] Searching for a first database having a target identifier in a virtual system of the electronic device, wherein the first database is a database updated in real time;

[0152] Searching a second database having a target identifier in a local system of the electronic device;

[0153] Synchronize the data in the first database to the second database.

[0154] In other embodiments of the present application, the one or more programs may be executed by one or more processors to implement the following steps:

[0155] Check whether there is a database with the target ID in the local system;

[0156] If a database having the target identifier does not exist in the local system, a second database having the target identifier is established in the local system.

[0157] In other embodiments of the present application, the one or more programs may be executed by one or more processors to implement the following steps:

[0158] Obtaining target identifiers of target objects included in each level of the virtual system;

[0159] Based on the target identifier, a first database is searched.

[0160] In other embodiments of the present application, the one or more programs may be executed by one or more processors to implement the following steps:

[0161] Based on the target identifier, searching a third database in the virtual system;

[0162] Acquiring current attribute information and historical attribute information from a third database;

[0163] If the current attribute information is different from the historical attribute information, the data in the third database is updated to obtain the first database.

[0164] In other embodiments of the present application, the target object includes a first sub-target object, and the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an Internet protocol object.

[0165] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0166] It should be noted that the above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0167] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0168] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0169] In addition, all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), disks or optical disks, and other media that can store program codes.

[0170] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0171] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data synchronization method, characterized in that: The method comprises: Obtaining target identifiers of target objects included in each level of the virtual system; Based on the target identifier, searching a third database in the virtual system; Acquire current attribute information and historical attribute information of the third database; the current attribute information is attribute information of the target object stored in the third database at the current moment, and the historical attribute information is attribute information of the target object stored in the third database at the previous moment; If the current attribute information is different from the historical attribute information, the data of the third database is updated to obtain the first database, and the first database is a database updated in real time; the virtual system is composed of multiple objects included in multiple levels, and the multiple levels include: infrastructure vcenter in the first level, data center in the second level, cluster in the third level, physical machine in the fourth level, and virtual machine in the fifth level; the target identifier is the identifier of the target object included in each level of the virtual system; Searching a second database having the target identifier in the local system of the electronic device; The data of the first database is synchronized to the second database.

2. The method according to claim 1, characterized in that The second database having the target identifier in the local system of the electronic device is searched, comprising: Searching whether there is a database with the target identifier in the local system; If the database with the target identifier does not exist in the local system, the second database with the target identifier is established in the local system.

3. The method according to claim 1, characterized in that The target object includes a first sub-target object, and the first sub-target object includes at least one of a snapshot, a virtual network, a mounted hard disk, and an Internet protocol object.

4. A data synchronization device, characterized in that: The data synchronization device comprises: The first processing unit is used to obtain the target identifier of the target object contained in each level of the virtual system; based on the target identifier, search the third database in the virtual system; obtain the current attribute information and historical attribute information of the third database; the current attribute information is the attribute information of the target object stored in the third database at the current moment, and the historical attribute information is the attribute information of the target object stored in the third database at the previous moment; if the current attribute information and the historical attribute information are different, update the data of the third database to obtain the first database, and the first database is a real-time updated database; the virtual system is composed of multiple objects included in multiple levels, and the multiple levels include: the infrastructure vcenter in the first level, the data center in the second level, the cluster in the third level, the physical machine in the fourth level, and the virtual machine in the fifth level; the target identifier is the identifier of the target object contained in each level of the virtual system; A second processing unit, configured to search a second database having the target identifier in a local system of the electronic device; The third processing unit is used to synchronize the data in the first database to the second database.

5. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; The processor is configured to execute the executable instructions stored in the memory to implement the following steps: Obtain a target identifier of a target object contained in each level of the virtual system; based on the target identifier, search a third database in the virtual system; obtain current attribute information and historical attribute information of the third database; the current attribute information is attribute information of the target object stored in the third database at the current moment, and the historical attribute information is attribute information of the target object stored in the third database at the previous moment; if the current attribute information is different from the historical attribute information, update the data in the third database to obtain a first database, which is a database updated in real time; the virtual system is composed of multiple objects included in multiple levels, and the multiple levels include: infrastructure vcenter in the first level, data center in the second level, cluster in the third level, physical machine in the fourth level, virtual machine in the fifth level; the target identifier is the identifier of the target object contained in each level of the virtual system; Searching a second database having the target identifier in the local system of the electronic device; The data of the first database is synchronized to the second database.

6. A computer storage medium, characterized in that: The computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data synchronization method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Data processing method based on virtual machine under cloud computing environment

    CN107273211A

  • Method and device for achieving virtual machine synchronization and storage medium

    CN107357630A