Business migration method and device, readable storage medium and computer program product
By obtaining multi-dimensional resource data and using prediction models to formulate resource allocation plans, the interruption problem caused by dynamic fluctuations and sudden demand during the migration process is solved, and the coordinated optimization and stability of resources are achieved.
Patent Information
- Application Number
- CN202510597301.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-19
AI Technical Summary
When the target enterprise's traditional business is migrated to the cloud platform, the existing technology fails to respond to dynamic fluctuations and real-time burst demands in real time, resulting in interruptions during the migration process.
Obtain multi-dimensional resource data of the initial node and destination node, including computing resources, storage resources and network resources, predict resource requirements based on the prediction model, and formulate resource allocation plans to minimize delay, cost and energy consumption during the migration process. Through the linkage optimization of multi-dimensional resources, respond to dynamic requirements in real time.
It realizes real-time prediction of resource requirements during the migration process, reduces business interruption time, improves resource utilization, ensures the stability and continuity of migration, and balances costs, performance and energy consumption.
Smart Images

Figure CN120512470A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a service migration method and device, a readable storage medium, and a computer program product. Background Art
[0002] In response to the urgent need of target enterprises to migrate traditional businesses to cloud platform nodes, a migration method based on resource balance has been proposed. Specifically, it first detects the load of each node and calculates the resource utilization balance to determine the initial node to which the container needs to be migrated; then, it establishes a container migration model based on the resource balance and determines the destination node to which the container will be migrated; finally, it executes the container migration until resource balance is achieved.
[0003] However, this solution only considers a single dimension of the container, namely resource balance, and cannot respond in real time when there are dynamic fluctuations and real-time sudden demands on the business, resulting in interruptions during the migration process. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a service migration method and apparatus, a readable storage medium, and a computer program product to solve the interruption problem that may exist in service migration.
[0005] In order to solve the above technical problems, this specification is implemented as follows: In a first aspect, a service migration method is provided, comprising: Obtain multi-dimensional resource data of an initial node and a destination node, where the initial node is the node where the service to be migrated is located, and the destination node is the node to which the service to be migrated is migrated. The resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources; Predicting resource requirements of the service to be migrated during migration from the initial node to the destination node based on multi-dimensional resource data and a prediction model; Formulate a resource allocation plan for the migration process of the service to be migrated based on an objective function and the resource requirements, wherein the objective function is to minimize a combination of latency, cost, and energy consumption generated during the migration process as an optimization goal; The service to be migrated is migrated according to the resource allocation plan.
[0006] In a second aspect, a service migration device is provided, including: An acquisition module is configured to acquire multi-dimensional resource data of an initial node and a destination node, where the initial node is the node where the service to be migrated is located, and the destination node is the node to which the service to be migrated is migrated. The resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources. A prediction module, configured to predict resource requirements of the service to be migrated during the migration process from the initial node to the destination node based on multi-dimensional resource data and a prediction model; a formulation module, configured to formulate a resource allocation plan during the migration of the service to be migrated based on an objective function and the resource requirements, wherein the objective function is to minimize a combination of latency, cost, and energy consumption generated during the migration process as an optimization goal; A migration module is used to migrate the service to be migrated according to the resource allocation plan.
[0007] In a third aspect, a service migration device is provided, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0008] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] In a fifth aspect, a computer program product is provided, comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute the steps of the method described in the first aspect.
[0010] In an embodiment of the present application, by obtaining multi-dimensional resource data of an initial node and a destination node, the initial node is the node where the business to be migrated is located, and the destination node is the node to which the business to be migrated is migrated, and the resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources; based on the multi-dimensional resource data and the prediction model, the resource requirements of the business to be migrated during the migration from the initial node to the destination node are predicted; based on the objective function and the resource requirements, a resource allocation plan for the migration of the business to be migrated is formulated, and the objective function takes minimizing the combination of delay, cost, and energy consumption generated during the migration process as the optimization goal; the business to be migrated is migrated according to the resource allocation plan, thereby integrating computing resources, storage resources, and network resources in real time, comprehensively optimizing multi-dimensional resources, overcoming the limitations of single-dimensional resource allocation optimization, improving resource synergy, predicting future resource requirements in real time during the migration process and formulating a resource allocation plan, accurately predicting and responding to dynamic business needs in a timely manner, effectively improving overall resource utilization, achieving a balance between cost, performance, and energy consumption, and significantly reducing business interruption time, and improving the stability and continuity of business migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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: Figure 1 It is a flowchart of the business migration method of an embodiment of the present application.
[0012] Figure 2 It is a flowchart of the prediction module of the business migration method of an embodiment of the present application.
[0013] Figure 3 It is a schematic diagram of the short-term prediction process of the service migration method according to an embodiment of the present application.
[0014] Figure 4 It is a schematic diagram of the long-term prediction process of the service migration method of an embodiment of the present application.
[0015] Figure 5 It is a schematic diagram of the resource allocation plan formulation process of the business migration method in an embodiment of the present application.
[0016] Figure 6 This is one of the migration process diagrams of the business migration method in an embodiment of the present application.
[0017] Figure 7 This is the second migration process diagram of the business migration method of an embodiment of the present application.
[0018] Figure 8 It is a structural block diagram of the service migration device of an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are 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 making creative work are within the scope of protection of this application. The figure numbers in this application are only used to distinguish the various steps in the scheme and are not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.
[0020] In order to solve the problems existing in the prior art, the embodiment of the present application provides a service migration method, such as Figure 1 As shown, the process includes the following steps 102 to 108.
[0021] Step 102: Obtain multi-dimensional resource data of the initial node and the destination node. The initial node is the node where the service to be migrated is located, and the destination node is the node to which the service to be migrated is migrated. The resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources.
[0022] In this embodiment, the application scenario is migrating services from the initial node where the services are being migrated to the destination node, for example, migrating the target enterprise's services to a cloud platform. Before the services are migrated, multi-dimensional resource data for each node is first obtained and encrypted using the SSL / TLS protocol to ensure data security. This provides the basic data for resource allocation required for the subsequent service migration.
[0023] Based on the solution provided in the above embodiment, optionally, in the above step 102, multi-dimensional resource data of the initial node and the destination node are obtained, including: collecting resource data from the physical layer, virtualization layer and business layer corresponding to the initial node and the destination node respectively; preprocessing the collected resource data to obtain the timestamp, resource type and value corresponding to each resource data; and obtaining multi-dimensional resource data of the corresponding time series of the initial node and the destination node by integrating the preprocessed resource data.
[0024] This step is the resource intelligent perception stage: it is used to establish multi-perspective monitoring of the business layer, virtualization layer and / or physical layer involved in the initial node and the destination node, and complete the integration of multi-dimensional resource data based on the time, progress and status characteristics of the business migration task.
[0025] Multi-dimensional resource data is automatically collected by each node. Data types include computing resources, storage resources, and network resources. Specifically, it includes: business operation indicators in the virtual environment (such as CPU resource utilization, memory usage, disk I / O, etc.), performance data of physical machines / virtual machines / containers (such as CPU, memory, disk, network bandwidth, etc.), network topology, resource quotas, traffic, load, energy consumption, etc. The collected multi-dimensional resource data stream is standardized and preprocessed to form a real-time database.
[0026] During the dimensional resource data acquisition process in step 102, to ensure comprehensive resource monitoring and data reliability, a cross-layer (physical layer, virtualization layer, business layer) real-time data collection and integration mechanism must be established. For different resource types and data sources, the following technical requirements must be met: (1) Resource monitoring at the physical layer must cover core indicators such as the number of CPU cores, memory usage, disk input / output operations (IOPS), and network bandwidth utilization of each node. In one embodiment, the OpenPower platform's application programming interface (API) can be used to collect raw data in real time, for example, once per second, and an encrypted transmission protocol can be used to ensure data security. If the target physical node where the business to be migrated is detected to be offline or has data anomalies (e.g., CPU utilization > 100%), an alarm is automatically triggered and the backup node is switched to ensure monitoring continuity.
[0027] (2) Resource monitoring at the virtualization layer requires collecting data such as resource quotas, CPU usage, memory usage, network traffic, and storage volume status for virtual machines (VMs) and containers. Based on the Kubernetes monitoring component (Prometheus), data is pulled in real time through the Exporter plug-in. If the virtualization platform is Docker Swarm or OpenStack, its native monitoring interface (such as the Nova API) must be adapted. At the same time, the VM / container ID must be bound to the physical node to establish a cross-layer resource mapping relationship. For example, the CPU utilization data of the container and the host machine can be associated through labels to form a global resource view.
[0028] (3) Resource monitoring at the business layer must cover application performance indicators such as business service response latency, SLA compliance rate, transaction throughput, and error rate. Probes are injected into an application performance monitoring (APM) system (such as SkyWalking or Datadog) to collect business runtime data in real time. To protect user privacy, sensitive business data (such as user IDs) must be desensitized, retaining only hash values. Business indicators are then associated with underlying resource data (such as CPU utilization) to generate end-to-end performance analysis reports.
[0029] (4) Data preprocessing and persistence operations are required during the data integration and storage phase. During preprocessing, for example, the 3σ principle (three times the standard deviation) is used to filter invalid data (such as negative memory usage), and multi-source data is normalized using methods such as the Z-score method to eliminate dimensional differences. The processed data is stored in a time series database (InfluxDB), with fields including the timestamp, resource type, node ID, and value corresponding to each resource data. Furthermore, historical resource data can be compressed and stored in a distributed file system (such as HDFS), and a retention period can be set to support on-demand retrospective analysis.
[0030] Those skilled in the art should understand that the above-mentioned data collection tools and hierarchical divisions of the embodiments of the present application are merely examples, and other feasible monitoring technologies, such as eBPF real-time kernel tracing, FPGA hardware probes, etc., may be applicable to the embodiments of the present application and are also included in the scope of protection of the present application.
[0031] Step 104 : Based on the multi-dimensional resource data and the prediction model, predict the resource demand of the service to be migrated during the migration process from the initial node to the destination node.
[0032] This step is the dynamic prediction stage. It is necessary to predict the dynamic fluctuations and / or real-time sudden demands of the business in advance based on the multi-dimensional resource data obtained in step 102 and the pre-trained prediction model, and predict the future resources required during the migration process of the business to be migrated in advance, so as to make appropriate subsequent resource allocation and avoid interruption of the migration process during dynamic fluctuations and / or real-time sudden demands.
[0033] Based on the solution provided by the above embodiment, optionally, in the above step 104, the prediction model includes a short-term prediction model and a long-term prediction model, and predicts the resource demand of the to-be-migrated business during the migration process from the initial node to the destination node based on the multi-dimensional resource data and the prediction model, including: sliding the multi-dimensional resource data collected within the first preset time period before the start of the migration process in a preset time window, and inputting the multi-dimensional resource data into the short-term prediction model in sequence to output a short-term prediction result, the short-term prediction result including the resource type required at the corresponding time point of each sliding preset time window after the start of the migration process and the corresponding resource demand fluctuation range, wherein the short-term prediction model uses historical multi-dimensional resource data as samples and the resource type required by the historical multi-dimensional resource data after the first preset time period. The type and the corresponding resource demand fluctuation range are obtained by label training; the resource indicators of the target type in the multi-dimensional resource data collected within the second preset time period before the start of the migration process are obtained, and input into the long-term prediction model to output the long-term prediction results, the long-term prediction results including the resource demand average value and resource demand burst buffer value of the resource indicators of the target type after the start of the migration process, wherein the long-term prediction model is obtained by label training with the resource indicators of the target type in the historical multi-dimensional resource data as samples and the resource demand average value and resource demand burst buffer value of the resource indicators of the target type after the second preset time period; based on the short-term prediction results and the long-term prediction results, the resource demand of the to-be-migrated business in the process of migrating from the initial node to the destination node is predicted.
[0034] like Figure 2As shown, this step combines traditional time series analysis methods with deep learning network models to establish a dynamic forecasting model (step 202). This generates a resource demand curve based on time series data to guide the subsequent resource allocation plan. The dynamic forecasting process relies on the real-time and historical data integrated in the intelligent resource perception phase of step 102 to construct short-term and long-term forecasting models, respectively. The goal of the forecasting model is to predict the baseline (average resource demand), fluctuations, and emergencies of future resource demand to guide dynamic resource allocation. The short-term forecasting model is used to predict resource requirements in the short term, such as 1-6 hours ahead. The long-term forecasting model is used to predict resource requirements in the longer term, such as 12-72 hours ahead.
[0035] The prediction model is divided into two directions: "short-term fluctuation prediction" (step 204) and "long-term trend prediction" (step 206), which are used to capture fluctuations in the short term and long-term development trends respectively. In the embodiment of the present application, these two prediction methods can be modeled and calculated based on time series analysis (step 208) and "Long Short-Term Memory (LSTM) network" (step 210), respectively. The corresponding short-term prediction results are used to predict the resource type required at the corresponding time point in the future and the corresponding resource demand fluctuation range (step 212), and the corresponding long-term prediction results are used to predict the resource demand average value and resource demand burst buffer value of different types of resource indicators at the corresponding time point in the future (step 214), so as to achieve more accurate resource scheduling and optimization.
[0036] It should be pointed out here that "resource type" refers to the broad categories of computing resources, storage resources, and network resources, and "resource indicators" refer to specific parameters in different resource types, such as CPU utilization, bandwidth utilization, etc.
[0037] Short-term forecasting needs to target the rapid fluctuation characteristics of resource load and generate forecast results at the minute level, for example. Figure 3 As shown, the short-term prediction process of the service migration method in the embodiment of the present application includes: Step 302, data input: historical resource data collected within a preset period of time, for example, 72 hours before the start of the migration process is obtained from the time series database obtained in step 102, covering core indicators such as CPU, memory, network bandwidth, and storage.
[0038] Step 304, data cleaning: After data extraction, outliers (such as negative memory usage or CPU utilization > 100%) can be further eliminated through a data preprocessing module.
[0039] Step 306: discretize the time series and perform sliding extraction using a preset time window, such as a 5-minute window.
[0040] Step 308, normalization processing: using linear interpolation to fill in missing data points to form a continuous time series curve.
[0041] Step 310, dynamic prediction; Step 312 : Predict the resource demand fluctuation range in the future scheduled time, for example, 6 hours later, based on the ARIMA model (Autoregressive Integrated Moving Average model).
[0042] Step 314, confidence interval calculation: The ARIMA model parameters are optimized using a grid search method, and the confidence interval consisting of the maximum resource demand and the minimum resource demand is finally output.
[0043] Step 316: Output the corresponding data of the prediction result.
[0044] In step 318, the prediction results can be saved in JSON format, with fields including the timestamp of the prediction time point, resource type, and predicted fluctuation range, and transmitted to the subsequent decision module for formulating the resource allocation plan during the migration process.
[0045] In this way, based on the historical resource data extracted within a predetermined time period, the resource types required at the corresponding time point after the migration process begins and the corresponding resource demand fluctuation range can be predicted every few minutes. In this way, real-time short-term forecasting of resource demand can be achieved at the minute level.
[0046] Long-term forecasting requires combining deep learning methods to capture the long-term trend and sudden characteristics of resource demand and generate hourly forecast results. Specifically, Figure 4 As shown, taking the prediction based on LSTM network in deep learning as an example, the long-term prediction process of the service migration method of the embodiment of the present application includes: The standardized time series data is converted into sequence data with a time step of, for example, 24 hours as input (step 402). For example, if the input dimension is [number of samples, 24, 5], it means obtaining five types of resource indicators within every 24 hours in the historical multi-dimensional resource data.
[0047] A long-term prediction model is constructed based on an LSTM network (step 404). The LSTM network structure, for example, includes two stacked layers of LSTM units 40 (128 neurons per layer), memory cells comprising input gate 42, forget gate 44, and output gate 46, and a fully connected layer 48. After updating the memory cells (step 404), outputting the hidden state (step 406), and passing through the fully connected layer 48, the long-term prediction value is output (step 408). During training, the mean squared error (MSE) is used as the loss function for loss calculation (step 410), which is then fed back to the LSTM unit 40 through backpropagation optimization (step 412).
[0048] The loss function formula is: (1) in, represents the true value, represents the predicted value, is the length of the time series (total migration time); t is the time step.
[0049] The optimizer can use the Adam algorithm, with a learning rate of, for example, 0.001, and iterate until convergence. The final output is a baseline demand curve reflecting long-term trends (i.e., the average resource demand) and a burst buffer reflecting residual fluctuations. These two are combined to generate the final comprehensive resource demand forecast.
[0050] Step 106 : formulating a resource allocation plan for the migration process of the service to be migrated based on the objective function and the resource demand, wherein the objective function takes minimizing the combination of delay, cost and energy consumption generated during the migration process as an optimization goal.
[0051] This step is the optimization decision-making phase. Based on the evolutionary algorithm framework and the characteristics of the migration task, it dynamically adjusts the multi-objective optimization strategy and weights to select the resource allocation solution that achieves the optimal result. The multi-objective optimization strategy aims to minimize the combination of latency, cost, and energy consumption during the migration process.
[0052] The optimization decision-making process must generate a resource scheduling / allocation plan that takes into account multiple constraints, such as latency, cost, and energy consumption, based on the dynamic prediction results of step 104. During the service migration process, the objective function determines the resource requirements and optimization problems based on the characteristics of the service migration task, and performs multi-objective optimization.
[0053] Based on the solution provided by the above embodiment, optionally, in the above step 106, based on the objective function and the resource demand, a resource allocation scheme for the migration process of the business to be migrated is formulated, including: taking the resources of the corresponding type of resource indicators allocated to the business to be migrated and the values of the resources as variables, determining the objective function corresponding to the combination of delay, cost and energy consumption generated during the migration process; performing optimal solution on the objective function to obtain a candidate resource allocation scheme including the resource indicator type and the corresponding resource value corresponding to the optimal solution; screening out a first candidate resource allocation scheme from the candidate resource allocation schemes based on the long-term prediction results in the resource demand; screening out a second candidate resource allocation scheme from the first candidate resource allocation scheme based on the short-term prediction results in the resource demand; formulating a resource allocation scheme for the migration process of the business to be migrated based on the Pareto optimal solution in the second candidate resource allocation scheme, wherein the Pareto optimal solution is to minimize the objective function on the basis of ensuring that the corresponding constraints are met at different stages of the migration process. Combined with Figure 5First, the resource indicator type parameters are initialized. Using the resource indicator types and corresponding resources in different resource allocation schemes as variables, the cost function, energy consumption function, and latency function generated by the migrated services are established (step 502). By combining the cost function, energy consumption function, and latency function, the objective function for multi-objective optimization is constructed (step 504).
[0054] In one embodiment, the objective function is defined as follows:
[0055] Where F represents the objective function, represents the delay weight, represents the cost weight, represents the energy consumption weight, Indicates delay, Indicates cost, Indicates energy consumption, .
[0056] , represents the delay constraint; L , represents the cost constraint; W , represents the energy consumption constraint; another constraint is , α, β, and γ are normalized weights between 0 and 1.
[0057] The migration process can be divided into multiple stages. The constraints of D, L, W, and F vary in different migration stages, which will be described in detail below.
[0058] The cost function, energy consumption function, and delay function are weighted accordingly (step 506 ), with a larger weight indicating a higher importance. The objective function is optimally solved to generate candidate solutions (step 508 ).
[0059] Based on the optimal solution, multiple candidate resource allocation schemes that meet the optimization objectives can be preliminarily obtained. On the basis of these candidate resource allocation schemes, the prediction results obtained by the long-term prediction model and the short-term prediction model are further combined for screening.
[0060] The long-term forecast reflects both the long-term trend and sudden characteristics of resource demand. By comparing it with candidate resource allocation plans, a first candidate resource allocation plan that meets the long-term forecast can be selected. Then, based on the fluctuation range of resource demand in the short-term forecast, a second candidate resource allocation plan is selected from the first candidate resource allocation plan. A Pareto optimal solution is then selected from the second candidate resource allocation plan (step 510). This Pareto optimal solution ensures that the corresponding constraints are met at different stages of the migration process and that the value of the objective function is minimized. Based on the Pareto optimal solution in the second candidate resource allocation plan, an optimization decision is formulated and output, namely the final resource allocation plan for the business to be migrated (step 512).
[0061] Furthermore, you can select a final solution from the set of Pareto optimal solutions based on resource urgency (such as a resource gap > 20% during peak hours) and business priority, and output the selection results in a JSON file.
[0062] Optionally, based on the short-term prediction results in the resource requirements, a second candidate resource allocation scheme is screened out from the first candidate resource allocation scheme, including: based on the short-term prediction results corresponding to the target time point in the resource requirements, a third candidate resource allocation scheme corresponding to the target time point is screened out from the first candidate resource allocation scheme; simulating the delay, cost and energy consumption generated in the migration process after allocating resources at the target time point according to the third candidate resource allocation scheme; crossover and / or mutation of the third candidate resource allocation scheme through a genetic algorithm to obtain a fourth candidate resource allocation scheme; simulating the delay, cost and energy consumption generated in the migration process after allocating resources at the target time point according to the fourth candidate resource allocation scheme; and determining the Pareto optimal solution corresponding to the target time point by comparing the delay, cost and energy consumption generated by the third candidate resource allocation scheme and the fourth candidate resource allocation scheme respectively during the migration process.
[0063] Specifically, based on the predicted time point and resource demand fluctuation range corresponding to the short-term forecast results, a set of resource allocation solutions that meet the requirements is screened from the candidate resource allocation solutions generated by the objective function. Resource allocation and simulation calculations are then performed on this selected set of resource allocation solutions using constraints to determine the latency, cost, and energy consumption incurred during the migration process. Simultaneously, a genetic algorithm is used to perform crossover and mutation on this selected set of resource allocation solutions to generate a new set of resource allocation solutions. Resource allocation and simulation calculations are then performed on this new set of resource allocation solutions using constraints to determine the latency, cost, and energy consumption incurred during the migration process. The resource allocation solutions obtained from the two methods are compared, and the Pareto optimal solution is selected based on the comparison results.
[0064] Optionally, the migration process includes multiple consecutive stages, and the multiple consecutive stages include a startup stage corresponding to the first time period, a peak stage corresponding to the second time period, and a closing stage corresponding to the third time period. The delay weight, cost weight, and energy consumption weight are dynamically adjusted in different stages; wherein, in the startup stage, the Pareto optimal solution is to minimize the cost and energy consumption on the basis of ensuring that the delay does not exceed the delay constraint; in the peak stage, the Pareto optimal solution is to minimize the delay and energy consumption on the basis of ensuring that the cost does not exceed the cost constraint; in the closing stage, the Pareto optimal solution is to minimize the delay and cost on the basis of ensuring that the energy consumption does not exceed the energy consumption constraint.
[0065] Through the multi-objective optimization mechanism with the above-mentioned dynamic weight adjustment function, the weight distribution between objectives such as cost, latency, and energy consumption can be flexibly adjusted according to real-time business needs and scenario characteristics, achieving flexibility in optimization objectives and improving the practicality and economy of resource allocation solutions.
[0066] In an embodiment of the present application, the weights corresponding to cost, latency, and energy consumption in the objective function can be dynamically adjusted according to the migration stage. Table 1 below gives an example of migration weight configuration.
[0067] Table 1
[0068] It should be noted that Table 1 is only an example, and the weight configuration involved in different business migrations can be dynamically adjusted based on the specific scenarios of the actual migration process.
[0069] Step 108: Migrate the service to be migrated according to the resource allocation plan.
[0070] Based on the solution provided in the above embodiment, optionally, in the above step 108, migrating the business to be migrated according to the resource allocation scheme includes: determining the level of the business to be migrated, the level including critical business, general business, and idle business; if the level corresponds to critical business, continuously migrating the business to be migrated based on a preset time level; if the level corresponds to general business, gradually adjusting the resource size in the resource allocation scheme according to the migration progress, and migrating the business to be migrated based on the adjusted resource allocation scheme; if the level corresponds to idle business, detecting the utilization rate of the target resources in the resource allocation scheme during the migration process, and reclaiming the target resources when the utilization rate is less than a preset threshold.
[0071] This step corresponds to the elastic execution phase: by employing hierarchical migration technology, services are migrated accordingly based on the resource allocation plan's decision-making. Regarding dynamic resource provisioning, resources such as CPU, storage, and bandwidth can be provisioned on demand. Multi-dimensional resource data is monitored in real time to predict resource demand. Resource allocation plans are then formulated based on optimization goals, and resource quotas are intelligently adjusted. Furthermore, regarding dynamic resource recycling, an automatic recycling mechanism is supported, enabling virtual machine recycling, CPU throttling, hard drive hibernation, and network shutdown.
[0072] To achieve a second-level response, on-demand supply, and excess recovery execution strategy, migration tasks are divided into three categories: critical business, general business, and idle business.
[0073] like Figure 6 As shown, hierarchical migration control may be performed for the optimization decision solution (step 602 ).
[0074] (1) Migration of key services must ensure millisecond-level non-interruption switching to achieve hot migration (step 604). For services with high real-time requirements (such as financial trading systems), memory pre-copy technology is used to transfer memory dirty pages (Dirty Pages) to the destination node in batches through incremental synchronization. The single synchronization time is ≤10ms, and the final switch is triggered when the remaining dirty page amount is lower than the threshold (such as 1MB). For example, the migration interruption time of hot migration must be ≤50ms. At the same time, in order to reserve network bandwidth, a dedicated channel (bandwidth ≥1Gbps) must be dynamically allocated through the SDN controller before migration, and a priority queue (QoS) must be set to avoid traffic congestion.
[0075] (2) General business migration needs to balance efficiency and stability to achieve gradual migration (step 606). A dynamic resource quota adjustment strategy is adopted to increase or decrease resource quotas in batches according to the migration progress (such as adjusting 0.1 CPU cores or 10MB of memory each time). The single adjustment interval is ≤30 seconds, and the resource utilization fluctuation is controlled within 5%. For example, at the beginning of the virtual machine migration, the CPU capacity is expanded to 8 cores according to the predicted demand, and then gradually reduced to 4 cores after the migration is completed to avoid resource waste. During the migration process, the service response delay is monitored in real time (threshold ≤100ms) to dynamically adjust the resource quota to ensure performance.
[0076] (3) Idle task recycling requires the rapid release of redundant resources to achieve automatic resource recycling (step 608). For example, when the CPU utilization is detected to be less than 5% for 10 minutes, the recycling process is automatically triggered. For example, the virtual machine is shut down and a snapshot backup is generated (stored in the distributed file system Ceph), releasing CPU / memory resources to the resource pool; cross-node merging of distributed storage volumes (such as NFS shared storage) is performed to reduce fragmentation; unused virtual switch ports are shut down to release redundant bandwidth. The recycling operation response time is ≤ 5 seconds, and resource utilization is improved by ≥ 15%.
[0077] Then, the migrated data is integrated across layers (step 610 ) and collected by, for example, an OpenPower platform (step 612 ) to obtain a real-time database (step 614 ).
[0078] On this basis, it should be noted that the resource dynamic adjustment strategy needs to adapt to the needs of different scenarios, such as Figure 7 As shown, resource gap detection is performed (step 702), which is specifically divided into three categories: Rapid adjustment (step 704): For sudden resource gaps (e.g., CPU utilization > 90%), reserved resources such as CPU / memory, elastic cloud disks, and pre-configured virtual machines are allocated within seconds through an on-demand provisioning mechanism (step 706).
[0079] Gradual adjustment (step 708): Expand / contract capacity in stages according to resource scarcity, and adjust resource quotas in batches (step 710). For example, adjust the CPU from 2 cores to 4 cores in 10 batches, with an interval of 1 minute each time, to avoid service jitter.
[0080] Pre-adjustment (step 712): Before the migration task is started, a certain proportion of resources (such as CPU, memory) is pre-occupied according to the predicted demand (step 714).
[0081] Resource recycling triggering (step 716): After the migration task is completed, the resource is released through the automatic recycling strategy to reduce the risk of resource contention.
[0082] The above-mentioned hierarchical migration control strategies for different business types enable refined control of the migration process, ensuring timely response and continuity of key businesses, significantly shortening business migration interruption time, reducing the negative impact of migration on system stability, and implementing refined migration execution strategies.
[0083] Real-time feedback is provided on further execution results during the business migration process. For example, resource allocation records, deallocation status, and abnormal events (such as a 50% sudden increase in network latency) are written to a time series database, triggering a new round of multi-dimensional resource data collection during the perception phase. For example, if insufficient bandwidth is detected during the migration, the system is immediately rolled back to the previous stable state, and an alarm log is generated for manual intervention. This feedback mechanism ensures a closed-loop "perception-prediction-decision-execution" process from steps 102 to 108, continuously optimizing resource scheduling efficiency.
[0084] In an embodiment of the present application, by obtaining multi-dimensional resource data of an initial node and a destination node, the initial node is the node where the business to be migrated is located, and the destination node is the node to which the business to be migrated is migrated, and the resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources; based on the multi-dimensional resource data and the prediction model, the resource requirements of the business to be migrated during the migration from the initial node to the destination node are predicted; based on the objective function and the resource requirements, a resource allocation plan for the migration of the business to be migrated is formulated, and the objective function takes minimizing the combination of delay, cost, and energy consumption generated during the migration process as the optimization goal; the business to be migrated is migrated according to the resource allocation plan, thereby integrating computing resources, storage resources, and network resources in real time, comprehensively optimizing multi-dimensional resources, overcoming the limitations of single-dimensional resource allocation optimization, improving resource synergy, predicting future resource requirements in real time during the migration process and formulating a resource allocation plan, accurately predicting and responding to dynamic business needs in a timely manner, effectively improving overall resource utilization, achieving a balance between cost, performance, and energy consumption, and significantly reducing business interruption time, and improving the stability and continuity of business migration.
[0085] Optionally, an embodiment of the present application further provides a service migration device, including: An acquisition module is configured to acquire multi-dimensional resource data of an initial node and a destination node, where the initial node is the node where the service to be migrated is located, and the destination node is the node to which the service to be migrated is migrated. The resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources. A prediction module, configured to predict resource requirements of the service to be migrated during the migration process from the initial node to the destination node based on multi-dimensional resource data and a prediction model; a formulation module, configured to formulate a resource allocation plan during the migration of the service to be migrated based on an objective function and the resource requirements, wherein the objective function is to minimize a combination of latency, cost, and energy consumption generated during the migration process as an optimization goal; A migration module is used to migrate the service to be migrated according to the resource allocation plan.
[0086] It is understandable that the service migration device provided in the embodiments of this specification can achieve Figures 1 to 7 To avoid repetition, the various processes implemented in the method embodiment will not be described again here.
[0087] Alternatively, as Figure 8As shown, an embodiment of the present application also provides a business migration device 2000, including a processor 2400 and a memory 2200, and the memory 2200 stores a program or instruction that can be run on the processor 2400. When the program or instruction is executed by the processor 2400, the various steps of the above-mentioned business migration method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0088] The present application also provides a readable storage medium having a program or instruction stored thereon. When the program or instruction is executed by a processor, the various processes of any of the above-mentioned service migration method embodiments are implemented, and the same technical effects are achieved. To avoid repetition, the details are not described here. The readable storage medium includes a computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0089] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. The computer program can be operated to enable a computer to implement the various processes of any of the above-mentioned business migration method embodiments when executed, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0090] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.
[0092] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A service migration method, characterized in that: include: Obtain multi-dimensional resource data of an initial node and a destination node, where the initial node is the node where the service to be migrated is located, and the destination node is the node to which the service to be migrated is migrated. The resource types of the multi-dimensional resource data include computing resources, storage resources, and network resources; Predicting resource requirements of the service to be migrated during migration from the initial node to the destination node based on multi-dimensional resource data and a prediction model; Formulate a resource allocation plan for the migration process of the service to be migrated based on an objective function and the resource requirements, wherein the objective function is to minimize a combination of latency, cost, and energy consumption generated during the migration process as an optimization goal; The service to be migrated is migrated according to the resource allocation plan.
2. The method according to claim 1, characterized in that Obtain multi-dimensional resource data of the initial node and the destination node, including: Collect resource data from the physical layer, virtualization layer, and business layer corresponding to the initial node and the destination node respectively; Preprocess the collected resource data to obtain the timestamp, resource type and value corresponding to each resource data; By integrating the pre-processed resource data, multi-dimensional resource data corresponding to the time series of the initial node and the destination node are obtained.
3. The method according to claim 1, characterized in that The prediction model includes a short-term prediction model and a long-term prediction model. Predicting resource requirements of the service to be migrated during migration from the initial node to the destination node based on the multi-dimensional resource data and the prediction model includes: Multi-dimensional resource data collected within a first preset time period before the start of the migration process is obtained by sliding a preset time window, and the data is sequentially input into the short-term prediction model to output a short-term prediction result, wherein the short-term prediction result includes the resource type required at the corresponding time point of each sliding preset time window after the start of the migration process and the corresponding resource demand fluctuation range, wherein the short-term prediction model is trained using historical multi-dimensional resource data as samples and the resource type required by the historical multi-dimensional resource data after the first preset time period and the corresponding resource demand fluctuation range as labels; Obtain resource indicators of the target type in the multi-dimensional resource data collected within a second preset time period before the start of the migration process, and input them into the long-term prediction model to output a long-term prediction result, wherein the long-term prediction result includes the average resource demand value and the resource demand burst buffer value of the resource indicators of the target type after the start of the migration process, wherein the long-term prediction model is trained using the resource indicators of the target type in the historical multi-dimensional resource data as samples and the average resource demand value and the resource demand burst buffer value of the resource indicators of the target type after the second preset time period as labels; Based on the short-term prediction result and the long-term prediction result, resource requirements of the service to be migrated during the migration process from the initial node to the destination node are predicted.
4. The method according to claim 3, characterized in that Formulate a resource allocation plan for the migration of the service to be migrated based on the objective function and the resource requirements, including: Determine an objective function corresponding to a combination of latency, cost, and energy consumption generated during the migration process, using resources of corresponding resource indicators of the type allocated to the service to be migrated and resource values as variables; Optimally solving the objective function to obtain a candidate resource allocation solution corresponding to the optimal solution, including resource indicator types and corresponding resource values; Selecting a first candidate resource allocation scheme from the candidate resource allocation schemes according to a long-term prediction result of the resource demand; Selecting a second candidate resource allocation scheme from the first candidate resource allocation schemes based on a short-term prediction result of the resource demand; Based on the Pareto optimal solution in the second candidate resource allocation scheme, a resource allocation scheme for the migration process of the business to be migrated is formulated. The Pareto optimal solution is to minimize the objective function on the basis of ensuring that the corresponding constraints are met at different stages of the migration process.
5. The method according to claim 4, characterized in that Selecting a second candidate resource allocation scheme from the first candidate resource allocation schemes based on a short-term prediction result of the resource demand includes: Based on the short-term prediction result corresponding to the target time point in the resource demand, screening out a third candidate resource allocation scheme corresponding to the target time point from the first candidate resource allocation schemes; Simulating the delay, cost, and energy consumption generated during the migration process after allocating resources at the target time point according to the third candidate resource allocation scheme; Performing crossover and / or mutation on the third candidate resource allocation scheme by a genetic algorithm to obtain a fourth candidate resource allocation scheme; Simulating the delay, cost, and energy consumption generated during the migration process after allocating resources at the target time point according to the fourth candidate resource allocation scheme; The Pareto optimal solution corresponding to the target time point is determined by comparing the delay, cost, and energy consumption generated by the third candidate resource allocation scheme and the fourth candidate resource allocation scheme during the migration process.
6. The method according to claim 4, characterized in that The objective function is defined as follows: Where F represents the objective function, represents the delay weight, represents the cost weight, represents the energy consumption weight, Indicates delay, Indicates cost, Indicates energy consumption, ; The migration process includes multiple consecutive stages, including a startup stage corresponding to the first time period, a peak stage corresponding to the second time period, and a closing stage corresponding to the third time period. The latency weight, cost weight, and energy consumption weight are dynamically adjusted in different stages. Among them, in the startup phase, the Pareto optimal solution is to minimize the cost and energy consumption on the basis of ensuring that the delay does not exceed the delay constraint; in the peak phase, the Pareto optimal solution is to minimize the delay and energy consumption on the basis of ensuring that the cost does not exceed the cost constraint; in the closing phase, the Pareto optimal solution is to minimize the delay and cost on the basis of ensuring that the energy consumption does not exceed the energy consumption constraint.
7. The method according to claim 1, characterized in that Migrating the to-be-migrated service according to the resource allocation plan includes: Determine the importance level of the services to be migrated, where the importance levels include critical services, general services, and idle services; If the level corresponds to a critical business, the business to be migrated is continuously migrated based on a preset time scale; If the level corresponds to a general service, gradually adjusting the resource size in the resource allocation plan according to the migration progress, and migrating the service to be migrated based on the adjusted resource allocation plan; If the level corresponds to an idle service, the utilization rate of the target resource in the resource allocation scheme is detected during the migration process, and the target resource is reclaimed when the utilization rate is less than a preset threshold.
8. A service migration device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Job migration method and device, storage medium and program product
CN120780484A
Job migration method, device, storage medium, and program product
CN120780484B
Dynamic hotspot data migration method of distributed cache system
CN121070273A
A dynamic hot data migration method of a distributed cache system
CN121070273B