Cloud asset synchronization methods and systems
By defining the dependency topology of cloud products and the parallel synchronization mechanism, the problems of slow and inaccurate cloud asset synchronization in multi-cloud scenarios are solved, and efficient and reliable cloud asset synchronization is achieved.
Patent Information
- Application Number
- CN202310618951.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In multi-cloud scenarios, existing cloud asset synchronization methods suffer from slow and inaccurate cloud asset information synchronization, especially due to synchronization failures and information inconsistencies caused by dependencies between different cloud products in public clouds and limitations on the frequency of interface calls.
Define the dependency topology between cloud products, determine the synchronization order according to the topology, synchronize public cloud, cloud account, cloud product and region in parallel, query asset information through public cloud interface, compare with database, update or add cloud asset information, and ensure the accuracy of synchronization through scanning time and secondary query.
It achieves efficient and highly reliable timed synchronization of cloud assets, solves product dependency issues, avoids public cloud call frequency limitations, and improves the accuracy and efficiency of synchronization.
Smart Images

Figure CN116566931B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud technology, and in particular to a cloud asset synchronization method, system, electronic device, and computer-readable storage medium. Background Technology
[0002] Public cloud typically refers to a cloud service provided by a third-party provider to users. Public clouds are generally accessible via the internet and may be free or inexpensive. The core attribute of a public cloud is shared resource service. There are many instances of this type of cloud, providing services across today's open public networks.
[0003] In a multi-cloud scenario, a user's cloud assets are typically distributed across multiple public clouds, multiple cloud accounts, and multiple cloud products, making it difficult for the user to grasp the status of all cloud assets and find them. Therefore, multi-cloud management systems usually use interfaces provided by public clouds to periodically synchronize asset information to a database and centrally display it to users, thereby improving the efficiency of cloud asset management.
[0004] However, due to the dependencies between different cloud products in a public cloud, this method of cloud asset synchronization may result in the asset instance being unable to find the associated cloud product instance information if the instance information of the dependent cloud product is synchronized before the instance information of the cloud product it depends on. Furthermore, public cloud interfaces have call frequency limits; excessively frequent calls will fail due to rate limiting, preventing timely synchronization of cloud asset information. Summary of the Invention
[0005] The main purpose of this application is to propose a cloud asset synchronization method, system, electronic device, and computer-readable storage medium, which aims to solve the problems of slow and inaccurate cloud asset information synchronization in existing cloud asset synchronization methods.
[0006] To achieve the above objectives, embodiments of this application provide a cloud asset synchronization method, the method comprising:
[0007] Define the dependency topology between cloud products;
[0008] Scheduled cloud asset synchronization tasks;
[0009] In the synchronization task, assets are synchronized in parallel according to public cloud, cloud account, cloud product, and region. In the parallel synchronization of cloud products, the synchronization order is determined according to the dependency topology.
[0010] Compare the synchronized cloud assets with the cloud assets in the database, and add or update cloud asset information in the database based on the comparison results.
[0011] Optionally, determining the synchronization order according to the dependency topology in the parallel synchronization of the cloud products includes:
[0012] If the current cloud product depends on other cloud products, synchronization will begin after the dependent cloud products have been synchronized.
[0013] Optionally, the comparison and synchronization of cloud assets with cloud assets in the database, and the addition or updating of cloud asset information in the database based on the comparison results, includes:
[0014] Query cloud asset information through public cloud interfaces;
[0015] Iterate through the retrieved cloud asset information and check if there is any cloud asset information with the same identifier in the database;
[0016] If no identical cloud asset information exists in the database, the current cloud asset information is added to the database, and the synchronization time is written.
[0017] Optionally, the comparison and synchronization of cloud assets with cloud assets in the database, and the addition or updating of cloud asset information in the database based on the comparison results, further includes:
[0018] In the case where cloud asset information with the same identifier exists in the database, verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database;
[0019] If there is a discrepancy, update the current cloud asset information in the database and update the synchronization time.
[0020] Optionally, when the method adds or updates cloud asset information in the database based on the comparison results, or does not perform an update operation because the cloud asset information is consistent, it further includes writing or updating the scan time, where the scan time is the time for comparing the current cloud assets.
[0021] Optionally, the method further includes:
[0022] The cloud assets in the database whose scan time has not been updated are treated as unsynchronized cloud assets and queried a second time. If the public cloud interface returns that the asset does not exist, the unsynchronized cloud asset is deleted from the database.
[0023] Optionally, the step of performing a secondary query on cloud assets in the database whose scan time has not been updated, treating them as unsynchronized cloud assets, and deleting the unsynchronized cloud assets from the database if the public cloud interface returns that the assets do not exist, includes:
[0024] The database is queried for cloud asset information whose scan time exceeds a threshold, and these are identified as unsynchronized cloud assets.
[0025] Traverse the unsynchronized cloud asset information and query through the public cloud interface whether there is cloud asset information with the same identifier;
[0026] If no cloud asset information with the same identifier exists in the public cloud, delete the currently unsynchronized cloud asset information from the database.
[0027] Furthermore, to achieve the above objectives, embodiments of this application also provide a cloud asset synchronization system, the system comprising:
[0028] The configuration module is used to define the dependency topology between cloud products;
[0029] The timed module is used to trigger cloud asset synchronization tasks at regular intervals;
[0030] The synchronization module is used to perform parallel asset synchronization according to public cloud, cloud account, cloud product, and region in the synchronization task, wherein the synchronization order of the cloud products is determined according to the dependency topology relationship in the parallel synchronization.
[0031] The comparison module is used to compare synchronized cloud assets with cloud assets in the database, and add or update cloud asset information in the database based on the comparison results.
[0032] To achieve the above objectives, this application also provides an electronic device, which includes: a memory, a processor, and a cloud asset synchronization program stored in the memory and executable on the processor. When the cloud asset synchronization program is executed by the processor, it implements the cloud asset synchronization method as described above.
[0033] To achieve the above objectives, embodiments of this application also provide a computer-readable storage medium storing a cloud asset synchronization program, which, when executed by a processor, implements the cloud asset synchronization method as described above.
[0034] The cloud asset synchronization method, system, electronic device, and computer-readable storage medium proposed in this application can solve the product dependency problem by defining the cloud product topology dependency relationship to determine the synchronization order of cloud products, and avoid the public cloud call frequency limitation by performing synchronization concurrency control according to the granularity of public cloud, cloud account, cloud product, and region, thereby achieving efficient and highly reliable timed synchronization of cloud assets. Attached Figure Description
[0035] Figure 1 An application environment architecture diagram for implementing various embodiments of this application;
[0036] Figure 2 This is a flowchart of a cloud asset synchronization method proposed in the first embodiment of this application;
[0037] Figure 3 This is a schematic diagram of a topological dependency relationship in this application;
[0038] Figure 4 for Figure 2 A detailed flowchart of step S206;
[0039] Figure 5 This is a flowchart of a cloud asset synchronization method proposed in the second embodiment of this application;
[0040] Figure 6 for Figure 5 A detailed flowchart of step S306;
[0041] Figure 7 for Figure 5 Detailed flowchart of step S308;
[0042] Figure 8 This is a schematic diagram of the hardware architecture of an electronic device according to the third embodiment of this application;
[0043] Figure 9 This is a schematic diagram of a cloud asset synchronization system proposed in the fourth embodiment of this application;
[0044] Figure 10 This is a schematic diagram of a cloud asset synchronization system proposed in the fifth embodiment of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0046] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0047] The following provides an explanation of the terms used in this application:
[0048] Public cloud: usually refers to cloud computing services provided by third-party providers to users.
[0049] Cloud products: Services and platforms provided by third-party vendors that organizations can use as part of a multi-cloud or hybrid cloud architecture. Cloud products may include compute, storage, databases, analytics, networking, security, applications, and other cloud services.
[0050] Cloud assets: Assets on the public cloud, mainly consisting of instances of public cloud products.
[0051] Currently, mainstream multi-cloud management systems synchronize cloud assets through interfaces provided by public clouds. However, this method of cloud asset synchronization may have the following problems:
[0052] (1) There are dependencies between different cloud products in the public cloud. For example, the instance attributes of a cloud server product contain image and disk information, so it depends on cloud image and cloud disk products. If the instance information of the dependent cloud product is synchronized before the instance information of the cloud product it depends on, the asset instance may not be able to find the associated cloud product instance information.
[0053] (2) Public cloud interfaces have call frequency limits. Too frequent calls will fail due to rate limiting, resulting in cloud asset information not being synchronized in a timely manner.
[0054] (3) The public cloud interface is unstable, and occasionally it may fail to return all cloud asset information, which may cause the cloud assets to be considered deleted and affect the accuracy of the cloud asset information.
[0055] Therefore, in order to solve the problems of slow and inaccurate cloud asset information synchronization caused by product dependence, frequency limitation and interface instability of public cloud interfaces, this application proposes a new efficient and reliable cloud asset synchronization solution in multi-cloud scenarios. The solution will be described below through various embodiments.
[0056] Please see Figure 1 , Figure 1 This is an application environment architecture diagram for implementing various embodiments of this application. This application can be applied to application environments including, but not limited to, multi-cloud management platform 2, public cloud 4, database 6, and client 8.
[0057] The multi-cloud management platform 2 is used to synchronize cloud asset information to the database 6 through the interface provided by the public cloud 4, and display it to the user on the user terminal 8.
[0058] The multi-cloud management platform 2 can be located on the server side, which can be a rack server, blade server, tower server, or cabinet server, etc. It can be a standalone server or a server cluster composed of multiple servers. The user terminal 8 can be a PC (Personal Computer), mobile phone, tablet computer, portable computer, wearable device, etc.
[0059] The multi-cloud management platform 2, public cloud 4, database 6, and user terminal 8 are connected via wired or wireless networks for data transmission and interaction. These networks can be an intranet, the Internet, Global System for Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G, 5G, Bluetooth, Wi-Fi, etc.
[0060] Example 1
[0061] like Figure 2 The diagram shown is a flowchart of a cloud asset synchronization method proposed in the first embodiment of this application. It is understood that the flowchart in this method embodiment is not intended to limit the order of execution steps. As needed, some steps in the flowchart can be added to or removed. The method will now be described using the multi-cloud management platform as the execution subject.
[0062] The method includes the following steps:
[0063] S200 defines the dependency topology between cloud products.
[0064] Because different cloud products in a public cloud have dependencies—for example, the instance attributes of a cloud server product include image and disk information, thus depending on cloud image and cloud disk products—if the instance information of a dependent cloud product is synchronized before the instance information of the cloud product it depends on, the asset instance may be unable to find the associated cloud product instance information. Therefore, to avoid this dependency-induced inability to find cloud product instance information, this embodiment first defines the dependency topology between cloud products, and then cloud asset synchronization can be performed according to the order of the dependency topology.
[0065] The dependency topology can be defined based on the cloud products that each cloud product's attributes depend on. For example... Figure 3 The diagram shown illustrates one example of the aforementioned topological dependency relationship. Figure 3 Taking cloud server products as an example, the dependency relationships are as follows:
[0066] (1) Cloud servers depend on hard drives, security groups, subnets, availability zones, tags, and projects;
[0067] (2) Disk depends on subnet, availability zone, tag, and project;
[0068] (3) Security groups and subnets depend on private networks;
[0069] (4) Private network, availability zone, tag-dependent region;
[0070] S202, triggers a cloud asset synchronization task at regular intervals.
[0071] Synchronization tasks are triggered periodically based on the user-configured synchronization cycle and the public cloud, cloud accounts, and cloud products that need to be synchronized.
[0072] S204, in the synchronization task, performs parallel asset synchronization according to public cloud, cloud account, cloud product, and region.
[0073] In this embodiment, the synchronization task is performed in parallel using multiple public clouds, multiple cloud accounts, cloud products based on dependency topology, and geographically. The geographical parallelism needs to be determined based on the actual situation; it can be performed geographically or not.
[0074] First, all public clouds to be synchronized are traversed, and synchronization among all public clouds is performed in full parallel. For each public cloud, the cloud accounts to be synchronized are traversed, and synchronization among all cloud accounts is performed in full parallel. For each cloud account, the cloud products to be synchronized are traversed, and synchronization among cloud products is performed in parallel according to the aforementioned dependency topology. Specifically, if the current cloud product does not depend on other cloud products, synchronization begins directly; if the current cloud product depends on other cloud products, synchronization begins after the dependent cloud products have been synchronized.
[0075] For example, according to the above Figure 3 The dependencies should be synchronized in the following order: First, synchronize the region and project; then, synchronize the private network, availability zone, and tags; next, synchronize the subnet and security group; then, synchronize the hard drive; and finally, synchronize the cloud server.
[0076] In this embodiment, for each cloud product, the following situations may occur:
[0077] (1) The cloud product has multiple regions, and the frequency of the asset query interface is controlled by the regional granularity: all regions are traversed, all regions are fully parallel and synchronized, the asset query interface is serially scheduled within each region, and the interval between each interface scheduling is a certain period of time.
[0078] (2) The cloud product has multiple regions, but the frequency of the asset query interface is not controlled according to the regional granularity: all regions are traversed, all regions are synchronized serially, the asset query interface is scheduled serially within each region, and there is a certain interval between each interface scheduling.
[0079] (3) Cloud products do not have multiple regions: the asset query interface is scheduled serially, and there is a certain interval between each interface scheduling.
[0080] The interface scheduling interval can be the reciprocal of the upper limit of the interface access frequency divided by 2. For example, if the upper limit of the access frequency is 20 times / second, then the interface scheduling interval is 1 / (20 / 2) = 0.1 seconds.
[0081] S206, compare the synchronized cloud assets with the cloud assets in the database, and add or update cloud asset information in the database.
[0082] In this embodiment, after querying cloud asset information through the public cloud interface, it is compared with cloud asset information in the database to add or update cloud asset information in the database.
[0083] For more details, please refer to the following: Figure 4 This is a detailed flowchart illustrating step S206 above. It is understood that this flowchart is not intended to limit the order of execution steps. Steps in this flowchart can be added to or removed as needed. In this embodiment, step S206 specifically includes:
[0084] S2060 allows querying cloud asset information via a public cloud interface.
[0085] S2062, iterate through the retrieved cloud asset information and check if there is any cloud asset information with the same ID (identifier / code) in the database. If it does not exist, proceed to step S2064; if it does exist, proceed to step S2066.
[0086] Specifically, the process can begin by obtaining the ID of the cloud asset retrieved from the public cloud interface, and then querying the database to see if there is any cloud asset information with the same ID as the current cloud asset. The traversal refers to performing subsequent steps for each cloud asset retrieved from the public cloud interface until all retrieved cloud assets have been processed.
[0087] S2064, Add current cloud asset information to the database.
[0088] When no cloud asset information with the same ID as the current cloud asset exists in the database, it means that all information of the current cloud asset in the public cloud has not been synchronized to the database, and synchronization is required. The synchronization method for the current cloud asset is as follows: based on the current cloud asset information queried from the public cloud interface, the current cloud asset information is added to the database, meaning all information of the current cloud asset is synchronized to the database. Additionally, the synchronization time needs to be written to the database. The synchronization time is the time when the synchronization operation on the current cloud asset information is performed, which in this case is the time when the current cloud asset information is added to the database. At this point, the traversal steps can be returned to continue processing steps S2062-S2068 for the next cloud asset queried from the public cloud interface.
[0089] S2066, verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database. If they are inconsistent, proceed to step S2068; if they are consistent, return to step S2062 and continue to compare the next cloud asset information.
[0090] When a cloud asset with the same ID as the current cloud asset exists in the database, it indicates that the current cloud asset in the public cloud has been synchronized to the database. However, there may be updated information in the public cloud that has not been fully synchronized. Therefore, it is necessary to further verify whether the current cloud asset information in the public cloud is completely consistent with the corresponding cloud asset information in the database. If they are completely consistent, it means that there is no information in the public cloud that has not been synchronized, and no further asset synchronization operation is needed. At this point, the traversal steps can be returned to continue processing steps S2062-S2068 for the next cloud asset queried from the public cloud interface.
[0091] S2068, Update the current cloud asset information in the database.
[0092] When the current cloud asset information in the public cloud is not completely consistent with the corresponding cloud asset information in the database, it indicates that there is unsynchronized information in the current cloud asset in the public cloud, and therefore asset synchronization is still required. However, instead of adding (creating) the current cloud asset information in the database, the existing cloud asset information with the same ID as the current cloud asset is updated. The update content includes the parts of the information that are inconsistent between the current cloud asset in the public cloud and the corresponding cloud asset in the database; the corresponding cloud asset information in the database is updated based on the current cloud asset information in the public cloud. Additionally, the synchronization time also needs to be updated in the database. The synchronization time is the time when the current cloud asset information is synchronized, which in this case is the time when the current cloud asset information is updated in the database.
[0093] Then, return to the traversal steps and continue processing steps S2062-S2068 above for the next cloud asset queried from the public cloud interface.
[0094] The cloud asset synchronization method proposed in this embodiment can solve the product dependency problem by defining the synchronization order of cloud products based on the topological dependency relationship of cloud products. It avoids the public cloud call frequency limitation by performing synchronization concurrency control according to the granularity of public cloud, cloud account, cloud product and region, and achieves efficient and highly reliable timed synchronization of cloud assets.
[0095] Example 2
[0096] like Figure 5The diagram shown is a flowchart of a cloud asset synchronization method according to a second embodiment of this application. In the second embodiment, the cloud asset synchronization method further includes step S308, based on the first embodiment described above. It is understood that the flowchart in this method embodiment is not intended to limit the order of execution steps. Steps in the flowchart can be added or removed as needed.
[0097] The method includes the following steps:
[0098] S300 defines the dependency topology between cloud products.
[0099] Because different cloud products in a public cloud have dependencies, if the instance information of a dependent cloud product is synchronized before the instance information of the cloud product it depends on, the asset instance may be unable to find the associated cloud product instance information. Therefore, to avoid this dependency issue, this embodiment first defines the dependency topology between cloud products. Subsequently, cloud asset synchronization can be performed according to the order of this dependency topology. The dependency topology can be defined based on the cloud products that each cloud product's attributes depend on, and will not be elaborated further here.
[0100] S302, triggers a cloud asset synchronization task at regular intervals.
[0101] Synchronization tasks are triggered periodically based on the user-configured synchronization cycle and the public cloud, cloud accounts, and cloud products that need to be synchronized.
[0102] S304, in the synchronization task, performs parallel asset synchronization according to public cloud, cloud account, cloud product, and region.
[0103] In this embodiment, the synchronization task is performed in parallel using multiple public clouds, multiple cloud accounts, cloud products based on dependency topology, and geographically. The geographical parallelism needs to be determined based on the actual situation; it can be performed geographically or not.
[0104] First, all public clouds to be synchronized are traversed, and synchronization among all public clouds is performed in full parallel. For each public cloud, the cloud accounts to be synchronized are traversed, and synchronization among all cloud accounts is performed in full parallel. For each cloud account, the cloud products to be synchronized are traversed, and synchronization among cloud products is performed in parallel according to the aforementioned dependency topology. Specifically, if the current cloud product does not depend on other cloud products, synchronization begins directly; if the current cloud product depends on other cloud products, synchronization begins after the dependent cloud products have been synchronized.
[0105] In this embodiment, for each cloud product, the following situations may occur:
[0106] (1) The cloud product has multiple regions, and the frequency of the asset query interface is controlled by the regional granularity: all regions are traversed, all regions are fully parallel and synchronized, the asset query interface is serially scheduled within each region, and the interval between each interface scheduling is a certain period of time.
[0107] (2) The cloud product has multiple regions, but the frequency of the asset query interface is not controlled according to the regional granularity: all regions are traversed, all regions are synchronized serially, the asset query interface is scheduled serially within each region, and there is a certain interval between each interface scheduling.
[0108] (3) Cloud products do not have multiple regions: the asset query interface is scheduled serially, and there is a certain interval between each interface scheduling.
[0109] The interface scheduling interval can be the reciprocal of the upper limit of the interface access frequency divided by 2. For example, if the upper limit of the access frequency is 20 times / second, then the interface scheduling interval is 1 / (20 / 2) = 0.1 seconds.
[0110] S306, compare the synchronized cloud assets with the cloud assets in the database, add or update cloud asset information in the database, and update the scan time field at the same time.
[0111] In this embodiment, after querying cloud asset information through the public cloud interface, it is compared with cloud asset information in the database to add or update cloud asset information in the database. Meanwhile, to address the instability issue of the public cloud interface, this embodiment also requires updating the scan time field during the addition or update process.
[0112] For more details, please refer to the following: Figure 6 This is a detailed flowchart illustrating step S306 above. It is understood that this flowchart is not intended to limit the order of execution steps. Steps in this flowchart can be added to or removed as needed. In this embodiment, step S306 specifically includes:
[0113] S3060 allows querying cloud asset information via a public cloud interface.
[0114] S3062, iterate through the retrieved cloud asset information and check if there is any cloud asset information with the same ID in the database. If it does not exist, proceed to step S3064; if it exists, proceed to step S3066.
[0115] Specifically, the process can begin by obtaining the ID of the cloud asset retrieved from the public cloud interface, and then querying the database to see if there is any cloud asset information with the same ID as the current cloud asset. The traversal refers to performing subsequent steps for each cloud asset retrieved from the public cloud interface until all retrieved cloud assets have been processed.
[0116] S3064, Add current cloud asset information to the database, and write the scan time and synchronization time.
[0117] When no cloud asset information with the same ID as the current cloud asset exists in the database, it means that all information of the current cloud asset in the public cloud has not been synchronized to the database, and synchronization is required. The synchronization method for the current cloud asset is as follows: based on the current cloud asset information queried from the public cloud interface, the current cloud asset information is added to the database, meaning that all information of the current cloud asset is synchronized to the database.
[0118] In addition, the scan time and synchronization time also need to be written to the database. The scan time is the time when the current cloud asset is queried through the public cloud interface, that is, the time when the database is checked to see if there is cloud asset information with the same ID. The synchronization time is the time when the current cloud asset information is synchronized, which is the time when the current cloud asset information is added to the database.
[0119] S3066, Verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database. If they are consistent, proceed to step S3067; if they are inconsistent, proceed to step S3068.
[0120] When a cloud asset with the same ID as the current cloud asset exists in the database, it indicates that the current cloud asset in the public cloud has been synchronized to the database. However, it is possible that updated information in the public cloud has not been fully synchronized. Therefore, further verification is needed to confirm whether the current cloud asset information in the public cloud is completely consistent with the corresponding cloud asset information in the database.
[0121] S3067, Update the scan time for the corresponding cloud asset information in the database.
[0122] If the verification result shows that the current cloud asset information in the public cloud is completely consistent with the corresponding cloud asset information in the database, it means that there is no unsynchronized information in the current cloud asset in the public cloud, and no further asset synchronization operation is needed. In this case, it is only necessary to update the scan time of the corresponding cloud asset information in the database. The scan time is the time required to compare the current cloud asset, that is, the time required to verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database.
[0123] Then return to the traversal steps and continue processing steps S3062-S3068 for the next cloud asset queried from the public cloud interface.
[0124] S3068, Update the current cloud asset information in the database, and update the scan time and synchronization time at the same time.
[0125] When the current cloud asset information in the public cloud is not completely consistent with the corresponding cloud asset information in the database, it indicates that there is unsynchronized information in the current cloud asset in the public cloud, and therefore asset synchronization is still required. However, instead of adding (creating) the current cloud asset information in the database, the existing cloud asset information with the same ID as the current cloud asset is updated. The update content includes the parts of the current cloud asset information in the public cloud that are inconsistent with the corresponding cloud asset information in the database; the corresponding cloud asset information in the database is updated based on the current cloud asset information in the public cloud.
[0126] Additionally, the scan time and synchronization time also need to be updated in the database. The scan time is the time for comparing the current cloud asset, that is, the time to verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database. The synchronization time is the time for synchronizing the current cloud asset information, which in this case is the time for updating the current cloud asset information in the database.
[0127] Then, return to the traversal steps and continue processing steps S3062-S3068 above for the next cloud asset queried from the public cloud interface.
[0128] Back Figure 5 S308, cloud assets in the database whose scan time has not been updated are used as unsynchronized cloud assets for a second query. If the public cloud interface returns that the asset does not exist, the unsynchronized cloud asset is deleted from the database.
[0129] In this embodiment, the scan time field is updated regardless of whether an asset is added, updated, or not updated due to identical asset information. Therefore, the scan time field can be used to determine whether the cloud assets in the database are synchronized. For unsynchronized cloud assets, a separate query is performed again through the public cloud interface. If the interface returns that the unsynchronized cloud asset does not exist, the related data for that unsynchronized cloud asset is deleted from the database. Otherwise, if the interface returns information about the unsynchronized cloud asset, the corresponding cloud asset information in the database is updated based on the interface's result.
[0130] For more details, please refer to the following: Figure 7 This is a detailed flowchart illustrating step S308 above. It is understood that this flowchart is not intended to limit the order of execution steps. Steps in this flowchart can be added to or removed as needed. In this embodiment, step S308 specifically includes:
[0131] S3080 queries the database for cloud asset information whose scan time exceeds a threshold, and identifies them as unsynchronized cloud assets.
[0132] In this embodiment, the method for determining whether the cloud assets in the database are synchronized based on the scan time field is as follows: Query whether the interval between the scan time of each cloud asset in the database and the current time exceeds a preset threshold. If it exceeds the threshold, it indicates that the cloud asset has not been synchronized this time.
[0133] S3082, iterate through the unsynchronized cloud asset information and query the public cloud interface to see if there is any cloud asset information with the same ID. If it does not exist, proceed to step S3084; if it exists, proceed to step S3086.
[0134] Specifically, the ID of the unsynchronized cloud asset can be obtained from the database first, and then the public cloud interface can be used to query whether there is cloud asset information with the same ID as the currently unsynchronized cloud asset in the public cloud. The traversal refers to performing subsequent steps for each unsynchronized cloud asset retrieved from the database until all retrieved unsynchronized cloud assets have been processed.
[0135] S3084, Delete the currently unsynchronized cloud asset information in the database.
[0136] If, after a second query through the public cloud interface, the interface returns that the unsynchronized cloud asset does not exist, it means that there is no information related to the unsynchronized cloud asset in the public cloud. Therefore, the database no longer needs to store the data related to the unsynchronized cloud asset, and thus the data related to the unsynchronized cloud asset in the database is deleted.
[0137] S3086, Verify whether the currently unsynchronized cloud asset information in the database is consistent with the corresponding cloud asset information in the public cloud. If they are consistent, proceed to step S3087; if they are inconsistent, proceed to step S3088.
[0138] When cloud asset information with the same ID as the currently out-of-sync cloud asset exists in the public cloud, it is necessary to further verify whether the currently out-of-sync cloud asset information in the public cloud is completely consistent with the currently out-of-sync cloud asset information in the database.
[0139] S3087, update the scan time for currently unsynchronized cloud asset information in the database.
[0140] If the verification result shows that the currently unsynchronized cloud asset information in the public cloud is completely consistent with the currently unsynchronized cloud asset information in the database, it means that there is no unsynchronized information in the public cloud, and no further asset synchronization operation is needed. In this case, it is only necessary to update the scan time of the currently unsynchronized cloud asset information in the database. The scan time is the time required to compare the currently unsynchronized cloud assets, that is, the time required to verify whether the currently unsynchronized cloud asset information in the public cloud is consistent with the currently unsynchronized cloud asset information in the database.
[0141] Then return to the traversal steps and continue processing steps S3082-S3088 for the next unsynchronized cloud asset in the database.
[0142] S3088, Update the currently unsynchronized cloud asset information in the database, and update the scan time and synchronization time at the same time.
[0143] When the currently unsynchronized cloud asset information in the public cloud is not completely consistent with the currently unsynchronized cloud asset information in the database, it indicates that there is information in the currently unsynchronized cloud asset in the public cloud that has not yet been synchronized, and therefore an asset synchronization operation is required. The asset synchronization operation involves updating the currently unsynchronized cloud asset information in the database. The update content includes the parts of the currently unsynchronized cloud asset information in the public cloud that are inconsistent with the information in the database, and the currently unsynchronized cloud asset information in the database is updated according to the information in the public cloud.
[0144] Additionally, the scan time and synchronization time also need to be updated in the database. The scan time is the time for comparing the current cloud assets, that is, the time to verify whether the currently unsynchronized cloud asset information in the public cloud is consistent with the currently unsynchronized cloud asset information in the database. The synchronization time is the time for performing the synchronization operation on the current cloud asset information, which in this case is the time for updating the currently unsynchronized cloud asset information in the database.
[0145] Then, return to the traversal steps and continue processing steps S3082-S3088 above for the next unsynchronized cloud asset in the database.
[0146] The cloud asset synchronization method proposed in this embodiment addresses product dependency issues by defining the synchronization order of cloud products based on their topological dependencies. It avoids public cloud call frequency limitations through concurrency control based on public cloud, cloud account, cloud product, and region granularity. Furthermore, it resolves public cloud interface instability issues by performing a secondary query to confirm unsynchronized cloud assets. Therefore, through the above-mentioned synchronization order control, concurrency control, and secondary confirmation mechanism, efficient and highly reliable timed synchronization of cloud assets is achieved.
[0147] Example 3
[0148] like Figure 8 The diagram shown illustrates the hardware architecture of an electronic device 20 according to a third embodiment of this application. In this embodiment, the electronic device 20 may include, but is not limited to, a memory 21, a processor 22, and a network interface 23, which are interconnected via a system bus. It should be noted that... Figure 8 Only the electronic device 20 with components 21-23 is shown; however, it should be understood that implementation of all shown components is not required, and more or fewer components may be implemented alternatively. In this embodiment, the electronic device 20 may be a server-side computer device, such as a server.
[0149] The memory 21 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 21 may be an internal storage unit of the electronic device 20, such as the hard disk or memory of the electronic device 20. In other embodiments, the memory 21 may also be an external storage device of the electronic device 20, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 20. Of course, the memory 21 may include both the internal storage unit and the external storage device of the electronic device 20. In this embodiment, the memory 21 is typically used to store the operating system and various application software installed on the electronic device 20, such as the program code of the cloud asset synchronization system 60. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
[0150] In some embodiments, the processor 22 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 22 is typically used to control the overall operation of the electronic device 20. In this embodiment, the processor 22 is used to run program code stored in the memory 21 or process data, such as running the cloud asset synchronization system 60.
[0151] The network interface 23 may include a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 20 and other electronic devices.
[0152] Example 4
[0153] like Figure 9 The diagram shown is a modular schematic of a cloud asset synchronization system 60 according to the fourth embodiment of this application. The cloud asset synchronization system 60 can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of this application. The program modules referred to in the embodiments of this application are a series of computer program instruction segments capable of performing specific functions. The following description will specifically introduce the functions of each program module in this embodiment.
[0154] In this embodiment, the cloud asset synchronization system 60 includes:
[0155] Module 600 is used to define the dependency topology between cloud products.
[0156] Because different cloud products in a public cloud have dependencies—for example, the instance attributes of a cloud server product include image and disk information, thus depending on cloud image and cloud disk products—if the instance information of a dependent cloud product is synchronized before the instance information of the cloud product it depends on, the asset instance may be unable to find the associated cloud product instance information. Therefore, to avoid this dependency-induced inability to find cloud product instance information, this embodiment first defines the dependency topology between cloud products, and then cloud asset synchronization can be performed according to the order of the dependency topology. The dependency topology can be defined based on the cloud products that each cloud product's attributes depend on.
[0157] The timing module 602 is used to trigger cloud asset synchronization tasks on a timed basis.
[0158] Synchronization tasks are triggered periodically based on the user-configured synchronization cycle and the public cloud, cloud accounts, and cloud products that need to be synchronized.
[0159] Synchronization module 604 is used to perform parallel asset synchronization in synchronization tasks according to public cloud, cloud account, cloud product, and region.
[0160] In this embodiment, the synchronization task is performed in parallel using multiple public clouds, multiple cloud accounts, cloud products based on dependency topology, and geographically. The geographical parallelism needs to be determined based on the actual situation; it can be performed geographically or not.
[0161] First, all public clouds to be synchronized are traversed, and synchronization among all public clouds is performed in full parallel. For each public cloud, the cloud accounts to be synchronized are traversed, and synchronization among all cloud accounts is performed in full parallel. For each cloud account, the cloud products to be synchronized are traversed, and synchronization among cloud products is performed in parallel according to the aforementioned dependency topology. Specifically, if the current cloud product does not depend on other cloud products, synchronization begins directly; if the current cloud product depends on other cloud products, synchronization begins after the dependent cloud products have been synchronized.
[0162] In this embodiment, for each cloud product, the following situations may occur:
[0163] (1) The cloud product has multiple regions, and the frequency of the asset query interface is controlled by the regional granularity: all regions are traversed, all regions are fully parallel and synchronized, the asset query interface is serially scheduled within each region, and the interval between each interface scheduling is a certain period of time.
[0164] (2) The cloud product has multiple regions, but the frequency of the asset query interface is not controlled according to the regional granularity: all regions are traversed, all regions are synchronized serially, the asset query interface is scheduled serially within each region, and there is a certain interval between each interface scheduling.
[0165] (3) Cloud products do not have multiple regions: the asset query interface is scheduled serially, and there is a certain interval between each interface scheduling.
[0166] The interface scheduling interval can be the reciprocal of the upper limit of the interface access frequency divided by 2. For example, if the upper limit of the access frequency is 20 times / second, then the interface scheduling interval is 1 / (20 / 2) = 0.1 seconds.
[0167] The comparison module 606 is used to compare synchronized cloud assets with cloud assets in the database, and to add or update cloud asset information in the database.
[0168] In this embodiment, after querying cloud asset information through the public cloud interface, it is compared with cloud asset information in the database to add or update cloud asset information in the database. Specifically, this includes:
[0169] (1) Query cloud asset information through public cloud interface.
[0170] (2) Traverse the retrieved cloud asset information and check if there is cloud asset information with the same ID in the database.
[0171] (3) When there is no cloud asset information with the same ID in the database, add the current cloud asset information in the database and write the synchronization time.
[0172] (4) When cloud asset information with the same ID exists in the database, further verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database.
[0173] (5) When the current cloud asset information in the public cloud is inconsistent with the corresponding cloud asset information in the database, update the current cloud asset information in the database and update the synchronization time.
[0174] The cloud asset synchronization system proposed in this embodiment can solve the product dependency problem by defining the synchronization order of cloud products based on the topological dependency relationship of cloud products. It avoids the public cloud call frequency limitation by performing synchronization concurrency control according to the granularity of public cloud, cloud account, cloud product and region, and achieves efficient and highly reliable timed synchronization of cloud assets.
[0175] Example 5
[0176] like Figure 10 The diagram shown is a module schematic of a cloud asset synchronization system 60 according to the fifth embodiment of this application. In this embodiment, the cloud asset synchronization system 60 includes, in addition to the setting module 600, timing module 602, synchronization module 604, and comparison module 606 described in the fourth embodiment, a deletion module 608.
[0177] In addition to writing or updating the synchronization time, the comparison module 606 is also used to write or update the scan time.
[0178] The deletion module 608 is used to perform a secondary query on cloud assets in the database whose scan time has not been updated as unsynchronized cloud assets. If the public cloud interface returns that the asset does not exist, the unsynchronized cloud asset is deleted from the database.
[0179] In this embodiment, the scan time field is updated regardless of whether an asset is added, updated, or not updated due to identical asset information. Therefore, the scan time field can be used to determine whether the cloud assets in the database are synchronized. For unsynchronized cloud assets, a separate query is performed again through the public cloud interface. If the interface returns that the unsynchronized cloud asset does not exist, the related data for that unsynchronized cloud asset is deleted from the database. Otherwise, if the interface returns information about the unsynchronized cloud asset, the corresponding cloud asset information in the database is updated based on the interface's result.
[0180] The cloud asset synchronization system proposed in this embodiment addresses product dependency issues by defining the synchronization order of cloud products based on their topological dependencies. It avoids public cloud call frequency limitations through concurrency control based on public cloud, cloud account, cloud product, and region granularity. Furthermore, it resolves public cloud interface instability issues by performing secondary queries to confirm unsynchronized cloud assets. Therefore, through these synchronization order control, concurrency control, and secondary confirmation mechanisms, efficient and highly reliable timed synchronization of cloud assets is achieved.
[0181] Example 6
[0182] This application also provides another embodiment, namely, a computer-readable storage medium storing a cloud asset synchronization program, which can be executed by at least one processor to perform the steps of the cloud asset synchronization method as described above.
[0183] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0184] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0185] Obviously, those skilled in the art should understand that the modules or steps of the embodiments of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of this application are not limited to any particular combination of hardware and software.
[0186] The above are merely preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structural or procedural transformations made using the description and drawings of the present application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present application.
Claims
1. A method for synchronizing cloud assets, characterized in that, The method includes: Define the dependency topology between cloud products; Schedule a cloud asset synchronization task; In the synchronization task, assets are synchronized in parallel according to public cloud, cloud account, cloud product, and region. In the parallel synchronization of cloud products, the synchronization order is determined according to the dependency topology. Compare synchronized cloud assets with cloud assets in the database, and add or update cloud asset information in the database based on the comparison results; The dependency topology is defined based on the cloud products that each cloud product's attributes depend on; Specifically, the parallel asset synchronization in the synchronization task, based on public cloud, cloud account, cloud product, and region, includes: The public clouds are traversed, and the public clouds are synchronized in full parallel. For each of the public clouds, the cloud accounts are traversed, and the cloud accounts are synchronized in full parallel. For each cloud account, the cloud products are traversed, and the cloud products are synchronized in parallel according to the dependency topology. The synchronization order is to first synchronize the geographical regions.
2. The cloud asset synchronization method according to claim 1, characterized in that, Determining the synchronization order according to the dependency topology in the parallel synchronization of the cloud products includes: If the current cloud product depends on other cloud products, synchronization will begin after the dependent cloud products have been synchronized.
3. The cloud asset synchronization method according to claim 1, characterized in that, The comparison and synchronization of cloud assets with cloud assets in the database, and the addition or updating of cloud asset information in the database based on the comparison results, include: Query cloud asset information through public cloud interfaces; Iterate through the retrieved cloud asset information and check if there is any cloud asset information with the same identifier in the database; If no identical cloud asset information exists in the database, the current cloud asset information is added to the database, and the synchronization time is written.
4. The cloud asset synchronization method according to claim 3, characterized in that, The comparison and synchronization of cloud assets with cloud assets in the database, and the addition or updating of cloud asset information in the database based on the comparison results, also include: In the case where cloud asset information with the same identifier exists in the database, verify whether the current cloud asset information in the public cloud is consistent with the corresponding cloud asset information in the database; If there is a discrepancy, update the current cloud asset information in the database and update the synchronization time.
5. The cloud asset synchronization method according to any one of claims 1 to 4, characterized in that, The method further includes writing or updating the scan time when adding or updating cloud asset information in the database based on the comparison results, or when no update operation is performed because the cloud asset information is consistent. The scan time is the time for comparing the current cloud assets.
6. The cloud asset synchronization method according to claim 5, characterized in that, The method further includes: The cloud assets in the database whose scan time has not been updated are treated as unsynchronized cloud assets and queried a second time. If the public cloud interface returns that the asset does not exist, the unsynchronized cloud asset is deleted from the database.
7. The cloud asset synchronization method according to claim 6, characterized in that, The step of performing a secondary query on cloud assets in the database whose scan time has not been updated, treating them as unsynchronized cloud assets, and deleting the unsynchronized cloud assets from the database if the public cloud interface returns that the asset does not exist, includes: The database is queried for cloud asset information whose scan time exceeds a threshold, and these are identified as unsynchronized cloud assets. Traverse the unsynchronized cloud asset information and query through the public cloud interface whether there is cloud asset information with the same identifier; If no cloud asset information with the same identifier exists in the public cloud, delete the currently unsynchronized cloud asset information from the database.
8. A cloud asset synchronization system, characterized in that, The system includes: The configuration module is used to define the dependency topology between cloud products; The timed module is used to trigger cloud asset synchronization tasks at regular intervals; The synchronization module is used to perform parallel asset synchronization according to public cloud, cloud account, cloud product, and region in the synchronization task, wherein the synchronization order of the cloud products is determined according to the dependency topology relationship in the parallel synchronization. The comparison module is used to compare synchronized cloud assets with cloud assets in the database, and add or update cloud asset information in the database based on the comparison results. The dependency topology is defined based on the cloud products that each cloud product's attributes depend on; Specifically, the parallel asset synchronization in the synchronization task, based on public cloud, cloud account, cloud product, and region, includes: The public clouds are traversed, and the public clouds are synchronized in full parallel. For each of the public clouds, the cloud accounts are traversed, and the cloud accounts are synchronized in full parallel. For each cloud account, the cloud products are traversed, and the cloud products are synchronized in parallel according to the dependency topology. The synchronization order is to first synchronize the geographical regions.
9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a cloud asset synchronization program stored in the memory and executable on the processor, wherein the cloud asset synchronization program, when executed by the processor, implements the cloud asset synchronization method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a cloud asset synchronization program, which, when executed by a processor, implements the cloud asset synchronization method as described in any one of claims 1 to 7.
11. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Resource data reading method suitable for cloud computing system
CN113312164A