Application service cluster switching method and device, computer equipment, readable storage medium and program product

By switching application service traffic to the second service cluster in stages, using intermediate components to split the traffic and divert it to the two service clusters, the system stability problem during service cluster switching is solved, the application service crash is avoided and stable service is achieved Cluster switching.

CN119420814AActive Publication Date: 2025-02-11CHINA CONSTRUCTION BANK +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411380296.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-11
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

When switching service clusters, abnormalities in the new service cluster can easily lead to application services crashes and poor system stability.

Method used

By gradually switching application service traffic from the first service cluster to the second service cluster in two stages, the traffic is divided into two parts using intermediate components and diversion to the two service clusters respectively to execute the application service response process.

Benefits of technology

Even if the application service response process executes abnormally in the second service cluster, the first part of the traffic still exists in the first service cluster, avoiding the entire application service crash. At the same time, the service cluster switching is completed without exceptions, improving system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420814A_ABST
    Figure CN119420814A_ABST
Patent Text Reader

Abstract

The invention relates to an application service cluster switching method and device, computer equipment, a computer readable storage medium and a computer program product. Relates to the technical field of data processing. The method comprises the following steps: switching an online component from a first service component to an intermediate component; the method comprises the following steps: acquiring application service traffic through an online component, and segmenting the application service traffic into a first part of traffic and a second part of traffic; the first part of flow is shunted to a first service cluster through an intermediate component, the second part of flow is shunted to a second service cluster, and an application service response process corresponding to the application service flow is executed; and if the execution of the application service response process is not abnormal, switching the online component from the intermediate component to the second service component, and switching the online application service cluster from the first service cluster to the second service cluster. By adopting the method, the system stability during cluster switching can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an application service cluster switching method, device, computer equipment, computer-readable storage medium and computer program product. Background Art

[0002] With the development of data processing technology, when updating services, it is usually necessary to switch service clusters.

[0003] In traditional technology, a new service cluster is usually prepared first. After the new service cluster is online, the traffic of the old service cluster is split to the new service cluster, and the service cluster switching is completed.

[0004] However, when switching service clusters, once an abnormality occurs in the new service cluster, it is easy to cause the application service to collapse. Therefore, the system stability when switching service clusters is currently poor. Summary of the invention

[0005] Based on this, it is necessary to provide an application service cluster switching method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve system stability during service cluster switching in response to the above technical problems.

[0006] In a first aspect, the present application provides an application service cluster switching method, which implements the step-by-step switching of application service traffic from a first service cluster to a second service cluster in two stages. Compared with the method of directly switching all traffic from the first service cluster to the second service cluster, even if an abnormality occurs in the execution of the application service process, the entire application service will not crash, thereby improving the system stability during the application service cluster switching; the method includes:

[0007] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster and the second part of traffic to the second service cluster through the intermediate component, and executing the application service response process corresponding to the application service traffic;

[0008] If the application service response process is executed without exception, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster.

[0009] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and the traffic diversion step includes:

[0010] Switching the online component from the first service component to the first intermediate component;

[0011] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0012] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0013] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0014] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0015] In one embodiment, the method further comprises:

[0016] If the first-stage response process is executed abnormally, suspending or deregistering the cluster server of the second service cluster registered in the first intermediate component;

[0017] If the second-stage response process is executed abnormally, the online component is switched from the second intermediate component to the first service component.

[0018] In one embodiment, the application service response process includes multiple stage response processes, the intermediate component includes multiple stage intermediate components; the traffic diversion step includes:

[0019] Component switching step: switch the online component to the intermediate component;

[0020] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0021] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0022] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0023] In one embodiment, dividing the application service traffic into a first portion of traffic and a second portion of traffic includes:

[0024] Obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0025] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0026] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0027] In a second aspect, the present application further provides an application service cluster switching device, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster; the device includes:

[0028] A traffic diversion module, used to perform traffic diversion steps: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster through the intermediate component, and diverting the second part of traffic to the second service cluster, and executing the application service response process corresponding to the application service traffic;

[0029] The switching module is used to switch the online application service cluster from the first service cluster to the second service cluster by switching the online component from the intermediate component to the second service component if the application service response process is executed normally.

[0030] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and the traffic diversion module is further used to:

[0031] Switching the online component from the first service component to the first intermediate component;

[0032] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0033] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0034] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0035] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0036] In one embodiment, the device further comprises:

[0037] A service exception execution module is used to suspend or cancel the cluster server of the second service cluster registered in the first intermediate component if the first stage response process executes abnormally; if the second stage response process executes abnormally, the online component is switched from the second intermediate component to the first service component.

[0038] In one embodiment, the application service response process includes multiple stage response processes, the intermediate component includes multiple stage intermediate components; and the traffic diversion module is further used to:

[0039] Component switching step: switch the online component to the intermediate component;

[0040] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0041] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0042] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0043] In one embodiment, the traffic diversion module is further used for:

[0044] Obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0045] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0046] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0047] In a third aspect, the present application further provides a computer device, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0048] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster through the intermediate component, and diverting the second part of traffic to the second service cluster, executing the application service response process corresponding to the application service traffic; if the application service response process is executed without exception, switching the online component from the intermediate component to the second service component, switching the online application service cluster from the first service cluster to the second service cluster.

[0049] In a fourth aspect, the present application further provides a computer-readable storage medium, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster, and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:

[0050] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster through the intermediate component, and diverting the second part of traffic to the second service cluster, executing the application service response process corresponding to the application service traffic; if the application service response process is executed without exception, switching the online component from the intermediate component to the second service component, switching the online application service cluster from the first service cluster to the second service cluster.

[0051] In a fifth aspect, the present application further provides a computer program product, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0052] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster through the intermediate component, and diverting the second part of traffic to the second service cluster, executing the application service response process corresponding to the application service traffic; if the application service response process is executed without exception, switching the online component from the intermediate component to the second service component, switching the online application service cluster from the first service cluster to the second service cluster.

[0053] The above-mentioned application service cluster switching method, device, computer equipment, computer-readable storage medium and computer program product are applied to an application service system, wherein the application service system is provided with a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster. In this way, when switching an application service in the application service system, the online component will first be switched from the first service component to the intermediate component, so that after obtaining the application service traffic, the intermediate component will switch the application service traffic to the intermediate component. The traffic is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster to execute the application service process corresponding to the application service traffic. In this way, even if the application service response process executes abnormally in the second service cluster, the first part of traffic still exists in the first service cluster, and the entire application service will not crash. When the application service response process executes normally, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster, so that the service cluster switching can be completed smoothly, thereby improving the system stability during the service cluster switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A schematic diagram of a flow chart of an application service cluster switching method in one embodiment of the present application;

[0056] Figure 2 This is a flow chart of a flow diversion step in one embodiment of the present application;

[0057] Figure 3 This is a flow chart of a flow diversion step in another embodiment of the present application;

[0058] Figure 4 It is a structural block diagram of an application service cluster switching device in one embodiment;

[0059] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with relevant provisions of national laws and regulations.

[0062] The application service cluster switching method of the present application is applied to an application service system, which includes a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster.

[0063] Based on this, it can be seen that when the first service component is an online component, since the cluster server of the first service cluster is registered on the first service component, the application service traffic obtained by the online component will all be directed to the cluster servers of the first service cluster; when the intermediate component is an online component, since the cluster servers of the first service cluster and the cluster servers of the second service cluster are registered on the intermediate component at the same time, the application service traffic obtained by the online component will be directed to the cluster servers of the first service cluster and the cluster servers of the second service cluster; when the second service component is an online component, since the cluster servers of the second service cluster are registered on the second service component, the application service traffic obtained by the online component will be directed to the cluster servers of the second service cluster.

[0064] In an exemplary embodiment, Figure 1 As shown, a method for switching an application service cluster is provided, and the method includes the following steps 202 to 204. Among them:

[0065] Step 202, traffic diversion step: switch the online component from the first service component to the intermediate component; obtain application service traffic through the online component, and divide the application service traffic into a first part of traffic and a second part of traffic; divert the first part of traffic to the first service cluster through the intermediate component, and divert the second part of traffic to the second service cluster, and execute the application service response process corresponding to the application service traffic.

[0066] Among them, the first service component, the intermediate component and the second service component can all be set in the service directory, and the online component can be switched among the first service component, the intermediate component and the second service component in the service directory; the first service component registers the server address of each cluster server in the first service cluster, the intermediate component simultaneously registers the server address of each cluster server in the first service cluster and the server address of each cluster server in the second service cluster, and the second service component registers the server address of each cluster server in the second service cluster.

[0067] As an example, the number of the first service component and the second service component may be one, and the number of the intermediate components may be one or more.

[0068] As an example, step 202 includes: switching the online component from the first service component to the intermediate component in the service catalog, obtaining application service traffic through the intermediate component, and dividing the application service traffic into a first part of traffic and a second part of traffic according to a preset traffic ratio; diverting the first part of traffic to the first service cluster through the server address of the cluster server of the first service cluster registered on the intermediate component, and diverting the second part of traffic to the second service cluster through the server address of the cluster server of the second service cluster registered on the intermediate component; executing the application service response process corresponding to the first part of traffic through the first service cluster, and executing the application service response process corresponding to the second part of traffic through the second service cluster.

[0069] It should be noted that the application service response process is used to process the application service traffic and output the corresponding response result. For example, assuming that the application service traffic is user portrait information, the response result may be a user classification result based on the user portrait information.

[0070] In some embodiments, the proportion of the second part of the traffic in the application service traffic is less than a preset traffic proportion threshold, which can ensure that the intermediate component will first divert a small amount of application service traffic to the second service cluster to execute the application service response process. In this way, since the application service traffic diverted to the second service cluster is small, but the application service traffic diverted to the first service cluster is large, even if the application service response process of the second service cluster executes abnormally, it will not have a significant impact on the entire application service, thereby causing the overall collapse of the application service.

[0071] Step 204: If the application service response process is executed without exception, the online application service cluster is switched from the first service cluster to the second service cluster by switching the online component from the intermediate component to the second service component.

[0072] As an example, step 204 includes: if the application service response processes of the first service cluster and the second service cluster are executed without exception, the online component is switched from the intermediate component to the second service component, so that the second service component obtains the application service traffic and diverts the obtained application service traffic to the second service cluster according to the server address of the cluster server of the registered second service cluster, thereby switching the online application service cluster from the first service cluster to the second service cluster.

[0073] It should be noted that the intermediate component can register all cluster servers in the first service cluster and all cluster servers in the second service cluster; the intermediate component can also register all cluster servers in the first service cluster and some cluster servers in the second service cluster. The specific settings can be flexibly set according to actual needs.

[0074] In some embodiments, dividing the application service traffic into a first portion of traffic and a second portion of traffic includes:

[0075] Obtain a first server address of a first service cluster and a second server address of a second service cluster; allocate a first server address and a second server address to application service traffic according to preset traffic weight information; determine the application service traffic allocated with the first server address as a first part of traffic, and determine the application service traffic allocated with the second server address as a second part of traffic.

[0076] Among them, the preset traffic weight information is used to determine the proportion of traffic diverted to the first service cluster and the second service cluster. For example, assuming the preset traffic weight information is 0.1, it means that 10% of the application service traffic is diverted to the first service cluster, and the remaining 90% of the application service traffic is diverted to the second service cluster.

[0077] Specifically, the first server address of the cluster server in the first service cluster and the second server address of the cluster server in the second service cluster are obtained; according to the preset traffic weight information, the first server address is allocated to a part of the application service traffic to obtain the first part of the traffic, and the second server address is allocated to another part of the application service traffic to obtain the second part of the traffic. In this way, the first part of the traffic will be automatically addressed to the first server cluster according to the first server address, that is, the first part of the traffic will be automatically diverted to the first server cluster, and the second part of the traffic will be automatically addressed to the second server cluster according to the second server address, that is, the second part of the traffic will be automatically diverted to the second service cluster.

[0078] In the above-mentioned application service cluster switching method, the application service system is provided with a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster. The first service component is used to register the cluster server of the first service cluster, the intermediate component is used to register the cluster server of the first service cluster and the cluster server of the second service cluster, and the second service component is used to register the cluster server of the second service cluster. In this way, when the application service is switched in the application service system, the online component will be switched from the first service component to the intermediate component first, so that after the intermediate component obtains the application service traffic, the application service traffic will be divided into a first part of the traffic and a second part of the traffic, and the first part of the traffic will be diverted to the first service cluster, and the second part of the traffic will be diverted to the second service cluster to execute the application service process corresponding to the application service traffic. In this way, even if the application service response process is executed abnormally in the second service cluster, the first part of the traffic still exists in the first service cluster, and the entire application service will not crash. When the application service response process is executed normally, by switching the online component from the intermediate component to the second service component, the online application service cluster is switched from the first service cluster to the second service cluster, and the service cluster switching can be completed smoothly, so the system stability during the service cluster switching can be improved.

[0079] In an exemplary embodiment, Figure 3 As shown, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and the traffic diversion step includes:

[0080] Step 302: Switch the online component from the first service component to the first intermediate component.

[0081] Among them, the online component refers to the component of the application service system that is currently in operation. The online component can obtain application service traffic and divert the application service traffic to the cluster server.

[0082] Step 304, divides the application service traffic obtained by the first intermediate component into a first part of traffic and a second part of traffic, and diverts the first part of traffic to the first service cluster through the first intermediate component, and diverts the second part of traffic to the second service cluster, and executes the first stage response process of the application service traffic.

[0083] The intermediate component may include a first intermediate component and a second intermediate component, and the application service response process may include a first-stage response process and a second-stage response process.

[0084] As an example, step 304 includes: according to a first preset traffic diversion ratio, dividing the acquired application service traffic into a first part of traffic and a second part of traffic through a first intermediate component, and diverting the first part of traffic to a first service cluster, and diverting the second part of traffic to a second service cluster; executing a first-stage response process corresponding to the first part of traffic through the first service cluster, and executing a first-stage response process corresponding to the second part of traffic through the second service cluster.

[0085] Step 306: If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic is divided into the third part of traffic and the fourth part of traffic through the second intermediate component.

[0086] Step 308: Divert the third portion of traffic to the first service cluster through the second intermediate component, and divert the fourth portion of traffic to the second service cluster, and execute the second phase response process of the application service traffic.

[0087] As an example, steps 306 to 308 include: if the first-stage response process is executed without abnormalities, the online component is switched from the first intermediate component to the second intermediate component, and the obtained application service traffic is divided into a third part of the traffic and a fourth part of the traffic according to a second preset traffic diversion ratio; the third part of the traffic is diverted to the first service cluster, and the fourth part of the traffic is diverted to the second service cluster; the second-stage response process corresponding to the third part of the traffic is executed through the first service cluster, and the second-stage response process corresponding to the fourth part of the traffic is executed through the second service cluster.

[0088] Furthermore, if the second-stage response process is executed without exception, the online component is switched from the second intermediate component to the second service component.

[0089] It should be noted that the proportion of the fourth part of traffic in the application service traffic is greater than the proportion of the second part of traffic in the application service traffic; the proportion of the third part of traffic in the application service traffic is less than the proportion of the first part of traffic in the application service traffic.

[0090] In some embodiments, the above-mentioned application service cluster switching method further includes:

[0091] If the first-stage response process executes abnormally, the cluster server where the second service cluster is registered with the first intermediate component will be suspended or deregistered; if the second-stage response process executes abnormally, the online component will be switched from the second intermediate component to the first service component.

[0092] Among them, during the execution of the first stage response process, the traffic proportion of the second part of the application service traffic diverted to the second service cluster is less than the first preset traffic proportion; during the execution of the second stage response process, the traffic proportion of the fourth part of the application service traffic diverted to the second service cluster is greater than the second preset traffic proportion, and the second preset traffic proportion is greater than the first preset traffic proportion.

[0093] Specifically, in the case of abnormal execution of the first-stage response process, the second service cluster can be suspended or deregistered from the cluster server of the first intermediate component. Since the proportion of the second part of the application service traffic diverted to the second service cluster is smaller than the first preset traffic proportion, suspending or deregistering the second service cluster from the cluster server of the first intermediate component will basically not affect the operation of the entire application service, and the problem of abnormal execution of the application service response process can also be quickly resolved.

[0094] In the event of an abnormal execution of the second-stage response process, the online component can be switched from the second intermediate component to the first service component to implement version update rollback of the application service system. That is, since the proportion of the fourth part of the application service traffic diverted to the second service cluster is greater than the second preset traffic proportion, the traffic diverted to the second service cluster is relatively large at this time. In order to ensure the stability and security of the entire application service, all application service traffic needs to be re-diverted to the first service cluster to implement version rollback of the application service update.

[0095] In this embodiment, a first intermediate component and a second intermediate component are provided. Since the first intermediate component can divide the obtained application service traffic into a first part of traffic and a second part of traffic, and divert the first part of traffic to the first service cluster, and divert the second part of traffic to the second service cluster, the second intermediate component can switch the obtained application service traffic into a third part of traffic and a fourth part of traffic, and divert the third part of traffic to the first service cluster, and divert the fourth part of traffic to the second service cluster. Since the traffic proportion of the fourth part of traffic in the application service traffic is greater than the traffic proportion of the second part of traffic in the application service traffic; the traffic proportion of the third part of traffic in the application service traffic is less than the traffic proportion of the first part of traffic in the application service traffic, the application service traffic is gradually switched from the first service cluster to the second service cluster in two stages. Compared with the method of directly switching all traffic from the first service cluster to the second service cluster, even if an abnormality occurs in the execution of the application service process, the entire application service will not crash, thereby improving the system stability when the application service cluster is switched.

[0096] In some embodiments, reference Figure 3The application service response process includes multiple stage response processes, and the intermediate components include multiple stage intermediate components; the traffic diversion steps include:

[0097] Step 402, component switching step: switching the online component to the intermediate component of the stage.

[0098] Step 404, stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed.

[0099] Step 406, if the stage response process is executed without exception, return to the execution component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally.

[0100] Among them, the intermediate component may include multiple stage intermediate components, and each stage intermediate component will simultaneously divert the acquired application service traffic to the first service cluster and the second service cluster to execute the corresponding stage response process.

[0101] As an example, steps 402 to 406 include: a component switching step: switching the online component to a stage intermediate component; a stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of the traffic and a second part of the traffic, and the first part of the traffic is diverted to the first service cluster, and the second part of the traffic is diverted to the second service cluster, the stage response process corresponding to the first part of the traffic is executed through the first service cluster, and the stage response process corresponding to the second part of the traffic is executed through the second service cluster; if the stage response process is executed without exception, return to execute the above-mentioned component switching step until multiple stage response processes are executed or any stage response process is executed abnormally.

[0102] It should be noted that if the response process is executed abnormally at any stage, the online component will be switched to the first service component to perform version rollback of the application service to ensure the stability of the application service.

[0103] When the stage traffic diversion step is executed for the Nth time, the proportion of the second part of the traffic in the application service traffic is greater than the proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0104] In this embodiment, multiple stage intermediate components are set between the first service component and the second service component, and starting from the first service component, the online components are gradually switched between the intermediate components of each stage, so that the proportion of traffic diverted to the second service cluster gradually increases, and each stage intermediate component will detect whether the corresponding stage response process is executed without exception when diverting traffic to the first service cluster and the second service cluster, thereby realizing multi-stage gradual switching of application service clusters, gradually migrating the traffic of the first service cluster to the second service cluster, and finally completing the switching of the application service clusters. Compared with the method of directly switching all traffic from the first service cluster to the second service cluster, even if the application service process execution is abnormal, it will not cause the entire application service to crash, so the system stability during the application service cluster switching can be improved.

[0105] In a complete embodiment, the application service system includes a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, the first service component is used to register the cluster server of the first service cluster, the intermediate component is used to register the cluster server of the first service cluster and the cluster server of the second service cluster, and the second service component is used to register the cluster server of the second service cluster.

[0106] Based on the above application service system, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; the application service system first switches the online component from the first service component to the first intermediate component; according to the first preset traffic diversion ratio, the obtained application service traffic is divided into a first part of traffic and a second part of traffic through the first intermediate component, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster; the first-stage response process corresponding to the first part of traffic is executed through the first service cluster, and the first-stage response process corresponding to the second part of traffic is executed through the second service cluster; if the first-stage response process is executed without abnormality, the online component is switched from the first intermediate component to the second intermediate component, and according to the second preset traffic diversion ratio, the obtained application service traffic is divided into a third part of traffic and a fourth part of traffic; the third part of traffic is diverted to the first service cluster, and the fourth part of traffic is diverted to the second service cluster; the second-stage response process corresponding to the third part of traffic is executed through the first service cluster, and the second-stage response process corresponding to the fourth part of traffic is executed through the second service cluster.

[0107] Among them, the proportion of the fourth part of traffic in the application service traffic is greater than the proportion of the second part of traffic in the application service traffic; the proportion of the third part of traffic in the application service traffic is less than the proportion of the first part of traffic in the application service traffic.

[0108] Furthermore, if the second-stage response process is executed without exception, the online component will be switched from the intermediate component to the second service component, so that the second service component will obtain application service traffic and divert all the obtained application service traffic to the second service cluster according to the server address of the cluster server of the registered second service cluster, thereby switching the online application service cluster from the first service cluster to the second service cluster.

[0109] Furthermore, in the event of an abnormal execution of the first-stage response process, the second service cluster can be suspended or deregistered from the cluster server of the first intermediate component. Since the proportion of the second part of the application service traffic diverted to the second service cluster is less than the first preset traffic proportion, suspending or deregistering the second service cluster from the cluster server of the first intermediate component will basically not affect the operation of the entire application service, and the problem of abnormal execution of the application service response process can also be quickly resolved.

[0110] In this embodiment, the application service traffic is gradually switched from the first service cluster to the second service cluster in two stages. Compared with the method of directly switching all traffic from the first service cluster to the second service cluster, even if an abnormality occurs in the execution of the application service process, it will not cause the entire application service to crash. Therefore, the system stability during the application service cluster switching can be improved.

[0111] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0112] Based on the same inventive concept, the embodiment of the present application also provides an application service cluster switching device for implementing the application service cluster switching method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the one or more application service cluster switching device embodiments provided below can refer to the limitations of the application service cluster switching method above, and will not be repeated here.

[0113] In an exemplary embodiment, Figure 4As shown, an application service cluster switching device is provided, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster; the device includes: a traffic diversion module 502 and a switching module 504, wherein:

[0114] The traffic diversion module 502 is used to execute the traffic diversion steps: switch the online component from the first service component to the intermediate component; obtain application service traffic through the online component, and divide the application service traffic into a first part of traffic and a second part of traffic; divert the first part of traffic to the first service cluster through the intermediate component, and divert the second part of traffic to the second service cluster, and execute the application service response process corresponding to the application service traffic.

[0115] The switching module 504 is configured to switch the online application service cluster from the first service cluster to the second service cluster by switching the online component from the intermediate component to the second service component if the application service response process is executed normally.

[0116] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and the traffic diversion module is further used to:

[0117] Switching the online component from the first service component to the first intermediate component;

[0118] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0119] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0120] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0121] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0122] In one embodiment, the device further comprises:

[0123] A service exception execution module is used to suspend or cancel the cluster server of the second service cluster registered in the first intermediate component if the first stage response process executes abnormally; if the second stage response process executes abnormally, the online component is switched from the second intermediate component to the first service component.

[0124] In one embodiment, the application service response process includes multiple stage response processes, the intermediate component includes multiple stage intermediate components; and the traffic diversion module is further used to:

[0125] Component switching step: switch the online component to the intermediate component;

[0126] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0127] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0128] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0129] In one embodiment, the traffic diversion module is further used for:

[0130] Obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0131] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0132] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0133] Each module in the above-mentioned application service cluster switching device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0134] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store application service traffic data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an application service cluster switching method is implemented.

[0135] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0136] In an exemplary embodiment, a computer device is provided, which is applied to an application service system. The application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster. The first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register the cluster server of the first service cluster and the cluster server of the second service cluster, and the second service component is used to register the cluster server of the second service cluster. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0137] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster and the second part of traffic to the second service cluster through the intermediate component, and executing the application service response process corresponding to the application service traffic;

[0138] If the application service response process is executed without exception, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster.

[0139] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and when the processor executes the computer program, the following steps are also implemented:

[0140] Switching the online component from the first service component to the first intermediate component;

[0141] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0142] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0143] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0144] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0146] If the first-stage response process is executed abnormally, suspending or deregistering the cluster server of the second service cluster registered in the first intermediate component;

[0147] If the second-stage response process is executed abnormally, the online component is switched from the second intermediate component to the first service component.

[0148] In one embodiment, the application service response process includes multiple stage response processes, and the intermediate component includes multiple stage intermediate components; when the processor executes the computer program, the following steps are also implemented:

[0149] Component switching step: switch the online component to the intermediate component;

[0150] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0151] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0152] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0154] Obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0155] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0156] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0157] In one embodiment, a computer-readable storage medium is provided, which is applied to an application service system. The application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster. The first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register the cluster server of the first service cluster and the cluster server of the second service cluster, and the second service component is used to register the cluster server of the second service cluster. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0158] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster and the second part of traffic to the second service cluster through the intermediate component, and executing the application service response process corresponding to the application service traffic;

[0159] If the application service response process is executed without exception, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster.

[0160] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and when the computer program is executed by a processor, the following steps are also implemented:

[0161] Switching the online component from the first service component to the first intermediate component;

[0162] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0163] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0164] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0165] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0167] If the first-stage response process is executed abnormally, suspending or deregistering the cluster server of the second service cluster registered in the first intermediate component;

[0168] If the second-stage response process is executed abnormally, the online component is switched from the second intermediate component to the first service component.

[0169] In one embodiment, the application service response process includes multiple stage response processes, and the intermediate component includes multiple stage intermediate components; when the computer program is executed by the processor, the following steps are also implemented:

[0170] Component switching step: switch the online component to the intermediate component;

[0171] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0172] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0173] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0174] In one embodiment, obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0175] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0176] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0177] In one embodiment, a computer program product is provided, which is applied to an application service system, wherein the application service system includes a first service component, an intermediate component, a second service component, a first service cluster, and a second service cluster, wherein the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register the cluster server of the first service cluster and the cluster server of the second service cluster, and the second service component is used to register the cluster server of the second service cluster; the computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0178] Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster and the second part of traffic to the second service cluster through the intermediate component, and executing the application service response process corresponding to the application service traffic;

[0179] If the application service response process is executed without exception, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster.

[0180] In one embodiment, the application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; and when the computer program is executed by a processor, the following steps are also implemented:

[0181] Switching the online component from the first service component to the first intermediate component;

[0182] Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic;

[0183] If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic;

[0184] The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

[0185] In one embodiment, the fourth portion of traffic accounts for a greater proportion of the application service traffic than the second portion of traffic accounts for the application service traffic; the third portion of traffic accounts for a smaller proportion of the application service traffic than the first portion of traffic accounts for the application service traffic.

[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0187] If the first-stage response process is executed abnormally, suspending or deregistering the cluster server of the second service cluster registered in the first intermediate component;

[0188] If the second-stage response process is executed abnormally, the online component is switched from the second intermediate component to the first service component.

[0189] In one embodiment, the application service response process includes multiple stage response processes, and the intermediate component includes multiple stage intermediate components; when the computer program is executed by the processor, the following steps are also implemented:

[0190] Component switching step: switch the online component to the intermediate component;

[0191] Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed;

[0192] If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally;

[0193] Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0195] Obtaining a first server address of the first service cluster and a second server address of the second service cluster;

[0196] Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information;

[0197] The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

[0198] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0199] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0200] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for switching an application service cluster, characterized in that: Applied to an application service system, the application service system includes a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster; The method comprises: Traffic diversion step: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster and the second part of traffic to the second service cluster through the intermediate component, and executing the application service response process corresponding to the application service traffic; If the application service response process is executed without exception, the online component is switched from the intermediate component to the second service component, and the online application service cluster is switched from the first service cluster to the second service cluster.

2. The method according to claim 1, characterized in that The application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; the traffic diversion step includes: Switching the online component from the first service component to the first intermediate component; Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic; If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic; The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

3. The method according to claim 2, characterized in that The proportion of the fourth part of traffic in the application service traffic is greater than the proportion of the second part of traffic in the application service traffic; The proportion of the third part of traffic in the application service traffic is less than the proportion of the first part of traffic in the application service traffic.

4. The method according to claim 2, characterized in that: The method further comprises: If the first-stage response process is executed abnormally, suspending or deregistering the cluster server of the second service cluster registered in the first intermediate component; If the second-stage response process is executed abnormally, the online component is switched from the second intermediate component to the first service component.

5. The method according to claim 1, characterized in that The application service response process includes multiple stage response processes, and the intermediate component includes multiple stage intermediate components; The flow diversion step comprises: Component switching step: switch the online component to the intermediate component; Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed; If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally; Among them, when the stage traffic diversion step is executed for the Nth time, the traffic proportion of the second part of the traffic in the application service traffic is greater than the traffic proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is executed for the N-1th time; when the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component, and when the stage traffic diversion step is executed from the second to the Nth time, the online component switches between the intermediate components of each stage, and N is a positive integer greater than 1.

6. The method according to claim 1, characterized in that The dividing the application service traffic into a first portion of traffic and a second portion of traffic comprises: Obtaining a first server address of the first service cluster and a second server address of the second service cluster; Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information; The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

7. An application service cluster switching device, characterized in that: Applied to an application service system, the application service system includes a first service component, an intermediate component, a second service component, a first service cluster and a second service cluster, the first service component is used to register a cluster server of the first service cluster, the intermediate component is used to register a cluster server of the first service cluster and a cluster server of the second service cluster, and the second service component is used to register a cluster server of the second service cluster; The device comprises: A traffic diversion module, used to perform traffic diversion steps: switching the online component from the first service component to the intermediate component; obtaining application service traffic through the online component, and dividing the application service traffic into a first part of traffic and a second part of traffic; diverting the first part of traffic to the first service cluster through the intermediate component, and diverting the second part of traffic to the second service cluster, and executing the application service response process corresponding to the application service traffic; The switching module is used to switch the online application service cluster from the first service cluster to the second service cluster by switching the online component from the intermediate component to the second service component if the application service response process is executed normally.

8. The device according to claim 7, characterized in that The application service response process includes a first-stage response process and a second-stage response process; the intermediate component includes a first intermediate component and a second intermediate component; the traffic diversion module is further used to: Switching the online component from the first service component to the first intermediate component; Divide the application service traffic acquired by the first intermediate component into a first portion of traffic and a second portion of traffic, and divert the first portion of traffic to the first service cluster through the first intermediate component, and divert the second portion of traffic to the second service cluster, and execute the first phase response process of the application service traffic; If the first-stage response process is executed without exception, the online component is switched from the first intermediate component to the second intermediate component, and the application service traffic obtained by the second intermediate component is divided into a third part of traffic and a fourth part of traffic; The third portion of traffic is diverted to the first service cluster through the second intermediate component, and the fourth portion of traffic is diverted to the second service cluster, and the second phase response process of the application service traffic is executed.

9. The device according to claim 8, characterized in that The proportion of the fourth part of traffic in the application service traffic is greater than the proportion of the second part of traffic in the application service traffic; The proportion of the third part of traffic in the application service traffic is less than the proportion of the first part of traffic in the application service traffic.

10. The device according to claim 8, characterized in that The device also includes: A service exception execution module is used to suspend or cancel the cluster server of the second service cluster registered in the first intermediate component if the first stage response process executes abnormally; if the second stage response process executes abnormally, the online component is switched from the second intermediate component to the first service component.

11. The device according to claim 7, characterized in that The application service response process includes multiple stage response processes, and the intermediate component includes multiple stage intermediate components; the traffic diversion module is also used for: Component switching step: switch the online component to the intermediate component; Stage traffic diversion step: according to the preset traffic weight information corresponding to the stage intermediate component, the application service traffic obtained by the stage intermediate component is divided into a first part of traffic and a second part of traffic, and the first part of traffic is diverted to the first service cluster, and the second part of traffic is diverted to the second service cluster, and the stage response process of the application service traffic is executed; If the stage response process is executed without exception, returning to execute the component switching step until the multiple stage response processes are all executed or any stage response process is executed abnormally; The proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is performed for the Nth time is greater than the proportion of the second part of the traffic in the application service traffic when the stage traffic diversion step is performed for the N-1th time; When the stage traffic diversion step is executed for the first time, the online component is switched from the first service component to the stage intermediate component. When the stage traffic diversion step is executed for the second to Nth time, the online component switches between the stage intermediate components, where N is a positive integer greater than 1.

12. The device according to claim 7, characterized in that The traffic diversion module is also used for: Obtaining a first server address of the first service cluster and a second server address of the second service cluster; Allocating the first server address and the second server address to the application service traffic according to preset traffic weight information; The application service traffic allocated with the first server address is determined as a first portion of traffic, and the application service traffic allocated with the second server address is determined as a second portion of traffic.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Database main and standby cluster switching method and device, computer equipment and storage medium

    CN114238495A

  • Service switching method, system and device, equipment, storage medium and program product

    CN114416366A

  • Dubbo request gray release method, device and equipment

    CN116582593A

  • Process isolation via application-level blue-green topology

    WO2023009335A1