Application switching method, device, equipment, storage medium and computer program product
By detecting service levels and data consistency, combined with traffic segmentation and data synchronization mechanisms, it solves the equivalence and smoothness issues of cross-architecture switching of cloud native applications in a cloud multi-core environment, and realizes automatic scheduling of cloud native applications. and migration, ensuring service quality and functional consistency.
Patent Information
- Application Number
- CN202410649874.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Existing cloud native technology cannot achieve cross-architecture computing power equivalence and smooth switching of business applications in a cloud multi-core heterogeneous environment. Especially in the scenario of microservice containerization, it cannot guarantee the consistency and consistency of application service quality. Functional consistency.
By detecting the service level and data consistency of the target application, the target switching node and number of copies are determined based on the node resource information obtained in advance, and the traffic segmentation strategy and data synchronization mechanism are adopted to ensure the computing power balance and service of the application when switching across nodes. Consistent quality and consistent functionality.
It realizes the automatic scheduling and migration of cloud-native applications in a single-cloud multi-core scenario, ensuring equivalence and smoothness in the application switching process, and ensuring the service quality and functional consistency of applications across different architectures.
Smart Images

Figure CN118245196B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an application switching method, device, equipment, storage medium and computer program product. Background Art
[0002] my country's cloud computing software and hardware industry chain is booming, and the diversification and informatization of application scenarios are particularly prominent. Customers have adopted a one-cloud, multiple-core strategy to complement each other's strengths and weaknesses, and hope that their businesses can achieve the same service quality between different infrastructures, multiple heterogeneous processor architectures of the same type, that is, equivalent and smooth switching.
[0003] Among the related technologies, the current research direction of most manufacturers is the mixed deployment of "multi-cores", based on the scheduling strategy of node selection and multi-architecture image manifest, to achieve automatic scheduling and cross-architecture migration of applications based on image architecture, but there is still a large gap from the equivalent operation and smooth switching of cross-architectures centered on applications. With the development of cloud native technology, more and more businesses are gradually transforming to microservices and containers, but the preferred solution for microservice containerization, Kubernetes+docker technology, is insufficient in the heterogeneous and complex environment of one cloud and multiple cores, and cannot achieve cross-architecture computing power equivalence and smooth switching of business applications. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an application switching method, device, equipment, storage medium and computer program product. The specific technical solutions are as follows:
[0005] In a first aspect of the present invention, a method for application switching is provided, the method comprising:
[0006] In the case of detecting an application switching request initiated when the target application switches across nodes, determining the first target switching node according to the pre-acquired node resource information, and determining the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, distributing the traffic of the application copies of the target application of the stateless workload according to the traffic splitting strategy to obtain the traffic ratio corresponding to the application copies; and, performing data replication and synchronization on the application copies of the target application of the stateful workload between different nodes;
[0007] When it is detected that the service level data before and after the target application switch is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application switch is consistent, the target application is in a cross-node switching completion state.
[0008] Optionally, before the step of detecting that the service level data before and after the target application is switched are consistent, the service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the method includes:
[0009] Monitor the target application according to a preset monitoring component to obtain monitoring data;
[0010] Determine whether the service level data corresponding to the target application before and after the switching is consistent according to the monitoring data.
[0011] Optionally, determining whether the service level data corresponding to the target application before and after the switching is consistent according to the monitoring data includes:
[0012] If not, the target number of replicas corresponding to the target application and the first target switching node are modified according to the monitoring data until the service level data corresponding to the target application before and after the switching are consistent.
[0013] Optionally, the modifying the target number of replicas and the first target switching node corresponding to the target application according to the monitoring data includes:
[0014] Acquire, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched;
[0015] If the difference is greater than the first threshold, the target number of replicas is adjusted according to a preset step size, or the second target switching node is determined according to a mapping matrix between the specification computing power and the switching node.
[0016] Optionally, acquiring, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched comprises:
[0017] Normalization is performed based on the throughput value, delay value and number of errors corresponding to the initial node before the target application is switched, and the throughput value, delay value and number of errors corresponding to the first target switching node after the target application is switched, and the difference is obtained by combining the weight values corresponding to the throughput value, delay value and number of errors.
[0018] Optionally, the mapping matrix between the specification computing power and the switching node is a computing power distribution matrix table based on the CPU model, and the computing power distribution matrix table is used to record the mapping matrix between the CPU model and the specification computing power under different nodes.
[0019] Optionally, before the step of detecting that the service level data before and after the target application is switched are consistent, the service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the method includes:
[0020] It is determined according to the second preset monitoring component whether all service requests corresponding to the initial node corresponding to the target application are processed.
[0021] Optionally, after the step of determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component, the method includes:
[0022] If not, the traffic segmentation strategy is optimized according to the information on the service request recorded by the preset log system.
[0023] Optionally, after the step of determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component, the method includes:
[0024] If so, the traffic ratio corresponding to the application copy is used as the traffic ratio corresponding to the cross-node switching of the target application.
[0025] Optionally, before the step of detecting that the service level data before and after the target application is switched are consistent, the service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the method includes:
[0026] Verify through a preset database query statement whether the data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent.
[0027] Optionally, after the step of verifying, by using a preset database query statement, whether data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent, the method includes:
[0028] If not, data replication and synchronization are performed again on the application copy of the target application of the stateful workload between different nodes until the application copy data corresponding to the target application before and after the switching are consistent.
[0029] Optionally, determining the first target switching node according to the pre-acquired node resource information, and determining the target number of replicas corresponding to the target application after switching according to the specification computing power corresponding to the first target switching node includes:
[0030] Determining a first target switching node according to pre-acquired node resource information;
[0031] Obtaining a first specification computing power corresponding to the first target switching node and an initial specification computing power corresponding to the initial node;
[0032] The target number of copies of the target application corresponding to the first target switching node is generated according to the first specification computing power, the initial specification computing power and the initial number of copies.
[0033] Optionally, the acquiring the first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node includes:
[0034] Obtaining the integer computing capability and the floating-point computing capability corresponding to the first target switching node and the initial node respectively according to the benchmark test tool evaluation;
[0035] The first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node are quantified according to the shaping computing power and the floating-point computing power.
[0036] Optionally, performing traffic distribution on the application replica of the target application of the stateless workload according to the traffic segmentation strategy to obtain the traffic ratio corresponding to the application replica includes:
[0037] According to a preset traffic drainage mechanism, a preset traffic preheating mechanism, a readiness probe, and an element and configuration retry mechanism, traffic is distributed to the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies.
[0038] Optionally, the distributing traffic to the application replica of the target application of the stateless workload according to a preset traffic drainage mechanism, a preset traffic preheating mechanism, a readiness probe, and an element and configuration retry mechanism to obtain a traffic ratio corresponding to the application replica includes:
[0039] The application copies of the target application of the stateless workload are distributed with traffic in the order of a preset traffic preheating mechanism, a readiness probe, a preset traffic drainage mechanism, and a configured retry mechanism to obtain a traffic ratio corresponding to the application copy.
[0040] Optionally, performing data replication and synchronization on the application replica of the target application of the stateful workload between different nodes includes:
[0041] The replica data of the application replica of the target application of the stateful workload at the initial node is synchronously copied to the first target switching node according to a preset distributed consistency algorithm.
[0042] In a second aspect of the present invention, there is also provided an application switching device, the device comprising:
[0043] A static switching module is used to determine the first target switching node according to the pre-acquired node resource information when an application switching request is detected when the target application switches across nodes, and determine the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, according to the traffic splitting strategy, distribute the traffic of the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies; and, replicate and synchronize the data of the application copies of the target application of the stateful workload between different nodes;
[0044] The dynamic optimization switching module is used to detect that the service level data corresponding to the target application before and after the switching is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, and the target application is in a cross-node switching completion state.
[0045] In a third aspect of the implementation of the present invention, there is also provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;
[0046] The processor is used to read the program in the memory to implement the application switching method as described in any one of the first aspects.
[0047] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer implements the application switching method as described in any one of the first aspects.
[0048] In a fourth aspect of the implementation of the present invention, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the application switching method as described in any one of the first aspects.
[0049] The application switching method provided by the embodiment of the present invention, when an application switching request is detected when the target application is switched across nodes, determines the first target switching node according to the pre-acquired node resource information, and determines the number of target copies corresponding to the target application after the switching according to the specification computing power corresponding to the first target switching node; and, according to the traffic segmentation strategy, distributes the traffic of the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies; and, performs data replication and synchronization on the application copies of the target application of the stateful workload between different nodes; when it is detected that the service level data before and after the target application is switched are consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the target application is in a cross-node switching completion state. In the embodiments of the present invention, by considering the environment in which the application runs, balanced scheduling based on specification computing power can ensure the consistency of computing power before and after the application switch; by on-demand traffic segmentation based on the gateway or load balancer for the service traffic of stateless applications, the consistency of service quality before and after the application switch can be ensured; by data synchronization for stateful applications, based on efficient negotiation and data synchronization mechanisms, the consistency of functions before and after the application switch can be ensured, and by real-time perception of business computing power indicators and continuous adjustment and optimization of the equivalent effect of consistent service quality before and after the application cross-architecture switching, an observation-based compensation feedback design is formed. The embodiments of the present invention can not only realize the automatic scheduling and migration of cloud-native applications in the one-cloud-multi-core scenario, but also ensure the equivalence and smoothness of this process. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0051] Figure 1 The steps of the application switching method provided by the embodiment of the present invention are as follows: Figure 1 ;
[0052] Figure 2 The following is a flow chart of the application switching method provided by the embodiment of the present invention: Figure 2 ;
[0053] Figure 3 is a structural schematic diagram of an application switching device provided by an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of a communication device provided by an embodiment of the present invention;
[0055] Figure 5 It is a schematic diagram of a replica termination process provided by an embodiment of the present invention;
[0056] Figure 6 is an overall schematic diagram of an application switching method provided by an embodiment of the present invention;
[0057] Figure 7 is a schematic diagram of an application switching system architecture provided by an embodiment of the present invention;
[0058] Figure 8 The present invention provides a flowchart of an application switching method. DETAILED DESCRIPTION
[0059] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0060] Reference Figure 1 , showing the steps of the application switching method provided by the embodiment of the present invention Figure 1 , the method may include:
[0061] Step 101, when an application switching request is detected when a target application switches across nodes, a first target switching node is determined according to pre-acquired node resource information, and the number of target replicas corresponding to the target application after switching is determined according to the specification computing power corresponding to the first target switching node; and, according to the traffic splitting strategy, traffic is distributed to the application replicas of the target application of the stateless workload to obtain the traffic ratio corresponding to the application replicas; and, data replication and synchronization are performed between different nodes for the application replicas of the target application of the stateful workload;
[0062] It should be noted that the overall architecture diagram of this application is referenced Figure 7 As shown, it can be seen that this application is based on Operator and service governance technology, and realizes automatic scheduling and migration of cloud native applications in the one-cloud-multiple-core scenario through three major parts: node scheduling, traffic segmentation, and data synchronization, and can ensure the equivalence and smoothness of this process. Figure 7 Pod is the smallest scheduling unit in Kubernetes. A Pod encapsulates a container (or multiple containers). The containers in the Pod share the same storage.
[0063] Storage, network, etc. In other words, the entire pod can be regarded as a virtual machine, and each container is equivalent to a process running in the virtual machine. All containers in the same pod are arranged and scheduled uniformly. Kubernetes, also known as k8s, is an open source container orchestration platform.
[0064] It should be noted that, in the embodiment of the present application, in order to achieve smooth switching of the target application across heterogeneous nodes, refer to Figure 6 In the static stage, when an application switching request is initiated, it is necessary to calculate the number of replicas that maintain equivalent computing power when the target application is switched based on the current specifications and computing power of different nodes, determine the traffic segmentation strategy based on the performance differences of different processor architectures, and ensure the consistency of state synchronization when the application is stateful, so as to achieve ready-to-use and quick response to application switching requests, which can be achieved through three aspects.
[0065] Considering the environment in which the application runs, balanced scheduling based on specification computing power is the key to ensuring computing power consistency before and after application switching.
[0066] Therefore, the method of determining the first target switching node according to the pre-acquired node resource information, and determining the target number of copies corresponding to the target application after switching according to the specification computing power corresponding to the first target switching node includes: determining the first target switching node according to the pre-acquired node resource information; obtaining the first specification computing power corresponding to the first target switching node, and the initial specification computing power corresponding to the initial node; generating the target number of copies corresponding to the target application at the first target switching node according to the first specification computing power, the initial specification computing power and the initial number of copies.
[0067] Furthermore, the obtaining of the first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node includes: obtaining the integer computing power and the floating-point computing power corresponding to the first target switching node and the initial node respectively according to the benchmark tool evaluation; quantifying the first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node according to the integer computing power and the floating-point computing power.
[0068] Specifically, the calculation of the computing power specification is based on the SPEC CPU benchmark tool to evaluate the integer and floating-point computing power of the node CPU, perform geometric averaging on all computing power, and then quantify the computing power of heterogeneous CPUs. The calculation formula based on SPEC CPU computing power is as follows:
[0069]
[0070] (Formula 1)
[0071] Among them, in the above formula 1, is the integer multi-task throughput base value, is the floating-point multi-tasking throughput base value, Calculate the speed base value for an integer single task, Calculate the speed base value for a single floating-point task. A0 + A1 = 100, which is expressed as the ratio of integer and floating-point types (A0, A1). The default value is A0 = 50. B0 + B1 = 100, which is expressed as the ratio of computing type and IO type (B0, B1). The default value is B0 = 50. There are two evaluation methods for spec2017 testing, speed and rate. Speed is used to test the time required to complete a task, and rate is used to test how many tasks can be completed per unit time. Speed and rate tests include integer (int) and floating-point tests, and base value (Base) and peak value (Peak) tests. The meanings of the indicators in formula 1 are shown in Table 1.
[0072] Table 1 Meaning of indicators in an exemplary specification computing power calculation formula
[0073]
[0074] The number of application copies is calculated based on the results of the specification computing power measurement when the application is switched, specifically calculating the number of application copies for scheduling and node selection. The node gives priority to targets with sufficient resources, and the calculation formula for the target number of copies is designed as:
[0075] (Formula 2)
[0076] In the above formula 2, ceil is a rounding up function.
[0077] It should be noted that in the embodiment of the present application, before determining the first target switching node, the specification computing power of all available nodes in the cluster has been obtained by default, because when the switch occurs, the specification computing power of the target node needs to be known first in order to calculate the number of replicas.
[0078] However, in dynamic adjustment, the target node can be reselected. When the first target switching node fails, or a new more suitable node appears, dynamic fine-tuning is allowed.
[0079] Therefore, in the embodiment of the present application, it is necessary to obtain the specification computing power of all available nodes in the cluster. Specifically, the cluster status can be rotated through the resident program according to the life cycle of the node. When it is found that the node is added first, the specification computing power calculation job is triggered, and the specification computing power mapping table (key-value of node and specification computing power) is updated. When the node is deleted, it can trigger the specification computing power mapping table to be updated again, and then determine
[0080] New target switch node.
[0081] Second, for the service traffic of stateless applications, on-demand traffic segmentation based on gateways or load balancers is the key to ensuring consistent service quality before and after application switching;
[0082] Therefore, according to the preset traffic drainage mechanism, the preset traffic preheating mechanism, the readiness probe, and the element and configuration retry mechanism, the application copies of the target application of the stateless workload are traffic-distributed to obtain the traffic ratio corresponding to the application copies.
[0083] Specifically, during the cross-architecture switching process, the application Pod instance of the original architecture is terminated, and a new application Pod instance is created at the destination architecture node. During this process, it is necessary to ensure that user requests are received and processed normally, so that the cross-architecture switching does not affect the application service level SLA. After analyzing the process and key path of cross-architecture switching, this application proposes a smooth switching method based on traffic segmentation, which includes the following four strategies:
[0084] The first one is to preset a traffic drainage mechanism. In order to achieve the purpose of smoothly ending the service, it is necessary to realize the elegant exit of the application. The essence of elegance is to slow down the process of original service termination and traffic switching, so as not to interrupt the user's service requests. This application combines the traffic drainage (Taffic Drain) mechanism with the Pod termination process to achieve the effect of elegant exit of the application. Traffic drainage means that when performing a grayscale upgrade of the service, while gradually directing the traffic to the new service node, the old service node is gradually removed from the load balancer traffic pool after waiting for the old service node to process the received requests, so as to avoid service unavailability and slow response during the service change process, which brings the user the experience of unavailable service. The key issue that needs to be considered in this process is how to judge whether the old service node has processed the existing requests.
[0085] Reference Figure 5 As shown, Figure 5In order to achieve the effect of traffic drainage by configuring the stop hook (preStopHook) for the container in the termination process of the application Pod. First, the running Pod receives the deletion command from the APIServer, and the Pod enters the termination process. Here, the delay exit time is set, that is, the stop time (preStop time), which indicates the waiting time before the Pod is deleted; secondly, as the preStop time expires or the Hook function is executed, Kubelet sends a program end signal (SIGTERM) to the container, and the container continues to complete all requests being processed, including responding to requests that arrive after the Pod receives the deletion command; finally, Kubernetes sends a forced process termination signal (SIGKILL) to force the container to terminate. It should be noted that if all requests in the received queue are not completed within the preStop time, the requests that have been received but not processed normally may be lost.
[0086] From the above Pod termination process, it can be seen that the preStop time set during the traffic drainage process is crucial, and the default value is 30s. On the other hand, it is also possible to use monitoring methods to determine whether the old service node has processed all requests. Monitoring indicators usually include the number of requests, processing time, error rate, etc. of the old service node. During the switching process, tools are used to view the changes in these indicators in real time to determine the request processing status of the old service node. At the same time, it can also be judged through logs. During the switching process, the logs of the new and old versions of the service are compared to see if any requests are processed repeatedly or missed. Based on monitoring and logging methods, the threshold setting of the drainage time is further optimized (determined by the actual time in the log record).
[0087] The second method is to pre-set the traffic warm-up process. During the system initialization phase, key resources will be at a low water level, including connection pools, thread pools, etc. If the traffic suddenly increases, the system water level may rise instantly, resulting in longer response time due to the creation of key resources, which in turn blocks more requests, causing huge consumption of memory, sockets, etc., and eventually leading to system freeze. Through traffic warm-up (Warm Up), the passing traffic can be slowly increased, gradually increasing to the upper threshold limit within a certain period of time, giving the cold system time to warm up and create key resources, avoiding the crash of the cold system. The warm-up start function can use Guava's algorithm to slowly adjust the traffic to a specific threshold within a specified time by adjusting the slope at any time.
[0088] This application simulates request preheating and small traffic preheating of the application by writing a stress test script. First, the weight is calculated based on the startup time of each service provider instance at the service consumer end. Secondly, the load balancing algorithm is combined to control the process in which the traffic of the newly started application gradually increases to a normal level as the startup time increases, helping the newly started operation to preheat.
[0089] The calculation of the small-traffic service warm-up model implemented in this application is shown in Formula 3. The target architecture application traffic split ratio f(x) changes linearly with the call time x, x-startTime is the switching start time, warmupTime is the application warm-up time configured by the user, k is a constant, k can be represented by 1, and can be used to identify the proportion of the number of target architecture application copies to the total number of copies.
[0090] (Formula 3)
[0091] The third type, the Readiness Probe, is used to detect whether the Pod is ready to receive traffic and process requests. The main function of the Readiness Probe is to enable Kubernetes to ensure that the application inside the Pod has been initialized and is ready to handle traffic before routing traffic to the Pod. If the Readiness Probe detects that the Pod is not ready, Kubernetes will suspend routing traffic to the Pod until it is ready. The principle of the Readiness Probe is to periodically perform an HTTP request or TCP test in the Pod. If the request or test returns successfully, it means that the Pod is ready to receive traffic. If the request or test fails, it means that the Pod is not ready yet, and Kubernetes will continue to wait for the Pod to be ready. This application introduces one of the readiness probes for smooth switching strategies, which mainly includes three types of request detection, namely:
[0092] For HTTP requests, the readiness probe sends a GET request to the HTTP endpoint exposed by the application and checks the returned status code. If the status code is 200-399, the application is considered ready to handle traffic. Otherwise, the readiness probe considers the application not ready.
[0093] For TCP detection, the readiness probe checks whether the TCP port of the application is open. If the TCP port is open, the application is considered ready to handle traffic. Otherwise, the readiness probe considers the application not ready.
[0094] For command detection, the readiness probe executes a command, and if the command returns a status code of 0, the application is considered ready to handle traffic. Otherwise, the readiness probe considers the application not ready.
[0095] Fourthly, when the service provider system is publishing or other unpredictable service access times out, the client request may be lost or the response return may be lost. Therefore, the embodiment of the present application can compensate through a retry mechanism to improve the request success rate and service availability.
[0096] This application is based on Istio's service mesh technology. The retry mechanism uses a random retry time interval (variable jitter) and limits the number of retries to maximize the smoothness of service calls. Istio supports fine-grained configuration of service retry policies, supports setting parameters such as retry timeout and number of retries, and can better achieve the target effect of retry.
[0097] Specifically, for example, a retry mechanism is set for the httpbin service. Here, if the service does not return a correct return value within 2 seconds, a retry is performed. The retry condition is that the return code is 5xx and the retry is performed 3 times. The configuration sample code is as follows:
[0098] - match:
[0099] -uri:
[0100] prefix: / httpbin
[0101] mirror:
[0102] host: httpbin
[0103] subset: v2
[0104] mirror_percent: 100
[0105] name: httpbin-route
[0106] retries:
[0107] attempts: 3
[0108] perTryTimeout: 2s
[0109] retryOn: 5xx
[0110] Further, performing traffic distribution on the application replica of the target application of the stateless workload according to the traffic segmentation strategy to obtain the traffic ratio corresponding to the application replica includes:
[0111] According to a preset traffic drainage mechanism, a preset traffic preheating mechanism, a readiness probe, and an element and configuration retry mechanism, traffic is distributed to the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies.
[0112] Specifically, the application copies of the target application of the stateless workload are allocated traffic in the order of a preset traffic preheating mechanism, a readiness probe, a preset traffic drainage mechanism, and a configured retry mechanism to obtain a traffic ratio corresponding to the application copy.
[0113] Specifically, the traffic smoothing part is carried out in sequence. First, the traffic is preheated so that the relevant systems of the target node can pass the initialization stage, that is, through the preheating model. The preheating model is the previous small traffic service preheating model and formula 3. The warmupTime in formula 3 is the application preheating time configured by the user, which can be understood as the time when the receiving application is about to make a switching request. The startTime is determined by the ready probe, where k can be understood as 1, because the scenario is application switching, and the number of application copies on the target node finally achieved accounts for 100%.
[0114] It should be noted that in the application scenario of capacity expansion, that is, expanding part of the number of replicas to the new target node, and the initial node still retains part of the number of replicas, then the coefficient of the k value is set for the compatibility of the application scenario.
[0115] Secondly, the readiness probe is introduced to determine whether the application Pod on the target node is ready and can receive traffic and process requests. This moment also determines the startTime in formula 3, which is the time when the switch starts.
[0116] Next, configure traffic drainage (i.e., the graceful exit mechanism of the application). That is, after the switch starts, do not exit the application Pod of the initial node immediately. The default drainage time is 30s, and it can be adjusted based on specific log information or monitoring information.
[0117] Finally, configure the container design with a retry mechanism to ensure that when an unpredictable error causes service unavailability, repeated attempts can be made to compensate, thereby improving the stability and availability of traffic smoothing.
[0118] It should be noted that during the application switching process, both the initial node and the first target switching node have application Pods providing services. During this process, the traffic ratio of different nodes is gradually adjusted, which can be understood as the initial node 100% gradually shrinking to 0%, while the first target switching node gradually expanding from 0 to 100%.
[0119] The overall process is completed according to the above four strategies, and these methods are also used to achieve the goal of traffic smoothing during the switching process.
[0120] Third, for data synchronization of stateful applications, efficient negotiation and data synchronization mechanisms are the key to ensuring functional consistency before and after application switching.
[0121] Therefore, according to a preset distributed consistency algorithm, the replica data of the application replica of the target application of the stateful workload at the initial node is synchronously copied to the first target switching node.
[0122] Specifically, first, the processing capabilities and network conditions of each node in the one-cloud-multi-core system are different, resulting in different timeout effects. An adaptive method based on maximum likelihood estimation can be used to avoid nodes with large heartbeat delays and weak processing capabilities from frequently triggering elections, while ensuring that nodes with strong processing capabilities can quickly initiate elections. Secondly, for voting strategies, node priority settings or a mechanism to reduce the range of random timeout values can be used to make it easier for strong nodes to obtain a majority of votes.
[0123] Leader election process: The master node (leader) periodically sends heartbeats to all the slave nodes (followers) to ensure the leader status. When a follower does not receive a heartbeat within a timeout period, the node is converted into a candidate node to participate in the election. The different processing capabilities and network conditions of each node in the one-cloud multi-core system lead to different timeout effects. An adaptive method based on maximum likelihood estimation can be used to avoid nodes with large heartbeat delays and weak processing capabilities from frequently triggering elections, while ensuring that nodes with strong processing capabilities can quickly initiate elections. For voting strategies, node priority settings or a mechanism to reduce the range of random timeout values are used to make it easier for strong nodes to obtain the majority of votes.
[0124] Log replication process: The quorum write mechanism is adopted. The leader receives requests from clients, proposes writes to followers and receives feedback votes. Each proposal can only be submitted if it receives more than half of the votes. That is, if the system has n nodes, node w will feedback votes. If it is 1, it is 0 otherwise. The minimum number of write votes should satisfy the following formula 4.
[0125] (Formula 4)
[0126] Among them, in the above formula 4, is the feedback vote corresponding to node w, n is the number of nodes, and w is the node.
[0127] Step 102, when it is detected that the service level data before and after the target application is switched are consistent, the service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the target application is in a cross-node switching completion state.
[0128] It should be noted that in the embodiment of the present application, during the dynamic stage, as the application runs normally after switching across architectures, service quality-related indicators such as throughput, latency, TPS (Transactions Per Second), etc. are obtained through monitoring of business computing power, and then a dynamic optimization strategy is formulated and issued in a timely manner based on the difference with the expected service quality until the service level SLA (Service Level Agreement) before and after the application switching is close.
[0129] Specifically, the three smoothing processing methods in step 101 need to be dynamically optimized, and the details will be described in detail later.
[0130] The application switching method provided by the embodiment of the present invention, when an application switching request is detected when the target application is switched across nodes, determines the first target switching node according to the pre-acquired node resource information, and determines the number of target copies corresponding to the target application after the switching according to the specification computing power corresponding to the first target switching node; and, according to the traffic segmentation strategy, distributes the traffic of the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies; and, performs data replication and synchronization on the application copies of the target application of the stateful workload between different nodes; when it is detected that the service level data before and after the target application is switched are consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application is switched are consistent, the target application is in a cross-node switching completion state. In the embodiments of the present invention, by considering the environment in which the application runs, balanced scheduling based on specification computing power can ensure the consistency of computing power before and after the application switch; by on-demand traffic segmentation based on the gateway or load balancer for the service traffic of stateless applications, the consistency of service quality before and after the application switch can be ensured; by data synchronization for stateful applications, based on efficient negotiation and data synchronization mechanisms, the consistency of functions before and after the application switch can be ensured, and by real-time perception of business computing power indicators and continuous adjustment and optimization of the equivalent effect of consistent service quality before and after the application cross-architecture switching, an observation-based compensation feedback design is formed. The embodiments of the present invention can not only realize the automatic scheduling and migration of cloud-native applications in the one-cloud-multi-core scenario, but also ensure the equivalence and smoothness of this process.
[0131] Reference Figure 2, showing the steps of the application switching method provided by the embodiment of the present invention Figure 2 , the method may include:
[0132] Step 201, when an application switching request is detected when a target application switches across nodes, a first target switching node is determined according to pre-acquired node resource information, and the number of target replicas corresponding to the target application after switching is determined according to the specification computing power corresponding to the first target switching node; and, according to the traffic splitting strategy, traffic is distributed among the application replicas of the target application of the stateless workload to obtain the traffic ratio corresponding to the application replicas; and, data replication and synchronization are performed among different nodes for the application replicas of the target application of the stateful workload;
[0133] Step 202, monitoring the target application according to a preset monitoring component to obtain monitoring data;
[0134] Step 203, determining whether the service level data corresponding to the target application before and after switching is consistent according to the monitoring data;
[0135] Further, step 203 may include:
[0136] If not, the target number of replicas corresponding to the target application and the first target switching node are modified according to the monitoring data until the service level data corresponding to the target application before and after the switching are consistent.
[0137] Further, the modifying the target number of replicas and the first target switching node corresponding to the target application according to the monitoring data includes:
[0138] Acquire, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched;
[0139] If the difference is greater than the first threshold, the target number of replicas is adjusted according to a preset step size, or the second target switching node is determined according to a mapping matrix between the specification computing power and the switching node.
[0140] Further, the acquiring, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched comprises:
[0141] Normalization is performed based on the throughput value, delay value and number of errors corresponding to the initial node before the target application is switched, and the throughput value, delay value and number of errors corresponding to the first target switching node after the target application is switched, and the difference is obtained by combining the weight values corresponding to the throughput value, delay value and number of errors.
[0142] Furthermore, the mapping matrix according to the specification computing power and the switching node is a computing power distribution matrix table based on the CPU model, and the computing power distribution matrix table is used to record the mapping matrix between the CPU model and the specification computing power under different nodes.
[0143] It should be noted that in the embodiments of the present application, reference is made to Figure 8 Due to the diversification of business, it is difficult to quantify the measurement standard of computing power through a fixed model. Therefore, this application directly adopts monitoring to characterize the service level of business computing power, and uses the indicator system of throughput TPS, latency and number of errors to measure the business computing power of a certain application.
[0144] The business computing power indicator is calculated by stress testing the script written in Jmeter.
[0145] The first is to correct SLA inconsistencies by increasing or decreasing the number of application replicas.
[0146] Specifically, the service level (SLA) before and after the application cross-architecture switch is obtained through the business computing power quantitative analysis formula. The core strategy of optimization and adjustment is based on the difference in business computing power indicators before and after the application switch. Optimization is carried out by increasing or decreasing the number of application copies, changing the target node with the same specifications according to the CPU model computing power distribution, and other measures. The specific process is as follows:
[0147] If the data obtained from the stress test before and after the cross-architecture switch of the application is quite different, the data obtained from the stress test before and after can abstract the SLA into a triple: throughput, latency, and number of errors, which can be quantified and evaluated by the following formula 5, and then consider increasing or decreasing the number of scheduled replicas based on the evaluation results.
[0148] (Formula 5)
[0149] Among them, in the above formula 5, f(x) represents the normalization process, and this application adopts the maximum and minimum normalization calculation process ( ), the purpose is to map the data value (the data set monitored over a period of time) to the interval [0,1] and unify the dimension. a, b, c in the formula represent the weight values for the throughput, latency, and number of errors, respectively. The default value is 1. The weight can also be adjusted appropriately according to the specific business type (such as IO-intensive or compute-intensive) to adapt to the specific business scenario and increase flexibility. Indicates a period of time ago Numeric value, Indicates that after a period of time Numeric value, Indicates the delay value before a period of time. Indicates the delay value after a period of time. Indicates the number of errors over time. Indicates the number of errors over time.
[0150] Therefore, according to the value of results, if it is less than the first threshold, for example, the first threshold is 2%, it is considered that the SLA is consistent. If it is greater than 2%, the number of application replicas is adjusted with a step size of 1, and the application SLA values before and after the adjustment are stress tested again. The difference in SLA before and after (results) is observed and compared with the target value (2%), and this cycle is repeated until consistency is achieved.
[0151] The value of results is the difference between the first service level data corresponding to the initial node before the target application is switched and the second service level data corresponding to the first target switching node after the target application is switched.
[0152] The second method is to change the target nodes with the same specifications according to the CPU model computing power distribution to correct the SLA inconsistency.
[0153] Specifically, in addition to the strategy of changing the number of application replicas, another optimization strategy relies on the specification computing power measurement process mentioned above. This process will produce a CPU model computing power distribution matrix table, which records the mapping matrix between CPU model and computing power (specification computing power) under different architectures. The calculation formula is as described above, and the calculation process is supplemented as follows:
[0154] The first step is to use the cluster as a perspective. When a node joins the cluster, the computing power measurement task can be automatically scheduled through the nfd-worker daemon (computing node). The computing power measurement task can be equipped with different computing power measurement benchmark programs as needed.
[0155] In the second step, the calculation results are saved in text format in the form of key-value pairs and organized in the structure of a hash table.
[0156] The third step is to automatically report the node computing power value and detect whether there are new nodes joining through periodic detection;
[0157] Step 4: The reported measurement results are further processed by the nfd-master process (management node);
[0158] Step 5: Establish a mapping relationship between computing power and nodes, and add labels;
[0159] Step 6. Add the previously obtained labels to the node’s metadata and save them in the etcd module (database).
[0160] Therefore, when the monitoring method shows that the SLA is inconsistent before and after the application cross-architecture switch, it can be corrected by reselecting a new scheduling node. The new node is selected according to the node CPU model and specification computing power mapping matrix obtained in the above measurement process. After adjustment, the application SLA value before and after the adjustment is stress tested again, and the difference (results) of the SLA before and after is observed, and compared with the target value (2%). This cycle is repeated until consistency is achieved.
[0161] Step 204, determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component;
[0162] Further, after the step of determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component, the following two situations may be included:
[0163] If not, the traffic segmentation strategy is optimized according to the information on the service request recorded by the preset log system.
[0164] If so, the traffic ratio corresponding to the application copy is used as the traffic ratio corresponding to the cross-node switching of the target application.
[0165] Step 205, verifying through a preset database query statement whether data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent;
[0166] Further, after step 205, if there is inconsistency, that is, if no, the application copy of the target application of the stateful workload is replicated and synchronized again between different nodes until the application copy data corresponding to the target application before and after the switching is consistent.
[0167] Step 206, when it is detected that the service level data before and after the target application switch is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application switch is consistent, the target application is in a cross-node switching completion state.
[0168] It should be noted that in the embodiments of the present application, reference is made to Figure 8Before step 204, correction has been made as to whether the SLA is consistent. Therefore, in steps 204-205, correction is made as to whether the traffic is smooth and whether the data is synchronized.
[0169] Specifically, for the correction of the data synchronization part, a preset database query statement is used to verify whether the data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent.
[0170] In the process of correcting whether the traffic is smooth, the monitoring method can also be used to determine whether the old service node has processed all requests. The monitoring indicators usually include the number of requests, processing time, error rate, etc. of the old service node. During the switching process, tools (monitoring agents) are used to view the changes in these indicators in real time to determine the request processing status of the old service node. At the same time, it can also be judged through logs. During the switching process, the logs of the new and old versions of the service are compared to check whether any requests are processed repeatedly or missed. Based on the monitoring and log methods, the threshold setting of the drainage time (traffic drainage) is further optimized.
[0171] In the embodiments of the present invention, by considering the environment in which the application runs, balanced scheduling based on specification computing power can ensure the consistency of computing power before and after the application switch; by on-demand traffic segmentation based on the gateway or load balancer for the service traffic of stateless applications, the consistency of service quality before and after the application switch can be ensured; by data synchronization for stateful applications, based on efficient negotiation and data synchronization mechanisms, the consistency of functions before and after the application switch can be ensured, and by real-time perception of business computing power indicators and continuous adjustment and optimization of the equivalent effect of consistent service quality before and after the application cross-architecture switching, an observation-based compensation feedback design is formed. The embodiments of the present invention can not only realize the automatic scheduling and migration of cloud-native applications in the one-cloud-multi-core scenario, but also ensure the equivalence and smoothness of this process.
[0172] Reference Figure 3 , shows a schematic diagram of the structure of an application switching device provided by an embodiment of the present invention, the device may include:
[0173] The static switching module 301 is used to determine the first target switching node according to the pre-acquired node resource information when an application switching request is detected when the target application switches across nodes, and determine the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, according to the traffic splitting strategy, distribute the traffic of the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies; and, replicate and synchronize the data of the application copies of the target application of the stateful workload between different nodes;
[0174] The dynamic optimization switching module 302 is used to detect that the service level data corresponding to the target application before and after the switching is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, and the target application is in a cross-node switching completion state.
[0175] In the embodiments of the present invention, by considering the environment in which the application runs, balanced scheduling based on specification computing power can ensure the consistency of computing power before and after the application switch; by on-demand traffic segmentation based on the gateway or load balancer for the service traffic of stateless applications, the consistency of service quality before and after the application switch can be ensured; by data synchronization for stateful applications, based on efficient negotiation and data synchronization mechanisms, the consistency of functions before and after the application switch can be ensured, and by real-time perception of business computing power indicators and continuous adjustment and optimization of the equivalent effect of consistent service quality before and after the application cross-architecture switching, an observation-based compensation feedback design is formed. The embodiments of the present invention can not only realize the automatic scheduling and migration of cloud-native applications in the one-cloud-multi-core scenario, but also ensure the equivalence and smoothness of this process.
[0176] The embodiment of the present invention also provides a communication device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0177] Memory 403, used for storing computer programs;
[0178] The processor 401, when used to execute the program stored in the memory 403, can implement the following steps:
[0179] In the case of detecting an application switching request initiated when the target application switches across nodes, determining the first target switching node according to the pre-acquired node resource information, and determining the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, distributing the traffic of the application copies of the target application of the stateless workload according to the traffic splitting strategy to obtain the traffic ratio corresponding to the application copies; and, performing data replication and synchronization on the application copies of the target application of the stateful workload between different nodes;
[0180] When it is detected that the service level data before and after the target application switch is consistent, the service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application switch is consistent, the target application is in a cross-node switching completion state.
[0181] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the computer-readable storage medium is executed on a computer, the computer executes the application switching method described in any one of the above embodiments.
[0182] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the application switching method described in any one of the above embodiments.
[0183] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An application switching method, characterized in that: The method comprises: In the case of detecting an application switching request initiated when the target application switches across nodes, determining the first target switching node according to the pre-acquired node resource information, and determining the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, distributing the traffic of the application copies of the target application of the stateless workload according to the traffic splitting strategy to obtain the traffic ratio corresponding to the application copies; and, performing data replication and synchronization on the application copies of the target application of the stateful workload between different nodes; When it is detected that the service level data before and after the target application switch is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data before and after the target application switch is consistent, the target application is in a cross-node switching completion state.
2. The method according to claim 1, characterized in that: Before the step of detecting that the service level data corresponding to the target application before and after the switching is consistent, the service requests corresponding to the initial node of the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, the target application is in a cross-node switching completion state, the method includes: Monitor the target application according to a preset monitoring component to obtain monitoring data; Determine whether the service level data corresponding to the target application before and after the switching is consistent according to the monitoring data.
3. The method according to claim 2, characterized in that Determining whether the service level data corresponding to the target application before and after the switching is consistent according to the monitoring data includes: If not, the target number of replicas corresponding to the target application and the first target switching node are modified according to the monitoring data until the service level data corresponding to the target application before and after the switching are consistent.
4. The method according to claim 3, characterized in that The modifying the target number of replicas and the first target switching node corresponding to the target application according to the monitoring data includes: Acquire, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched; If the difference is greater than the first threshold, the target number of replicas is adjusted according to a preset step size, or the second target switching node is determined according to a mapping matrix between the specification computing power and the switching node.
5. The method according to claim 4, characterized in that The acquiring, according to the monitoring data, a difference between first service level data corresponding to the initial node before the target application is switched and second service level data corresponding to the first target switching node after the target application is switched comprises: Normalization is performed based on the throughput value, delay value and number of errors corresponding to the initial node before the target application is switched, and the throughput value, delay value and number of errors corresponding to the first target switching node after the target application is switched, and the difference is obtained by combining the weight values corresponding to the throughput value, delay value and number of errors.
6. The method according to claim 4, characterized in that The mapping matrix according to the specification computing power and the switching node is a computing power distribution matrix table based on the CPU model, and the computing power distribution matrix table is used to record the mapping matrix between the CPU model and the specification computing power under different nodes.
7. The method according to claim 1, characterized in that Before the step of detecting that the service level data corresponding to the target application before and after the switching is consistent, the service requests corresponding to the initial node of the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, the target application is in a cross-node switching completion state, the method includes: It is determined according to the second preset monitoring component whether all service requests corresponding to the initial node corresponding to the target application are processed.
8. The method according to claim 7, characterized in that After the step of determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component, the method includes: If not, the traffic segmentation strategy is optimized according to the information on the service request recorded by the preset log system.
9. The method according to claim 7, characterized in that: After the step of determining whether all service requests corresponding to the initial node corresponding to the target application are processed according to the second preset monitoring component, the method includes: If so, the traffic ratio corresponding to the application copy is used as the traffic ratio corresponding to the cross-node switching of the target application.
10. The method according to claim 1, characterized in that Before the step of detecting that the service level data corresponding to the target application before and after the switching is consistent, the service requests corresponding to the initial node of the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, the target application is in a cross-node switching completion state, the method includes: Verify through a preset database query statement whether the data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent.
11. The method according to claim 10, characterized in that After the step of verifying, by using a preset database query statement, whether data between the application copy of the target application of the stateful workload corresponding to the first target switching node and the application copy of the target application of the stateful workload corresponding to the initial node are consistent, the method includes: If not, data replication and synchronization are performed again on the application copy of the target application of the stateful workload between different nodes until the application copy data corresponding to the target application before and after the switching are consistent.
12. The method according to claim 1, characterized in that The determining of the first target switching node according to the pre-acquired node resource information, and determining the corresponding target number of replicas after the target application is switched according to the specification computing power corresponding to the first target switching node includes: Determining a first target switching node according to pre-acquired node resource information; Obtaining a first specification computing power corresponding to the first target switching node and an initial specification computing power corresponding to the initial node; The target number of copies of the target application corresponding to the first target switching node is generated according to the first specification computing power, the initial specification computing power and the initial number of copies.
13. The method according to claim 12, characterized in that The obtaining of the first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node includes: Obtaining the integer computing capability and the floating-point computing capability corresponding to the first target switching node and the initial node respectively according to the benchmark test tool evaluation; The first specification computing power corresponding to the first target switching node and the initial specification computing power corresponding to the initial node are quantified according to the shaping computing power and the floating-point computing power.
14. The method according to claim 1, characterized in that The method of allocating traffic to the application replica of the target application of the stateless workload according to the traffic segmentation strategy to obtain the traffic ratio corresponding to the application replica includes: According to a preset traffic drainage mechanism, a preset traffic preheating mechanism, a readiness probe, and an element and configuration retry mechanism, traffic is distributed to the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies.
15. The method according to claim 14, characterized in that The step of distributing traffic to the application replicas of the target application of the stateless workload according to the preset traffic drainage mechanism, the preset traffic preheating mechanism, the readiness probe, and the element and configuration retry mechanism to obtain the traffic ratio corresponding to the application replicas includes: The application copies of the target application of the stateless workload are distributed with traffic in the order of a preset traffic preheating mechanism, a readiness probe, a preset traffic drainage mechanism, and a configured retry mechanism to obtain a traffic ratio corresponding to the application copy.
16. The method according to claim 1, characterized in that The step of performing data replication and synchronization on the application replica of the target application of the stateful workload between different nodes includes: The replica data of the application replica of the target application of the stateful workload at the initial node is synchronously copied to the first target switching node according to a preset distributed consistency algorithm.
17. An application switching device, characterized in that: The device comprises: A static switching module is used to determine the first target switching node according to the pre-acquired node resource information when an application switching request is detected when the target application switches across nodes, and determine the corresponding number of target copies after the target application switches according to the specification computing power corresponding to the first target switching node; and, according to the traffic splitting strategy, distribute the traffic of the application copies of the target application of the stateless workload to obtain the traffic ratio corresponding to the application copies; and, replicate and synchronize the data of the application copies of the target application of the stateful workload between different nodes; The dynamic optimization switching module is used to detect that the service level data corresponding to the target application before and after the switching is consistent, the corresponding service requests on the initial node corresponding to the target application are all processed, and the application copy data corresponding to the target application before and after the switching is consistent, and the target application is in a cross-node switching completion state.
18. A communication device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the application switching method as described in any one of claims 1-16.
19. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the application switching method as described in any one of claims 1 to 16 is implemented.
20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the application switching method as described in any one of claims 1-16 is implemented.
