Resource processing method, system and device, storage medium and electronic equipment
By initially migrating effective resources to the second cloud account in the first cloud account, and automatically replenishing other effective resources during the resource use process, the problem of low cloud resource migration efficiency is solved, and an efficient and risk-free migration process is achieved.
Patent Information
- Application Number
- CN202411292135.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, cloud resource migration efficiency is low, and it is difficult to ensure that the impact on online services during the migration process is minimized.
By initially migrating valid resources to the second cloud account in the first cloud account, and automatically replenishing other effective resources during the resource use process, we ensure that the resources of the original account will not be missing, and the master-slave proxy modules are used to migrate. Achieve automation and efficient migration.
Improve the efficiency of cloud resource migration, avoid additional operations caused by the lack of effective resources, and ensure the risk-free and efficient migration process.
Smart Images

Figure CN119166353A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and more specifically, to a resource processing method, system, device, storage medium, and electronic device. Background Art
[0002] In related technologies, cloud resource migration is done manually, which is slow and inefficient. It is difficult to ensure the effectiveness of resources after migration and to ensure that online business is not affected during the migration process.
[0003] Therefore, there is a technical problem of low migration of cloud resources in the relevant technology. Summary of the invention
[0004] The embodiments of the present application provide a resource processing method, system, device, storage medium and electronic device to at least solve the technical problem of low migration of cloud resources in related technologies.
[0005] According to one aspect of an embodiment of the present application, a resource processing method is provided, including: in response to a first resource migration request, migrating a first resource from a first cloud account to a second cloud account; obtaining a first resource usage request, wherein the first resource usage request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account; in the absence of the second resource in the second cloud account, triggering a second resource usage request and a second resource migration request; in response to the second resource acquisition request, obtaining the second resource from the first cloud account and using it; in response to the second resource migration request, migrating the second resource from the first cloud account to the second cloud account.
[0006] According to another aspect of an embodiment of the present application, a resource processing device is also provided, including: a first migration unit, used to migrate a first resource from a first cloud account to a second cloud account in response to a first resource migration request; a first acquisition unit, used to acquire a first resource usage request, wherein the first resource usage request is used to request to acquire and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account; a triggering unit, used to trigger a second resource usage request and a second resource migration request when the second resource does not exist in the second cloud account; a second acquisition unit, used to acquire and use the second resource from the first cloud account in response to the second resource acquisition request; and a second migration unit, used to migrate the second resource from the first cloud account to the second cloud account in response to the second resource migration request.
[0007] As an optional solution, the device also includes: a first access module, which is used to access the second cloud account through the main agent module after obtaining the first resource use request, and verify whether the second resource exists in the second cloud account, wherein the main agent module has a first association relationship corresponding to the second cloud account; an acquisition module, which is used to obtain and use the second resource from the second cloud account in response to the first resource use request when the second resource exists in the second cloud account.
[0008] As an optional solution, the second acquisition unit includes: a second access module, used to access the first cloud account through a slave proxy module, obtain and use the second resource from the first cloud account, wherein the slave proxy module has a second association relationship corresponding to the first cloud account.
[0009] As an optional solution, the device also includes: a first determination module, used to determine that the valid resources in the first cloud account have completed migration to the second cloud account when the number of accesses to the first cloud account from the proxy module in a second time period after the first time period is less than a preset threshold, wherein the valid resources include the first resources and the second resources.
[0010] As an optional solution, the device also includes: a cleaning module, which is used to clean up all resources included in the first cloud account after determining that the valid resources in the first cloud account have completed migration to the second cloud account; and a correction module, which is used to correct the second association relationship corresponding to the first cloud account possessed by the slave proxy module to a third association relationship corresponding to the second cloud account possessed by the slave proxy module after determining that the valid resources in the first cloud account have completed migration to the second cloud account.
[0011] As an optional solution, the device also includes: a second determination module, used to determine a third resource with version information from all resources included in the first cloud account before migrating the first resource from the first cloud account to the second cloud account; a third determination module, used to determine the resource whose version information indicates the latest version in the third resource as the first resource before migrating the first resource from the first cloud account to the second cloud account.
[0012] According to another aspect of the embodiment of the present application, a resource processing system is provided, including a client module, a cloud resource proxy module, a cloud resource management module, and a cloud platform module. The cloud platform module stores at least the resources of the first cloud account and the resources of the second cloud account. The cloud resource proxy module includes a request manager, a master proxy module, and a slave proxy module. The cloud resource management module is used to filter out the first resource from the resources of the first cloud account and migrate the first resource to the second cloud account; the request manager is used to manage the received first resource usage request after the first resource is migrated, and when the first resource usage request is triggered for the first time, forward the first resource usage request to the master proxy module, and access the second cloud account through the master proxy module. A cloud account is provided to obtain a second resource, wherein the first resource use request is used to instruct the client module to request to obtain and use the second resource from the second cloud account, and the second resource is a resource included in the first cloud account; the request manager is also used to forward the re-triggered second resource use request to the slave agent module when the first resource use request fails and is re-triggered, access the first cloud account through the slave agent module, and obtain the second resource; the cloud resource management module is also used to migrate the second resource obtained by the slave agent module when the second resource request is triggered to the second cloud account; the cloud resource management module is also used to clean up resources for the first cloud account when there is no second resource use request within a preset time period.
[0013] According to another aspect of the embodiment of the present application, a computer program product is provided, the computer program product includes a computer program / instruction, the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the computer device executes the resource processing method as described above.
[0014] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the resource processing method through the computer program.
[0015] In this embodiment, the initial valid resources (valid resources that cannot be missing for the project that can be directly determined), that is, the first resources, in the first cloud account are first migrated to the second cloud account. Then, during the resource use process of the second cloud account, when a request to use the first resource is received, the second resource requested by the first resource use request is first attempted to be obtained and used from the second cloud account. If the second resource does not exist in the second cloud account, it means that the second resource is not the initial valid resource requested for migration in the first resource migration request. Then, the second resource is obtained, used, and supplemented and migrated to the second cloud account from the first cloud account. In this way, as the resources on the second account are used, other valid resources in the first cloud account can be gradually and automatically migrated to the second cloud account on the basis of the initial valid resources of the first cloud account. This ensures that the valid resources of the original account will not be missing, avoids additional operations caused by the missing of valid resources, and greatly improves the efficiency of cloud resource migration, thereby achieving the technical effect of improving the efficiency of cloud resource migration and solving the technical problem of low efficiency of cloud resource migration in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a schematic diagram of a process of an optional resource processing method according to an embodiment of the present application;
[0018] Figure 2 is a schematic diagram of an optional resource processing method according to an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of an optional resource processing method according to an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of an optional resource processing method according to an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of an optional resource processing device according to an embodiment of the present application;
[0022] Figure 6 A schematic structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Optionally, as an optional implementation, as Figure 1 As shown, the resource processing method includes the following specific steps:
[0026] S102, in response to the first resource migration request, migrate the first resource from the first cloud account to the second cloud account;
[0027] S104, obtaining a first resource use request, wherein the first resource use request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account;
[0028] S106, triggering a second resource use request and a second resource migration request when the second resource does not exist in the second cloud account;
[0029] S108, in response to the second resource acquisition request, acquiring and using the second resource from the first cloud account;
[0030] S110 , in response to the second resource migration request, migrate the second resource from the first cloud account to the second cloud account.
[0031] Optionally, in this embodiment, the resource processing method may be, but is not limited to, applied to cloud resource migration scenarios. Cloud resource migration scenarios may include, but are not limited to, migrating cloud resources from the current cloud platform / current cloud account to other cloud platforms / other cloud accounts to improve the availability of cloud resources; and may also include, but are not limited to, cleaning up cloud resources under the current cloud platform / current cloud account after the migration is completed to reduce usage costs.
[0032] In related technologies, cloud resource migration is usually performed manually by technical personnel. For example, to migrate from one cloud account on the same cloud platform to another cloud account, you can use the cross-account, cross-region semi-automatic migration method provided by some cloud platforms. For example, Alibaba Cloud can initiate a migration task to achieve RDS and OSS migration. For another example, to migrate from one public cloud platform to another public cloud platform, compared with the cross-account migration capability under the same platform, this method cannot directly use the migration capability provided by the original cloud platform, which will result in lower migration efficiency. Both of these situations cannot be achieved without manual implementation by technical personnel.
[0033] It should be noted that the unified prerequisite for cloud resource migration is that the migrating party (such as an enterprise or individual) needs to know the specific resources that need to be migrated, that is, to be able to determine which cloud resources can be migrated, which is itself a high-cost matter. The main purpose of migration in this case is to provide applications with higher infrastructure availability, or to use lower cloud resource unit prices to reduce the cost of using cloud resources, so the high cost and low efficiency of the migration process can be tolerated to a certain extent.
[0034] Another situation is to migrate and clean up cloud resources. Under the existing technology, manual migration is performed manually or by writing scripts. This migration method is a more labor-intensive method. If there are TB-level or even PB-level storage resources under a cloud account, how to identify which resources to migrate? How to ensure that the migration will not affect the existing business? How long is the migration cycle? These are major issues that need to be considered during the migration process, so in most cases it is difficult for enterprises to perform account-level migration. If a large number of resources need to be migrated, the only option is to rebuild the environment and perform the upgrade and migration manually and slowly.
[0035] With regard to the defects existing in the above cloud resource migration scenario, the resource processing method provided in this embodiment is used to first migrate the initial valid resources (valid resources that can be directly determined to be indispensable for the project), that is, the first resources, in the first cloud account to the second cloud account. Then, during the resource use process of the second cloud account, when a request to use the first resource is received, the second resource requested by the first resource use request is first attempted to be obtained and used from the second cloud account. If the second resource does not exist in the second cloud account, it means that the second resource is not the initial valid resource requested for migration in the first resource migration request. Then, the second resource is obtained from the first cloud account, used, and supplemented and migrated to the second cloud account. In this way, as the resources on the second account are used, other valid resources in the first cloud account can be gradually and automatically migrated to the second cloud account based on the initial valid resources of the first cloud account. This ensures that the valid resources of the original account will not be lost, avoids additional operations caused by the loss of valid resources, and greatly improves the efficiency of cloud resource migration.
[0036] Optionally, in this embodiment, all resources included in the first cloud account include valid resources and invalid resources, wherein the valid resources need to be migrated to the new second cloud account during the resource migration process, and the invalid resources do not need to be migrated.
[0037] Optionally, some of the valid resources can be determined by simple information verification. For example, based on version information, resources with the latest version information can be determined as valid resources. It should be noted that there are some resources in the valid resources that cannot or are not convenient to be directly determined by simple information verification. These resources need to be combined with actual use to determine whether they are valid resources.
[0038] Optionally, in this embodiment, the first resource may be, but is not limited to, the valid resource directly determined based on the version information.
[0039] It is understandable that, through the first resource migration request, the local resources (first resources) in the first cloud account are initially migrated to the second cloud account. During this migration process, it can be determined that the migrated first resources must be valid resources.
[0040] Optionally, in this embodiment, other valid resources in the first cloud account may be supplementarily migrated by, but not limited to, combining with the resource usage of the second cloud account.
[0041] Optionally, in this embodiment, the first resource usage request may be, but is not limited to, used to indicate a request to obtain and use a second resource from a second cloud account, wherein the second resource is a resource included in the original first cloud account.
[0042] Optionally, in this embodiment, when the second resource exists in the second cloud account, it means that the second resource belongs to the first resource and has been migrated from the first cloud account to the second cloud account, and is then obtained and used normally.
[0043] Optionally, in this embodiment, when the second resource does not exist in the second cloud account, it means that the second resource does not belong to the resources in the first resource, and as the resource requested by the first resource usage request, the second resource is equivalent to a valid resource in the first cloud account.
[0044] Further, a second resource use request is triggered to obtain and use the second resource from the first cloud account as a response to the first resource use request. A second resource migration request is triggered to supplement the migration of the second resource to the second cloud account as a migration supplement to the first resource migration request.
[0045] Optionally, in this embodiment, the second resource use request can be, but is not limited to, understood as a retry request of the first resource use request. It is understandable that after the first resource use request is triggered, an attempt is made to obtain the second resource in the second cloud account; if the second resource does not exist in the second cloud account, the first resource use request is retriggered, and the retriggered first resource use request is determined as the second resource use request.
[0046] Through the embodiments provided by the present application, the initial valid resources (valid resources that cannot be missing for the project that can be directly determined), that is, the first resources, in the first cloud account are first migrated to the second cloud account. Then, during the resource use process of the second cloud account, when a request to use the first resource is received, the second resource requested by the first resource use request is first attempted to be obtained and used from the second cloud account. If the second resource does not exist in the second cloud account, it means that the second resource is not the initial valid resource requested for migration in the first resource migration request, and then the second resource is obtained, used, and supplemented and migrated to the second cloud account from the first cloud account. In this way, as the resources on the second account are used, other valid resources in the first cloud account can be gradually and automatically migrated to the second cloud account on the basis of the initial valid resources of the first cloud account, which can ensure that the valid resources of the original account will not be missing, avoid additional operations caused by the missing of valid resources, greatly improve the efficiency of cloud resource migration, and thus achieve the technical effect of improving the efficiency of cloud resource migration.
[0047] As an optional solution, after obtaining the first resource use request, the method further includes:
[0048] Accessing the second cloud account through the main agent module to verify whether the second resource exists in the second cloud account, wherein the main agent module has a first association relationship corresponding to the second cloud account;
[0049] If the second resource exists in the second cloud account, in response to the first resource use request, obtain the second resource from the second cloud account and use it;
[0050] Obtaining the second resource from the first cloud account and using it includes:
[0051] The second resource is obtained from the first cloud account and used by accessing the first cloud account from the proxy module, wherein the slave proxy module has a second association relationship corresponding to the first cloud account.
[0052] Optionally, in this embodiment, the cloud resource agent module may include but is not limited to a request selector, a master agent module, and a slave agent module, wherein the cloud resource agent module connects the client module and the cloud platform module, and is used to receive resource usage requests triggered by the client module, request resources from the cloud account included in the cloud platform module, and return resources to the client module in response.
[0053] Optionally, in this embodiment, the request selector first receives the first resource usage request and verifies the first resource usage request, wherein, when the first resource usage request is triggered for the first time, the first resource usage request is forwarded to the main agent module, the second cloud account is accessed through the main agent module, and it is verified whether the second resource exists in the second cloud account.
[0054] Optionally, in this embodiment, if the second resource exists in the second cloud account, the second resource is acquired and used; if the second resource does not exist in the second cloud account, the first resource usage request is re-triggered, that is, the second resource usage request is triggered, and the second resource migration request is triggered.
[0055] Optionally, in this embodiment, when the result of the request selector verifying the first resource usage request indicates that the first resource usage request is triggered for the second time (equivalent to the second resource usage request), the request is forwarded to the slave agent module, and the first cloud account is accessed through the slave agent module to obtain and use the second resource, and migrate the second resource to the second cloud account.
[0056] It should be noted that the migration of the first resource and the second resource can be but is not limited to being implemented by the cloud resource management module, wherein the cloud resource management module can be but is not limited to being used for confirmation of the first resource (resource synchronization of the default latest version information), retry resource statistics from the proxy module, retry resource synchronization migration from the proxy module, and resource cleanup of old accounts.
[0057] To further illustrate, Figure 2As shown, cloud account A is the original cloud account before migration, including cloud resources a, cloud resources b, cloud resources c, and cloud resources d, and cloud account B is the new cloud account after migration, including cloud resources a and cloud resources b. It can be understood that after the first resource migration request, cloud resources a and cloud resources b (i.e., the first resources) in cloud account A have been migrated to cloud account B.
[0058] Further, the cloud resource proxy module obtains a resource acquisition request triggered by a client in the client module (assuming that it is used to request to obtain cloud resource c, not shown in the figure), and the request selector makes a judgment. In the case of the first trigger, it is forwarded to the main proxy module. The main proxy module requests to access cloud account B, but cloud resource c does not exist in cloud account B. Then the cloud resource acquisition process triggered for the first time fails (corresponding to Figure 2 failed link in the .
[0059] It should be noted that the main agent module has a first association relationship corresponding to the second cloud account, which is used to indicate that the primary domain name corresponding to the main agent module points to the migrated second cloud account.
[0060] Further, the resource acquisition request is re-triggered and forwarded to the slave proxy module after being judged by the request selector. The slave proxy module requests access to cloud account A, obtains cloud resource c from cloud account A, returns it for use, and notifies the cloud resource management module to migrate cloud resource c to cloud account B.
[0061] It should be noted that the slave proxy module has a second association relationship corresponding to the first cloud account, which is used to indicate that the slave domain name corresponding to the slave proxy module points to the first cloud account before migration.
[0062] It should be noted that after the first resource migration request is completed, if there is no need to access cloud account A from the proxy module for a period of time, it means that all valid resources in cloud account A (including the first resource and other resources added subsequently) have been migrated to cloud account B.
[0063] It is understandable that when the slave agent is triggered, the cloud resources accessed by the slave agent are migrated through the cloud resource management module. This process continues with the client's daily requests until the slave agent no longer retries to access resources, at which time the preferential migration of resources is completed.
[0064] Furthermore, the cloud resource management module is notified to clean up the resources of cloud account A, and only the useful cloud resources of the new account will be retained, thereby achieving the removal of abandoned resources.
[0065] Through the embodiments provided in the present application, on the basis of preliminary migration, through the combined use of the master agent module and the slave agent module, as the daily requests of the client continue, the migrated cloud resources can cover all valid resources that need to be migrated in the original cloud account, avoiding the omission of migration during the cloud resource migration process, thereby achieving the technical effect of improving the migration efficiency of cloud resources.
[0066] As an optional solution, the method further includes:
[0067] When the number of accesses to the first cloud account from the proxy module in a second time period after the first time period is less than a preset threshold, it is determined that valid resources in the first cloud account have completed migration to the second cloud account, wherein the valid resources include the first resources and the second resources.
[0068] Optionally, in this embodiment, the first time period may be but is not limited to a preset migration time period, the second time period may be but is not limited to a preset verification time period, and the second time period may be but is not limited to one-Nth of the first time period, where N is a positive integer greater than 1.
[0069] Optionally, in this embodiment, the preset threshold may be, but is not limited to, 1, and may also be, but is not limited to, other values.
[0070] It can be understood that after the first resource migration request is completed, if there is no need to access cloud account A from the proxy module for a period of time, it means that all valid resources in cloud account A (including the first resource and other resources added subsequently) have been migrated to cloud account B.
[0071] Through the embodiment provided by the present application, when the slave proxy is triggered, the cloud resources accessed by the slave proxy are migrated through the cloud resource management module. This process is carried out continuously with the daily requests of the client until the slave proxy no longer retries to access the resource, at which time the preferential migration of the resource is completed. During the whole process, the client does not care about which cloud account the resource is under, and has no perception, that is, no risk.
[0072] As an optional solution, after determining that the valid resources in the first cloud account have completed migration to the second cloud account, the method further includes:
[0073] Clean up all resources included in the First Cloud account;
[0074] The second association relationship corresponding to the first cloud account of the slave agent module is modified to a third association relationship corresponding to the second cloud account of the slave agent module.
[0075] Optionally, in this embodiment, after determining that valid resources in the first cloud account have completed migration to the second cloud account, the cloud resource management module is notified to clean up resources for the first cloud account, and ultimately only useful cloud resources of the second cloud account will be retained, thereby achieving the removal of discarded resources.
[0076] It should be noted that the second association relationship corresponding to the first cloud account of the slave agent module is corrected to a third association relationship corresponding to the second cloud account of the slave agent module, wherein the third association relationship corresponding to the second cloud account of the slave agent module is used to indicate that the slave domain name corresponding to the slave agent module points to the migrated second cloud account.
[0077] To further illustrate, a daily usage architecture after the effective resources in the first cloud account are migrated to the second cloud account, such as Figure 3 As shown, the cloud resource agent module includes a request selector, a master agent module, and a slave agent module. The cloud resource agent module connects the client module and the cloud platform module. The client module includes multiple clients. The cloud platform includes the migrated cloud account A. The cloud account includes cloud resources a, cloud resources b, cloud resources c, and cloud resources d.
[0078] Further, if Figure 3 As shown, the primary domain name corresponding to the primary proxy module and the secondary domain name corresponding to the secondary proxy module both point to the migrated cloud account A. It should be noted that Figure 3 The dotted line in the figure indicates a request or response failure link, and the solid line indicates a request or response success link.
[0079] Further, if Figure 3 As shown, in daily use, after the request selector receives the resource use request from the client, it is first forwarded to the main agent module, and the cloud account A is accessed through the main agent module to obtain and use resources. In this process, if the expected cloud resource information is accessed, the response and use are performed normally, and the process ends. If the main agent module has a network outage and determines that the response is abnormal (link failure), the resource use request is retriggered and forwarded by the request selector to the slave agent module, and the cloud account A is accessed through the slave agent module to obtain and use resources.
[0080] Through the embodiments provided by the present application, after the migration of cloud resources is completed, the slave domain name pointing to the slave proxy module is adjusted from the original account to the new account, which serves as an alternative channel of the main proxy module during the daily use of the new account, thereby improving the efficiency of cloud resource utilization.
[0081] As an optional solution, before migrating the first resource from the first cloud account to the second cloud account, the method further includes:
[0082] Determine a third resource having version information from all resources included in the first cloud account;
[0083] The resource whose version information indicates that it is the latest version in the third resource is determined as the first resource.
[0084] Optionally, in this embodiment, a third resource with version information is determined from all resources included in the first cloud account, and a resource with the latest version indicated in the third resource is determined as the first resource. Then, the first resource is migrated.
[0085] It is understandable that storage resources in cloud resources generally include two types, third resources with version information and fourth resources without version information. For third resources, resources whose version information indicates the latest version must be valid resources in the first cloud account, so these resources can be quickly migrated first.
[0086] It should be noted that for resources whose version information indicates that they are not the latest version, and for fourth resources that do not have version information, they may also be valid resources in the first cloud account. Therefore, these resources will be supplemented in subsequent resource usage requests from the client to the second cloud account (if the second cloud account does not include the corresponding resources).
[0087] To further illustrate, Figure 4 As shown, the cloud account A before migration includes cloud resources a of version v1, version v2, and version v3, cloud resources b of version v1 and version v2, and cloud resources c of version v1. It can be further determined that the latest versions of cloud resources are cloud resources a of version v3, cloud resources b of version v2, and cloud resources c of version v1. Cloud resources are migrated to obtain cloud account B after migration. Cloud account B includes cloud resources a of version v3, cloud resources b of version v2, and cloud resources c of version v1. The screening and migration of the above cloud resources are implemented by the cloud resource management module.
[0088] Through the embodiments provided in the present application, the purpose of quickly screening and determining the effective resources to be migrated from the old cloud account is achieved. After the process is completed, the new cloud account can have most of the effective cloud resources, and the cloud resources can be supplemented subsequently on this basis, quickly and efficiently, thereby achieving the effect of improving the migration efficiency of cloud resources.
[0089] As an optional solution, the present embodiment further provides a resource processing system, including a client module, a cloud resource proxy module, a cloud resource management module, and a cloud platform module. The cloud platform module stores at least the resources of the first cloud account and the resources of the second cloud account. The cloud resource proxy module includes a request manager, a master proxy module, and a slave proxy module. The cloud resource management module is used to filter out the first resource from the resources of the first cloud account and migrate the first resource to the second cloud account; the request manager is used to manage the received first resource usage request after the first resource is migrated, and when the first resource usage request is triggered for the first time, forward the first resource usage request to the master proxy module, and access the second cloud account through the master proxy module. A cloud account is provided to obtain a second resource, wherein the first resource use request is used to instruct the client module to request to obtain and use the second resource from the second cloud account, and the second resource is a resource included in the first cloud account; the request manager is also used to forward the re-triggered second resource use request to the slave agent module when the first resource use request fails and is re-triggered, access the first cloud account through the slave agent module, and obtain the second resource; the cloud resource management module is also used to migrate the second resource obtained by the slave agent module when the second resource request is triggered to the second cloud account; the cloud resource management module is also used to clean up resources for the first cloud account when there is no second resource use request within a preset time period.
[0090] Optionally, in this embodiment, the client module includes an application client, which is used to obtain data from the cloud platform module to perform application operations. For the client module, the cloud resources are no longer accessed directly, but the cloud resource proxy module is accessed.
[0091] Optionally, in this embodiment, the client module may, but is not limited to, initiate a request to the cloud resource proxy module, request the request selector of the cloud resource proxy module, and request the main proxy module for access by default for the first time.
[0092] It should be noted that if the main proxy module responds normally, the expected cloud resource information is obtained and returned to the client module, and the process is terminated. If the main proxy module responds abnormally, the proxy module is requested to obtain cloud resource information, and the process is terminated after it meets expectations.
[0093] Optionally, in this embodiment, the cloud resource proxy module is used to receive client module requests, access the cloud platform module, and respond to the client module.
[0094] Optionally, in this embodiment, the cloud resource agent module provides a request selector and a master-slave mode, i.e., a master node-slave node agent mode. The request selector needs to receive request information from the client module and forward the request to the cloud platform module through the master-slave mode to obtain cloud resource information, and finally respond to the client module.
[0095] Normally, the master node and slave node point to the same cloud account on the cloud platform. When cloud resources are migrated, the master node points to the new cloud account after migration, and the slave node points to the old cloud account.
[0096] The client initiates a request. If the resource required by the client does not exist under the new cloud account, the request selector will retry accessing the slave node. At this time, the client can get a normal response by accessing the old cloud account. The slave node proxy module records the cloud resource information accessed to the re-domain name and provides it to the cloud resource management module.
[0097] When the client stably requests the master proxy and the service is normal, the slave proxy in the proxy module will hardly receive any requests, and the migration is considered complete. Finally, both the master and slave proxies are pointed to the newly added account after the migration to provide daily services.
[0098] Optionally, in this embodiment, the cloud resource management module is used for cloud resource migration implementation.
[0099] At the beginning of cloud resource migration, it is in the screening and rapid migration stage. First, cloud resources with version information are screened, mainly for storage resources. The latest version of the same application resources are quickly copied to the new account through cross-account resource sharing.
[0100] After the screening and rapid migration phase is completed, point the main proxy module in the proxy module to the new account, and keep the slave proxy module unchanged.
[0101] When the proxy module triggers the slave proxy module, the cloud resources that the slave proxy module has retried to access will be migrated. This process continues until the slave proxy module no longer has to retry access to the resource, at which point the preferential migration of resources is completed.
[0102] Finally, the cloud resources of the old account are cleaned up to realize resource recycling, and only the useful cloud resources of the new account are retained, thereby realizing the removal of abandoned resources.
[0103] When resource migration is needed again, the cloud account specified by the master-slave mode of the rotating proxy module is used, that is, the master proxy module is pointed to the new cloud account, and the slave proxy module remains pointed to the current cloud account, and the next round of migration can be started.
[0104] Optionally, in this embodiment, the cloud platform module is used to provide access and operation capabilities for cloud resources. It should be noted that the request originally received from the client module is now received from the cloud resource proxy module, and no processing is required. Receiving a rapid migration request initiated by the cloud resource management module to achieve cross-account resource sharing is a capability that the cloud platform itself possesses.
[0105] The following is a summary of the beneficial effects that can be achieved by the embodiments of the present application:
[0106] (1) Effective migration with high precision. Existing migration methods basically use batch processing, which has low precision and is very likely to migrate resources that need to be recycled. However, in the embodiment of the present application, only useful cloud resources will be stored in the migrated cloud account, and discarded and expired resources will be cleaned up, achieving the purpose of completely recycling discarded resources.
[0107] (2) High-efficiency migration. The related technology requires technicians to manually organize the resources to be migrated. The workload is proportional to the size of the resources to be migrated, and the difficulty is extremely high. The embodiment of the present application can be fully automated, which is higher than the existing technology in terms of both operation time and operation quality.
[0108] (3) Risk-free migration. In the migration process of related technologies, it is easy to cause missed migrations, and the client cannot accept the loss of requested cloud resources, resulting in the client being unable to access the correct resources, which is a greater risk. However, the embodiment of the present application solves this problem through the master-slave mode and realizes migration without any risk.
[0109] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0110] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0111] According to another aspect of the embodiment of the present application, a resource processing device for implementing the above resource processing method is also provided. Figure 5 As shown, the device comprises:
[0112] A first migration unit 502 is configured to migrate a first resource from a first cloud account to a second cloud account in response to a first resource migration request;
[0113] A first acquisition unit 504 is used to acquire a first resource usage request, wherein the first resource usage request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account;
[0114] A triggering unit 506, configured to trigger a second resource use request and a second resource migration request when the second resource does not exist in the second cloud account;
[0115] The second acquisition unit 508 is used to obtain and use the second resource from the first cloud account in response to the second resource acquisition request;
[0116] The second migration unit 510 is configured to migrate the second resource from the first cloud account to the second cloud account in response to the second resource migration request.
[0117] As an optional solution, the device also includes:
[0118] A first access module is used to access the second cloud account through the main agent module after obtaining the first resource use request, and verify whether the second resource exists in the second cloud account, wherein the main agent module has a first association relationship corresponding to the second cloud account;
[0119] The acquisition module is used to, when the second resource exists in the second cloud account, respond to the first resource use request and obtain and use the second resource from the second cloud account.
[0120] As an optional solution, the second obtaining unit 508 includes:
[0121] The second access module is used to access the first cloud account through the slave proxy module, obtain the second resource from the first cloud account and use it, wherein the slave proxy module has a second association relationship corresponding to the first cloud account.
[0122] As an optional solution, the device also includes:
[0123] The first determination module is used to determine that valid resources in the first cloud account have completed migration to the second cloud account when the number of accesses to the first cloud account from the proxy module in a second time period after the first time period is less than a preset threshold, wherein the valid resources include the first resources and the second resources.
[0124] As an optional solution, the device also includes:
[0125] A cleanup module, configured to clean up all resources included in the first cloud account after determining that valid resources in the first cloud account have completed migration to the second cloud account;
[0126] The correction module is used to correct the second association relationship corresponding to the first cloud account of the slave agent module to a third association relationship corresponding to the second cloud account of the slave agent module after determining that the effective resources in the first cloud account have completed migration to the second cloud account.
[0127] As an optional solution, the device also includes:
[0128] A second determination module, configured to determine a third resource having version information from all resources included in the first cloud account before migrating the first resource from the first cloud account to the second cloud account;
[0129] The third determination module is used to determine, before migrating the first resource from the first cloud account to the second cloud account, a resource in the third resource whose version information indicates the latest version as the first resource.
[0130] According to another aspect of the embodiment of the present application, an electronic device for implementing the above resource processing method is also provided, further as follows Figure 6 As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0131] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, in response to a first resource migration request, migrating a first resource from a first cloud account to a second cloud account;
[0134] S2, obtaining a first resource usage request, wherein the first resource usage request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account;
[0135] S3, triggering a second resource use request and a second resource migration request when the second resource does not exist in the second cloud account;
[0136] S4, in response to the second resource acquisition request, acquiring the second resource from the first cloud account and using it;
[0137] S5. In response to the second resource migration request, migrate the second resource from the first cloud account to the second cloud account.
[0138] Alternatively, a person skilled in the art may understand that: Figure 6 The structure shown is for illustration only. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations are shown.
[0139] Among them, the memory 602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the resource processing method and device in the embodiment of the present application. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, realizing the above-mentioned resource processing method. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely located relative to the processor 604, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 can be specifically, but not limited to, used to store information such as first resources and second resources. As an example, such as Figure 6 As shown, the memory 602 may include, but is not limited to, the first migration unit 502, the first acquisition unit 504, the trigger unit 506, the second acquisition unit 508, and the second migration unit 510 in the resource processing device. In addition, other module units in the resource processing device may also be included but are not limited to, which will not be repeated in this example.
[0140] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0141] In addition, the electronic device further includes: a display 608 for displaying information such as the first resource and the second resource; and a connection bus 610 for connecting various module components in the electronic device.
[0142] In other embodiments, the client or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. A peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, a client, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0143] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0144] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0145] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0146] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory and the random access memory are connected to each other through a bus. The input / output interface (I nput / output interface, i.e., I / O interface) is also connected to the bus.
[0147] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a local area network card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that a computer program read therefrom is installed into the storage part as needed.
[0148] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.
[0149] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.
[0150] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0151] S1, in response to a first resource migration request, migrating a first resource from a first cloud account to a second cloud account;
[0152] S2, obtaining a first resource usage request, wherein the first resource usage request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account;
[0153] S3, triggering a second resource use request and a second resource migration request when the second resource does not exist in the second cloud account;
[0154] S4, in response to the second resource acquisition request, acquiring the second resource from the first cloud account and using it;
[0155] S5. In response to the second resource migration request, migrate the second resource from the first cloud account to the second cloud account.
[0156] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0157] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0158] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0159] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0160] In the several embodiments provided in the present application, it should be understood that the recorded client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0161] The units described as separate components may or may not be physically separated, and the components shown 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 solution of this embodiment.
[0162] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0163] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A resource processing method, characterized in that: include: In response to the first resource migration request, migrate the first resource from the first cloud account to the second cloud account; Obtaining a first resource usage request, wherein the first resource usage request is used to request obtaining and using a second resource from the second cloud account, and the second resource is a resource in the first cloud account; If the second resource does not exist in the second cloud account, triggering a second resource usage request and a second resource migration request; In response to the second resource acquisition request, acquiring the second resource from the first cloud account and using it; In response to the second resource migration request, the second resource is migrated from the first cloud account to the second cloud account.
2. The method according to claim 1, characterized in that After obtaining the first resource usage request, the method further includes: Accessing the second cloud account through a master agent module to verify whether the second resource exists in the second cloud account, wherein the master agent module has a first association relationship corresponding to the second cloud account; In a case where the second resource exists in the second cloud account, in response to the first resource use request, the second resource is obtained from the second cloud account and used.
3. The method according to claim 1, characterized in that The obtaining and using the second resource from the first cloud account includes: The second resource is obtained from the first cloud account and used by accessing the first cloud account from a proxy module, wherein the slave proxy module has a second association relationship corresponding to the first cloud account.
4. The method according to claim 3, characterized in that The method further comprises: When the number of accesses to the first cloud account by the slave agent module in a second time period after the first time period is less than a preset threshold, it is determined that valid resources in the first cloud account have completed migration to the second cloud account, wherein the valid resources include the first resources and the second resources.
5. The method according to claim 4, characterized in that After determining that the valid resources in the first cloud account have completed migration to the second cloud account, the method further includes: Cleaning up all resources included in the first cloud account; The second association relationship of the slave agent module corresponding to the first cloud account is modified to the third association relationship of the slave agent module corresponding to the second cloud account.
6. The method according to any one of claims 1 to 5, characterized in that: Before migrating the first resource from the first cloud account to the second cloud account, the method further includes: Determine a third resource having version information from all resources included in the first cloud account; The resource indicated by the version information as the latest version in the third resource is determined as the first resource.
7. A resource processing system, comprising a client module, a cloud resource proxy module, a cloud resource management module, and a cloud platform module, characterized in that: The cloud platform module at least stores resources of the first cloud account and resources of the second cloud account, and the cloud resource agent module includes a request manager, a master agent module and a slave agent module. The cloud resource management module is used to filter out a first resource from the resources of the first cloud account and migrate the first resource to the second cloud account; The request manager is used to manage the received first resource use request after the first resource is migrated, and when the first resource use request is triggered for the first time, forward the first resource use request to the main agent module, and access the second cloud account through the main agent module to obtain the second resource, wherein the first resource use request is used to instruct the client module to request to obtain and use the second resource from the second cloud account, and the second resource is a resource included in the first cloud account; The request manager is further configured to forward the retriggered second resource usage request to the slave proxy module when the first resource usage request fails in the first request and is retriggered, access the first cloud account through the slave proxy module, and obtain the second resource; The cloud resource management module is further used to migrate the second resource obtained by the slave agent module when the second resource request is triggered to the second cloud account; The cloud resource management module is further configured to clean up resources of the first cloud account when there is no second resource usage request within a preset time period.
8. A resource processing device, characterized in that: include: A first migration unit, configured to migrate a first resource from a first cloud account to a second cloud account in response to a first resource migration request; A first acquisition unit is used to acquire a first resource usage request, wherein the first resource usage request is used to request to obtain and use a second resource from a second cloud account, and the second resource is a resource in the first cloud account; A triggering unit, configured to trigger a second resource use request and a second resource migration request when the second resource does not exist in the second cloud account; A second acquisition unit, configured to, in response to the second resource acquisition request, acquire and use the second resource from the first cloud account; The second migration unit is configured to migrate the second resource from the first cloud account to the second cloud account in response to the second resource migration request.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed by an electronic device.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
