A failover method, device and storage medium

By installing service traffic proxy modules on both the client and server sides, a mapping relationship between applications and services is established, enabling cross-cluster failover. This solves the problem of insufficient service failover capability in cross-network and multi-cluster environments in existing technologies, reduces hardware resources and network overhead, and improves service response efficiency and user-friendliness.

CN118802483BActive Publication Date: 2025-11-28CHINA MOBILE GRP GUANGDONG CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410563764.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-11-28
Estimated Expiration
2044-05-08

AI Technical Summary

Technical Problem

Existing technologies lack the ability to failover services in cross-network, multi-cluster environments, leading to increased network overhead, high development and maintenance complexity, and the inability to achieve cross-cluster failover.

Method used

By introducing a service access management module, a policy configuration module, and a traffic proxy module, a correspondence between application information and service information is established, enabling cross-cluster failover. This avoids the use of load balancing components and allows for failover by directly installing the service traffic proxy module on both the client and server sides.

Benefits of technology

It enables cross-cluster failover, reduces hardware and network overhead, lowers development and maintenance workload, improves service response efficiency and user-friendliness, and solves the problems of complexity and heavy workload in cross-cluster failover in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802483B_ABST
    Figure CN118802483B_ABST
Patent Text Reader

Abstract

The present disclosure provides a failover method, device and storage medium. The method comprises: a service access management module determining at least one service information corresponding to application information; the application information indicating an application, and the service information indicating a service end server for implementing a service call request, an address of a service instance capable of responding to the service call request, and a port of the service instance capable of responding to the service call request; the service access management module determining a target rule and configuring the target rule, the application information and the service information to a service traffic proxy module through a service strategy configuration module; the target rule being used to determine whether a service instance currently responding to the service call request is faulty, determine a maximum connection number of the service end server, and determine a failover rule; and the service traffic proxy module implementing failover based on the target rule, the application information and the service information. The method of the present disclosure can reduce the complexity of failover and improve the efficiency of failover.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of service failover, and in particular to a failover method, device and storage medium. BACKGROUND

[0002] In the current network management service system, the scale and quantity of servers are growing, and the complexity is also increasing. Such complexity can lead to various failures, such as network failure, server failure, etc. In order to ensure the reliability and availability of the network management service system, service failover is usually implemented when the network management service system fails in a complex environment, so as to ensure that the service can be accurately performed. SUMMARY

[0003] To overcome the problems in the related art, the present disclosure provides a failover method, device, electronic equipment and computer readable storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a failover method is provided, applied to a failover device, the device comprising a service access management module, a service policy configuration module, and a service traffic proxy module; wherein the method comprises:

[0005] The service access management module determines one or more service information corresponding to at least one application information; the application information is used to indicate an application, and the service information corresponding to the application information indicates at least one of the following: a service end server for implementing a service call request sent by the application, an address corresponding to a service instance in the service end server capable of responding to the service call request, and a port corresponding to the service instance in the service end server capable of responding to the service call request;

[0006] The service access management module determines a target rule, and sends at least one of the target rule, application information, and service information to the service policy configuration module; the target rule is used for at least one of the following: determining whether a service instance currently responding to the service call request is faulty, determining the maximum number of connections of the service end server load, and determining a rule during failover;

[0007] The service policy configuration module configures at least one of the target rule, application information, and service information to the service traffic proxy module; the service traffic proxy module is installed in at least one of a client, a unified shared gateway of different clusters, and a service end server of different clusters;

[0008] The service traffic proxy module implements failover based on at least one of the target rule, application information, and service information, and / or the service traffic proxy module manages the load of the service end server based on the target rule.

[0009] According to a second aspect of the embodiments of the present disclosure, a failover device is provided, the device comprising a service access management module, a service policy configuration module, a service traffic proxy module; wherein

[0010] The service access management module is configured to determine one or more service information corresponding to at least one application information; the application information is used to indicate an application, and the service information corresponding to the application information indicates at least one of the following: a service end server for implementing a service call request sent by the application, an address corresponding to a service instance in the service end server capable of responding to the service call request, and a port corresponding to the service instance in the service end server capable of responding to the service call request.

[0011] The service access management module is further configured to determine a target rule, and send at least one of the target rule, the application information, and the service information to the service policy configuration module; the target rule is used to at least one of the following: determine whether a service instance currently responding to the service call request is faulty, determine a maximum number of connections of a load of the service end server, and determine a rule during failover.

[0012] The service policy configuration module is configured to configure at least one of the target rule, the application information, and the service information to the service traffic proxy module; and the service traffic proxy module is installed in at least one of a client, a unified shared gateway of different clusters, and a service end server of different clusters.

[0013] The service traffic proxy module is configured to implement failover based on at least one of the target rule, the application information, and the service information, and / or the service traffic proxy module is configured to manage a load of the service end server based on the target rule.

[0014] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:

[0015] a processor;

[0016] a memory for storing processor-executable instructions;

[0017] The processor is configured to implement the method of the first aspect.

[0018] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, the computer-readable storage medium stores computer-executable instructions; the computer-executable instructions are executed by a processor to implement the method of the first aspect.

[0019] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects:

[0020] First, in the embodiments of the present disclosure, the correspondence between the application information and the service information is introduced, so that the failover device can know which service instances can implement the service call request of which application, thereby decoupling the application program from the network environment. Compared with the scheme in the related art that "when failover is performed for a client, a load balancing component for failover needs to be introduced in the application program, and the corresponding logic and code need to be implemented by interfacing with the load balancing component", in the embodiments of the present disclosure, the application program is decoupled from the network environment, so that the load balancing component does not need to be introduced for the application program, and the corresponding logic and code do not need to be implemented by interfacing with the load balancing component, thereby reducing the hardware resource overhead. Moreover, the failover device in the embodiments of the present disclosure can also serve as a platform-independent service that can be independently run, without any modification to the deployed application code, thereby reducing the development and operation workload.

[0021] Second, in the embodiments of the present disclosure, the load balancing component is not used when failover is performed, so that the situation that "the service call request of a client in a cluster needs to enter from a load balancing component outside the cluster, so as to use the load balancing component to achieve the purpose of failover" does not occur, thereby avoiding unnecessary network overhead.

[0022] Third, in the embodiments of the present disclosure, the service information corresponding to the application information can include the addresses and / or ports of the service instances in different clusters that can respond to the service call request, so that when the service instance in the current cluster fails, the service call request can be distributed to the service instances in different clusters based on the correspondence between the application information and the service information, thereby implementing the cross-cluster failover function and solving the problem that the service cannot be failovered or the failover process is complex and laborious in the existing cross-network and multi-cluster environment.

[0023] Fourth, in the embodiments of the present disclosure, the service traffic proxy module for implementing failover is installed in the client, the unified shared gateway in different clusters, and the server in different clusters. When the situation that "the service call request to the unified shared gateway is in a normal state, but the access from the unified shared gateway to the server is unavailable" occurs, the service traffic proxy module installed in the server can implement failover for the unavailability of the server, thereby avoiding the situation that "when the service call request to the unified shared gateway is in a normal state, but the access from the unified shared gateway to the server is unavailable, the service call request still reaches the unavailable service, resulting in failure to complete the normal request response", ensuring the successful response and response efficiency of the service.

[0024] In addition, for the fourth point described above, it needs to be emphasized that in the scheme of the present disclosure, global load balancing can also be optionally set, wherein the service call request initiated by the user through the application can flow from the global load balancing to the unified shared gateway in the container cloud through the failover device of the present disclosure, and the detailed introduction about this part is prior art, which will not be repeated here. When the unified shared gateway fails, the unified shared gateway can forward the service call request to the service traffic proxy module of the target service server of the other cluster which has not failed and can implement the service requested by the service call request through the service traffic proxy module, so that the target service server can successfully implement the service requested by the service call request, realizing transparent failover, and thereafter, the service response information of the target service server to the service call request can also be returned to the client in turn, thereby forming a complete service chain.

[0025] Fifthly, the service monitoring and analysis module in the embodiment of the present disclosure can provide a visual interface for configuration, monitoring and management operation of the accessed services, thereby improving the friendliness of user use and reducing the complexity of configuration.

[0026] Sixthly, the service traffic proxy module and the service monitoring and analysis module in the embodiment of the present disclosure can realize traffic management and real-time monitoring and analysis between services, not only realizing fast failover, but also enabling the user to accurately locate the fault node based on the visual interface of the service monitoring and analysis module, so as to maintain the fault node for subsequent service successful response. Moreover, the service traffic proxy module and the service monitoring and analysis module in the embodiment of the present disclosure can also monitor and manage the traffic between platform services, solving the problems of service call confusion and lack of management and control.

[0027] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0028] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.

[0029] Figure 1 is a schematic diagram of a failover method in the related art according to some embodiments of the present disclosure;

[0030] Figure 2 is a scenario diagram when the service call request calls the provider service through the unified shared gateway, and the method of the related art cannot realize failover if a failure occurs, according to some embodiments of the present disclosure;

[0031] Figure 3 is a flowchart of a failover method according to some embodiments of the present disclosure;

[0032] Figure 4 is a schematic diagram of a failover scenario when a unified shared gateway invocation service fails according to some embodiments of the present disclosure;

[0033] Figure 5 is a flowchart of a failover method according to some embodiments of the present disclosure;

[0034] Figure 6A is a schematic diagram of a service traffic proxy module sending first information to a service monitoring analysis module according to some embodiments of the present disclosure;

[0035] Figure 6B is a schematic diagram of link information of an abnormal request according to some embodiments of the present disclosure;

[0036] Figure 7 is a schematic diagram of a 5-minute granularity request number curve according to some embodiments of the present disclosure;

[0037] Figure 8 is a schematic diagram of a 5-minute granularity abnormal response number curve according to some embodiments of the present disclosure;

[0038] Figure 9 is a schematic diagram of a 5-minute granularity response average latency curve according to some embodiments of the present disclosure;

[0039] Figure 10 is a schematic diagram of a 5-minute granularity service CPU usage rate curve according to some embodiments of the present disclosure;

[0040] Figure 11 is a schematic diagram of a 5-minute granularity service memory usage rate curve according to some embodiments of the present disclosure;

[0041] Figure 12 is a schematic diagram of a structure of a failover apparatus according to some embodiments of the present disclosure;

[0042] Figure 13 a schematic block diagram of an example electronic device 1300 that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0043] Some embodiments of the present disclosure will be described in detail herein with reference to the drawings, in which the examples are illustrated. The following description is made in connection with the drawings, in which the same numbers in different drawings represent the same or similar elements unless otherwise described. Various changes, modifications, and equivalents of the methods, devices, and / or systems described herein will become apparent to those skilled in the art after understanding the present disclosure. For instance, the order of the operations described herein is merely examples, and is not limited to those set forth herein, but can be changed as will be apparent after understanding the present disclosure, except for operations that must be performed in a certain order. In addition, the description of features known in the art can be omitted for the sake of clarity and brevity.

[0044] The implementations described in some embodiments of the present disclosure do not represent all implementations consistent with the present disclosure. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0045] Optionally, the service failover of the related art is mainly for the failover of services within a single cluster, services in a single network environment, and the implementation of the service failover technology mainly has two kinds: server-side failover and client-side failover. The server-side failover is divided into hardware failover and software failover, and the hardware failover mainly installs a load balancing device with failover capability between servers. The software failover needs to install load balancing software with failover function between servers to realize failover. The client-side failover is to realize failover by relying on a load balancing component. Among them, Figure 1 is a schematic diagram of a failover method in the related art according to some embodiments of the present disclosure, as shown in Figure 1 When the client-side failover, a load balancing component will be installed on the client, which can be used to determine whether the server server (server server can also be referred to as server service in Figure 1 ) currently responding to the service call request of the client fails, and when the failure occurs, the service call request is distributed to other server servers that do not fail and can respond to the service call request to realize failover. And as shown in Figure 1 When the server-side failover, a load balancing program will be installed between the server servers, which can be used to determine whether the server server currently responding to the service call request of the client fails, and when the failure occurs, the service call request is distributed to other server servers that do not fail and can respond to the service call request to realize failover.

[0046] But the service failover method of the related art mainly has the following shortcomings:

[0047] First, the current network management service takes all service call request traffic through the upper layer load balancer (i.e., the aforementioned load balancing component, load balancing program, etc.), and forwards the service call request to the corresponding target service server. However, as the number of services taken over continues to grow, service failover in a cross-network, multi-cluster environment is particularly important. The existing load balancer, through the inter-cluster traffic switching function, is only applicable to the entire cluster failure problem, such as manually modifying the load balancer configuration to switch traffic to another normal cluster when a cluster fails, but cannot provide cross-cluster failover capability for a specific service, such as the ability to "switch the service call request of a service server from the current failed cluster to another normal cluster when a service server in the cluster fails, to use the service server in another normal cluster to implement the service call request". Moreover, based on the existing traffic switching function, in order to make the core service not affect business production in abnormal situations, the service call request of the client in the cluster needs to enter from the load balancer outside the cluster, which also increases unnecessary network overhead.

[0048] Second, the existing client failover needs to introduce a load balancing component in the application program, and needs to interface with the load balancing component to implement the corresponding logic and code, and the server failover also needs additional hardware resources to support the load balancing program, which greatly increases the complexity of development and maintenance. Moreover, both methods lack unified management control and monitoring mechanisms, which increases additional overhead and increases the complexity of management and control, and cannot be uniformly deployed.

[0049] Third, the server failover capability is limited; specifically, the load balancing program is set between different clusters, i.e., outside the cluster, and the client service call request needs to further call the service inside the cluster after accessing the unified shared gateway inside the cluster through the load balancing program, such as calling the provider service through the unified shared gateway, wherein if a failure occurs when calling the provider service through the unified shared gateway, since the unified shared gateway and the provider service do not have a load balancing program, failover cannot be achieved, resulting in service call failure. For example, Figure 2 is a scenario diagram illustrating that the related art method cannot achieve failover when a service call request calls a provider service through a unified shared gateway, according to some embodiments of the present disclosure, as shown in Figure 2 When the provider service in the cross-network, multi-cluster environment in the multi-cloud environment fails, taking the container cloud A cluster as an example, when the load balancing program to the unified shared gateway is in a normal state, and the unified shared gateway to the provider service (the provider service is Figure 2When the service information (svc-A) in the service information list is unavailable, the service call request will still reach the unavailable service due to the lack of load balancing procedure between the unified shared gateway and the provider service, resulting in the failure to complete the normal request response. An optional solution to the above problem is to use a load balancing procedure for each provider service to solve the failover problem, but this requires additional hardware resources to support the load balancing procedure for each load balancing procedure, which increases the complexity of the link, network overhead and additional configuration workload in a complex environment across networks and multiple clusters.

[0050] Based on this, the present disclosure proposes a failover method.

[0051] Figure 3 is a flowchart of a failover method according to some embodiments of the present disclosure, as shown in Figure 3 The method can include the following steps:

[0052] In step 301, the service access management module determines one or more service information corresponding to at least one application information.

[0053] Optionally, the service access management module can determine one or more service information corresponding to at least one application information through the input of the user. Specifically, the user can input the application information of different applications and one or more service information corresponding to different applications on the visual interface of the service access management module.

[0054] The application information can be used to indicate an application. In some embodiments, the application information includes at least one of the following:

[0055] The Chinese name of the application;

[0056] The English name of the application;

[0057] The namespace of the application. Optionally, the namespace of the application can be used to isolate the application information and divide the occupied resources;

[0058] The description of the application;

[0059] The contact of the application;

[0060] The contact phone number of the application;

[0061] The contact email of the application;

[0062] For example, the application information can be in the form of the table in Table 1 as follows.

[0063] Table 1

[0064] Item Describe app_name_cn Chinese name of the application app_name English name of the application namespace Namespace of the application, used for isolation and resource partitioning app_desc Description of the application linkman Contact of the application phone Contact phone of the application mail Contact email of the application

[0065] Optionally, the service information corresponding to the application information can indicate at least one of the following: one or more service-side servers for implementing a service invocation request sent by an application indicated by the application information, an address of a service instance in each service-side server that can specifically respond to the service invocation request, and a port of the service instance in each service-side server that can specifically respond to the service invocation request. One service-side server can include one or more service instances, and different service instances in the same service-side server can be used to respond to the same or different service invocation requests.

[0066] In some embodiments, the service information can include at least one of the following:

[0067] an application name corresponding to the service-side server;

[0068] a Chinese name of the service-side server;

[0069] an English name of the service-side server;

[0070] an address of a service instance in the service-side server that can respond to the service invocation request;

[0071] a port of the service instance in the service-side server that can respond to the service invocation request.

[0072] In an example, the service information can be in the form of a table as shown in Table 2.

[0073] Table 2

[0074]

[0075] Optionally, after the service access management module determines the application information and the service information, the application information and the service information can be stored persistently.

[0076] In step 302, the service access management module determines a target rule and sends at least one of the target rule, the application information, and the service information to the service policy configuration module.

[0077] Optionally, the service access management module can determine the target rule through input of a user. Specifically, the user can input the target rule on a visual interface of the service access management module.

[0078] Optionally, the target rule can be used for at least one of the following: determining whether a service instance of a service-side server currently responding to a service invocation request is faulty, determining a maximum number of connections of a service-side server load, and determining a rule for failover.

[0079] Specifically, the target rule can include at least one of the first rule, the second rule, and the third rule. The first rule, the second rule, and the third rule are introduced respectively as follows.

[0080] The first rule can be used to determine whether a service instance of a server-side server currently responding to a service call request is faulty, and different server-side servers correspond to the first rule. Optionally, the first rule can include at least one of the following:

[0081] An identifier of a server-side server corresponding to the first rule;

[0082] When a response time of a service instance of the server-side server to the service call request exceeds a preset time, a service exception of the service instance of the server-side server is recorded once;

[0083] When an abnormal status code is returned by the service instance of the server-side server to the service call request, a service exception of the service instance of the server-side server is recorded once; for example, the abnormal status code can include 500 server internal error, 502 service gateway error, 503 service unavailable, and 504 service gateway timeout.

[0084] When a number of service exceptions of the service instance of the server-side server within a preset time window reaches a preset threshold, it is determined that the service instance of the server-side server is faulty.

[0085] For example, the first rule can be in the form of a table in Table 3 as follows.

[0086] Table 3

[0087]

[0088] Optionally, the second rule can be used to determine a maximum number of connections of a server-side server, and different server-side servers correspond to the second rule. The second rule can include at least one of the following:

[0089] An identifier of a server-side server corresponding to the second rule;

[0090] A maximum number of connections of the server-side server to a single client;

[0091] A total maximum number of connections of the server-side server;

[0092] When a number of connections established by a single client to the server-side server reaches the maximum number of connections of the single client, the single client is responded to refuse to establish a connection;

[0093] When a total number of connections established by the server-side server to clients reaches the total maximum number of connections, all the clients are responded to refuse to establish a connection.

[0094] In an example, the second rule can be in the form of a table as shown in Table 4.

[0095] Table 4

[0096]

[0097] Optionally, a third rule can be used to determine the rule during failover, and different service-side servers correspond to the third rule. The third rule can include at least one of the following:

[0098] an identifier of the service-side server corresponding to the third rule;

[0099] at least one service instance corresponding to the service-side server;

[0100] a weight corresponding to the service instance;

[0101] a round robin strategy, which is used to distribute service call requests (i.e., service call requests that cannot be responded to due to the failure of the service instance) to service instances of different clusters or different service instances of the same cluster based on the round robin strategy when the service instance of the service-side server fails;

[0102] a weighted round robin strategy, which is used to distribute service call requests to service instances of different clusters or different service instances of the same cluster based on the weights of different service instances when the service instance of the service-side server fails;

[0103] a minimum connection number strategy, which is used to load balance according to the connection status of each service instance of the service-side server to distribute service call requests to a service instance with the least current connection number, which can be understood as a service instance with the least current service processing requirement.

[0104] In an example, the third rule can be in the form of a table as shown in Table 5.

[0105] Table 5

[0106]

[0107]

[0108] Optionally, when the service access management module determines the target rule, the target rule can be stored persistently. When the service strategy configuration module receives at least one of the target rule, the application information, and the service information from the service access management module, at least one of the target rule, the application information, and the service information is also stored persistently.

[0109] In step 303, the service policy configuration module configures the target rule to the service traffic proxy module.

[0110] Optionally, the service traffic proxy module can be installed in at least one of a client, a unified shared gateway of different clusters, and a server of different clusters. The different clusters may, for example, include a container cloud cluster and a virtualized cloud cluster, that is, the service traffic proxy module can be installed in the unified shared gateway and the server of the container cloud cluster and the virtualized cloud cluster.

[0111] Optionally, in some embodiments, the service policy configuration module can configure the target rule to the service traffic proxy module in the following manner. Specifically, the service policy configuration module can convert the target rule into CRD definition information through a custom resource definition (CRD) (such as a kubernetes (K8s) custom resource) extension mechanism, create the generated CRD definition information in K8s, and the service traffic proxy module in each cluster can obtain the CRD definition information of the target rule through an application programming interface (API) SERVER interface of K8s.

[0112] It should be noted that, in some embodiments, in addition to sending the target rule to the service traffic proxy module, the service policy configuration module can also configure the state information of the server corresponding to the target rule to the service traffic proxy module. The method of the service policy configuration module configuring the state information of the server corresponding to the target rule to the service traffic proxy module is similar to the method of the service policy configuration module configuring the target rule to the service traffic proxy module, and will not be described here.

[0113] Optionally, the following is an example introduction to the CRD definition information of the target rule and the CRD definition information of the state information of the server corresponding to the target rule.

[0114] For example, the CRD definition information of the state information of the server corresponding to the target rule can be as follows:

[0115]

[0116]

[0117] For example, the CRD definition information of the first rule in the target rule can be as follows:

[0118]

[0119] The CRD definition information of the second rule in the target rule may be, for example:

[0120]

[0121]

[0122] The CRD definition information of the third rule in the target rule may be, for example:

[0123]

[0124] In addition, it also needs to be explained that the service policy configuration module can also update the CRD definition information corresponding to the target rule and the state information described above to the service traffic proxy module, and the service traffic proxy module can listen to whether the CRD definition information is updated through the controller of the CRD, once updated, the local configuration cache of the service traffic proxy module will be reloaded and refreshed, and no operation is required for the service container instance, so as to realize the update configuration of the target rule and the state information.

[0125] In step 304, the service traffic proxy module implements failover based on at least one of the target rule, the application information, and the service information, and / or the service traffic proxy module manages the load of the service-side server based on the target rule.

[0126] Optionally, the method of implementing failover based on at least one of the target rule, the application information, and the service information described above can include:

[0127] Determine whether the service instance currently responding to the service call request fails based on the first rule in the target rule;

[0128] If it is determined that the service instance currently responding to the service call request fails, determine other service instances capable of responding to the service call request based on the target rule and one or more service information corresponding to the application information corresponding to the application sending the service call request, and distribute the service call request to the other service instances. For example, a plurality of service instances capable of responding to the service call request can be determined based on one or more service information corresponding to the application information corresponding to the application sending the service call request, and the other service instance for responding to the service call request can be determined in the plurality of service instances based on the third rule in the target rule. The other service instance is a non-failed service instance. Then, the service call request can be distributed to the other service instance, so that the other service instance provides the service requested by the client in the service call request, thereby realizing transparent failover.

[0129] Optionally, the load management of the service-side server based on the target rule described above can include:

[0130] determining, based on the second rule in the target rule, whether the number of connections established by the single client to the service-side server reaches the maximum number of connections of the single client connection service, and when the maximum number of connections of the single client connection service is reached, responding to the single client to refuse to establish a connection; and / or

[0131] determining, based on the second rule in the target rule, whether the total number of connections established by the service-side server and the client reaches the total maximum number of connections, and when the total maximum number of connections is reached, responding to all clients to refuse to establish a connection.

[0132] To sum up, the failover method provided by the embodiments of the present disclosure can achieve the following beneficial effects:

[0133] Firstly, in the embodiments of the present disclosure, the correspondence between the application information and the service information is introduced, so that the failover device can know which service instances can implement the service call request of which application, and thus the application program and the network environment can be decoupled. Compared with the scheme in the related art that "when the failover is performed for the client, a load balancing component for failover needs to be introduced in the application program, and the corresponding logic and code need to be implemented by interfacing with the load balancing component", in the embodiments of the present disclosure, the application program and the network environment are decoupled, so that the load balancing component does not need to be introduced for the application program, and thus the corresponding logic and code do not need to be implemented by interfacing with the load balancing component, thereby reducing the hardware resource overhead. Moreover, the failover device in the embodiments of the present disclosure can also serve as a platform-independent service that can be independently run, without any modification to the deployed application program code, thereby reducing the development and operation workload.

[0134] Secondly, in the embodiments of the present disclosure, the load balancing component is not used when the failover is performed, so that the situation that "the service call request of the client in the cluster needs to enter from the load balancing component outside the cluster, so as to use the load balancing component to achieve the purpose of failover" does not occur, thereby avoiding unnecessary network overhead.

[0135] Thirdly, in the embodiments of the present disclosure, the service information corresponding to the application information can include the addresses and / or ports of the service instances in different clusters that can respond to the service call request, and thus when the service instance in the current cluster fails, the service call request can be distributed to the service instances in different clusters based on the correspondence between the application information and the service information, thereby realizing the cross-cluster failover function and solving the problem that the service cannot be failed over or the failover process is complex and laborious in the existing cross-network and multi-cluster environment.

[0136] Fourth, in the embodiments of the present disclosure, the service traffic proxy module for implementing failover is installed in the client, the unified shared gateway of different clusters, and the server of different clusters. When the service calling request from the unified shared gateway to the server is unavailable, the service traffic proxy module installed in the server can implement failover for the unavailable server, thereby avoiding the situation that the service calling request still reaches the unavailable server when the service calling request from the unified shared gateway to the server is unavailable, and ensuring the successful response and response efficiency of the service. Figure 4 is a schematic diagram of a failover scenario when the unified shared gateway calls a service according to some embodiments of the present disclosure, as shown in Figure 4 User traffic flows into each cluster through global load balancing (GSLB) and calls the server A (or server A) through the unified shared gateway. When the unified shared gateway service of the container cloud A cluster fails, the service traffic proxy module installed in the unified shared gateway of the container cloud A cluster can distribute the service calling request to the server A of the virtualized cloud cluster to implement failover. Alternatively, when the unified shared gateway service of the container cloud B cluster fails, the service traffic proxy module installed in the unified shared gateway of the container cloud B cluster can distribute the service calling request to the server A of the virtualized cloud cluster to implement failover. Figure 4 The "traffic proxy module" in the above is equivalent to the "service traffic proxy module" in the present disclosure.

[0137] In addition, for the fourth point described above, it should be emphasized that in the scheme of the present disclosure, the global load balancing can also be optionally set. The service calling request initiated by the user through the application can flow from the global load balancing to the unified shared gateway in the container cloud through the failover device of the present disclosure. The details of this part are related to the prior art, and will not be described here. When the unified shared gateway fails, the unified shared gateway can forward the service calling request to the service traffic proxy module of the target server of the other cluster through the service traffic proxy module. The target server has not failed and can implement the service requested by the service calling request. Therefore, the target server can successfully implement the service requested by the service calling request, implement transparent failover, and the service response information of the target server to the service calling request can also be returned to the client in turn, thereby forming a complete service chain.

[0138] Fifthly, the service monitoring and analysis module can provide a visual interface to configure, monitor and manage the accessed services, thereby improving the user-friendliness and reducing the complexity of configuration.

[0139] Sixthly, the service flow proxy module and the service monitoring and analysis module can realize flow management and real-time monitoring and analysis among services, not only can realize fast fault transfer, but also can make the user accurately locate the fault node based on the visual interface of the service monitoring and analysis module, so as to maintain the fault node for subsequent service successful response. Moreover, the service flow proxy module and the service monitoring and analysis module can also monitor and manage the flow among platform services, solve the problem of chaotic service call and lack of management and control.

[0140] Figure 5 is a flow chart of a fault transfer method according to some embodiments of the present disclosure, as shown in Figure 5 The method comprises the following steps:

[0141] In step 501, the service access management module determines one or more service information corresponding to at least one application information.

[0142] In step 502, the service access management module determines a target rule, and sends at least one of the target rule, the application information and the service information to the service policy configuration module.

[0143] In step 503, the service policy configuration module configures at least one of the target rule, the application information and the service information to the service flow proxy module.

[0144] In step 504, the service flow proxy module realizes fault transfer based on at least one of the target rule, the application information and the service information, and / or the service flow proxy module manages the load of the service server based on the target rule.

[0145] For detailed introduction of steps 501-504, please refer to the introduction of steps 301-304 above.

[0146] In step 505, when the service flow proxy module determines that the service server responds abnormally to the service call request, the first information is sent to the service monitoring and analysis module.

[0147] Optionally, the first information can include at least one of the following: a service call request identification ID, a link identification ID of the current link, a link identification parent ID of the current link, response state information of the service call request, client information, service traffic proxy module information (for example, an Internet Protocol (IP) of the service traffic proxy module, a port of the service traffic proxy module, etc.), information of a server-side server that responds abnormally to the service call request, and cluster information to which the server-side server that responds abnormally to the service call request belongs.

[0148] In some embodiments, Figure 6A is a schematic diagram of a service traffic proxy module sending first information to a service monitoring analysis module according to some embodiments of the present disclosure; wherein, Figure 6A “traffic proxy module” in the above can correspond to “service traffic proxy module” in the present disclosure, Figure 6A “request information and resource state reporting” in the above can correspond to “service traffic proxy module sending first information to service monitoring analysis module” in the present disclosure.

[0149] In step 506, the service monitoring analysis module performs visual display based on the first information.

[0150] Optionally, the visual display performed by the service monitoring analysis module based on the first information can implement the following functions:

[0151] A user can query link information of service exceptions in the visual interface of the service monitoring analysis module through the service call request identification ID, view specific abnormal nodes, and click the abnormal nodes to view node information details. At the same time, the service monitoring analysis module can use visual curve charts to display service request times, service abnormal response times, service response average time delay, service Central Processing Unit (CPU) occupancy, service memory occupancy, etc. by analyzing the first information.

[0152] Optionally, Figure 6B is a schematic diagram of link information of abnormal requests according to some embodiments of the present disclosure; Figure 7 is a schematic diagram of a 5-minute granularity request times curve according to some embodiments of the present disclosure; Figure 8 is a schematic diagram of a 5-minute granularity abnormal response times curve according to some embodiments of the present disclosure; Figure 9 is a schematic diagram of a 5-minute granularity response average time delay curve according to some embodiments of the present disclosure; Figure 10 is a schematic diagram of a 5-minute granularity service CPU usage rate curve according to some embodiments of the present disclosure; Figure 11Fig. 5 is a schematic diagram of a 5-minute granularity service memory usage curve according to some embodiments of the present disclosure.

[0153] In summary, the failover method provided by the embodiments of the present disclosure can achieve the following beneficial effects:

[0154] First, in the embodiments of the present disclosure, the correspondence between the application information and the service information is introduced, so that the failover device can know which service instances can implement service call requests of which applications, and thus the application program and the network environment can be decoupled. Compared with the scheme in the related art that "when failover is performed for a client, a load balancing component for failover needs to be introduced in the application program, and the corresponding logic and code need to be implemented by interfacing with the load balancing component", in the embodiments of the present disclosure, the application program and the network environment are decoupled, so that the load balancing component does not need to be introduced for the application program, and thus the corresponding logic and code do not need to be implemented by interfacing with the load balancing component, thereby reducing the hardware resource overhead. Moreover, the failover device in the embodiments of the present disclosure can also serve as a platform-independent service that can be independently run, without any modification to the deployed application code, thereby reducing the development and operation workload.

[0155] Second, in the embodiments of the present disclosure, the load balancing component is not needed when failover is performed, so that the situation that "service call requests of clients in a cluster need to enter from a load balancing component outside the cluster, so as to use the load balancing component to achieve the purpose of failover" does not occur, thereby avoiding unnecessary network overhead.

[0156] Third, in the embodiments of the present disclosure, the service information corresponding to the application information can include addresses and / or ports of service instances in different clusters that can respond to service call requests, and thus when a service instance in a current cluster fails, the service call request can be distributed to service instances in different clusters based on the correspondence between the application information and the service information, thereby implementing the cross-cluster failover function and solving the problem that services cannot be failovered or the failover process is complex and labor-intensive in the existing cross-network and multi-cluster environment.

[0157] Fourth, in the embodiments of the present disclosure, the service flow proxy module for implementing failover is installed in the client, the unified shared gateway of different clusters, and the server of different clusters. When the situation that "the service call request to the unified shared gateway is in a normal state, and the access from the unified shared gateway to the server is unavailable" occurs, the service flow proxy module installed in the server can implement failover for the unavailable server, thereby avoiding the situation that "when the service call request to the unified shared gateway is in a normal state, and the access from the unified shared gateway to the server is unavailable, the service call request still reaches the unavailable server, resulting in failure to complete the normal request response", ensuring successful response and response efficiency of the service.

[0158] Fifth, the service monitoring and analysis module can provide a visual interface to configure, monitor, and manage the accessed services, thereby improving the user-friendly degree and reducing the complexity of configuration.

[0159] Sixth, the service flow proxy module and the service monitoring and analysis module in the embodiments of the present disclosure can implement flow management and real-time monitoring and analysis between services, not only enabling fast failover, but also enabling the user to accurately locate the fault node based on the visual interface of the service monitoring and analysis module, so as to maintain the fault node for subsequent maintenance, thereby ensuring successful response of subsequent services. In addition, the service flow proxy module and the service monitoring and analysis module in the embodiments of the present disclosure can also monitor and manage the flow between platform services, thereby solving the problems of chaotic service call and lack of management and control.

[0160] Figure 12 is a structural schematic diagram of a failover device according to some embodiments of the present disclosure, as shown in Figure 12 The device includes a service access management module, a service policy configuration module, and a service flow proxy module.

[0161] The service access management module determines one or more service information corresponding to at least one application information. The application information is used to indicate an application, and the service information corresponding to the application information indicates at least one of the following: a server capable of responding to the service call request sent by the application, an address corresponding to a service instance in the server capable of responding to the service call request, and a port corresponding to the service instance in the server capable of responding to the service call request.

[0162] The service access management module determines a target rule, and sends at least one of the target rule, application information, and service information to a service policy configuration module; the target rule is used for at least one of the following: determining whether a service instance currently responding to the service call request is faulty, determining a maximum number of connections of a load of the service end server, and determining a rule during failover;

[0163] The service policy configuration module configures at least one of the target rule, the application information, and the service information to a service traffic proxy module; the service traffic proxy module is installed in at least one of a client, a unified shared gateway of different clusters, and a service end server of different clusters;

[0164] The service traffic proxy module is used to implement failover based on at least one of the target rule, the application information, and the service information, and / or the service traffic proxy module is used to manage a load of the service end server based on the target rule.

[0165] In summary, the failover device provided in the embodiments of the present disclosure can achieve the following beneficial effects:

[0166] First, in the embodiments of the present disclosure, the correspondence between the application information and the service information is introduced, so that the failover device can know which service instances can implement service call requests of which applications, and thus the application program and the network environment can be decoupled. Compared with the scheme in the related art that "when failover is performed for a client, a load balancing component for failover needs to be introduced in an application program, and needs to be connected to the load balancing component to implement corresponding logic and code", in the embodiments of the present disclosure, the application program and the network environment are decoupled, so that the load balancing component does not need to be introduced for the application program, and thus the load balancing component does not need to be connected to implement the corresponding logic and code, thereby reducing the hardware resource overhead. Moreover, the failover device in the embodiments of the present disclosure can also serve as a platform-independent service that can be independently run, without any modification to the deployed application program code, thereby reducing the development and operation workload.

[0167] Second, in the embodiments of the present disclosure, the load balancing component does not need to be used during failover, so that the situation that "service call requests of a client in a cluster need to enter from a load balancing component outside the cluster, so as to use the load balancing component to achieve the purpose of failover" does not occur, thereby avoiding unnecessary network overhead.

[0168] Third, in the embodiments of the present disclosure, the service information corresponding to the application information can include the address and / or port of the service instance of different clusters that can respond to the service call request, so that if the service instance of the current cluster fails, the service call request can be distributed to the service instance of the different cluster based on the correspondence between the application information and the service information, thereby realizing the cross-cluster failover function and solving the problem of complex and large workload of failover process between services in the existing cross-network, multi-cluster environment.

[0169] Fourth, in the embodiments of the present disclosure, the service flow proxy module for realizing failover is installed in the client, the unified shared gateway of different clusters, and the server of different clusters, so that when the situation that "the service call request to the unified shared gateway is in a normal state, but the access from the unified shared gateway to the server is unavailable" occurs, the service flow proxy module installed in the server can realize failover for the unavailability of the server, thereby avoiding the situation that "when the service call request to the unified shared gateway is in a normal state, but the access from the unified shared gateway to the server is unavailable, the service call request still reaches the unavailable service, resulting in failure to complete the normal request response", ensuring successful response and response efficiency of the service.

[0170] Fifth, the service monitoring and analysis module can provide a visual interface to configure, monitor and manage the accessed services, thereby improving the user-friendly degree and reducing the complexity of configuration.

[0171] Sixth, the service flow proxy module and the service monitoring and analysis module in the embodiments of the present disclosure can realize traffic management and real-time monitoring and analysis between services, not only realizing fast failover, but also enabling the user to accurately locate the fault node based on the visual interface of the service monitoring and analysis module, so as to maintain the fault node for subsequent maintenance, thereby ensuring successful response of subsequent services. Moreover, the service flow proxy module and the service monitoring and analysis module in the embodiments of the present disclosure can also monitor and manage the traffic between platform services, thereby solving the problem of chaotic service call and lack of management and control.

[0172] Optionally, the application information includes at least one of:

[0173] a Chinese name of the application;

[0174] an English name of the application;

[0175] a namespace of the application;

[0176] a description of the application;

[0177] a contact of the application;

[0178] a contact phone number of the application;

[0179] a contact email address of the application;

[0180] the service information comprises at least one of:

[0181] an application name corresponding to the service-side server;

[0182] a Chinese name of the service-side server;

[0183] an English name of the service-side server;

[0184] an address corresponding to a service instance in the service-side server that can respond to the service invocation request;

[0185] a port corresponding to a service instance in the service-side server that can respond to the service invocation request.

[0186] Optionally, the target rule comprises at least one of:

[0187] a first rule for determining whether a service instance currently responding to the service invocation request is faulty;

[0188] a second rule for determining a maximum number of connections of the service-side server load;

[0189] a third rule for determining a rule during failover.

[0190] Optionally, different service-side servers correspond to a first rule respectively, and the first rule comprises at least one of:

[0191] an identifier of the service-side server corresponding to the first rule;

[0192] when a response time of a service instance of the service-side server to the service invocation request exceeds a preset time, recording that a service instance of the service instance of the service-side server occurs a service exception once;

[0193] when an abnormal status code is returned by the service instance of the service-side server to the service invocation request, recording that the service instance of the service instance of the service-side server occurs a service exception once;

[0194] when a number of service exceptions of the service instance of the service-side server reaches a preset threshold within a preset time window, determining that the service instance of the service-side server is faulty; and

[0195] Optionally, different service-side servers correspond to a second rule respectively, and the second rule comprises at least one of:

[0196] an identifier of a server corresponding to the second rule;

[0197] a maximum number of connections of the server for a single client;

[0198] a total maximum number of connections of the server;

[0199] when a number of connections established by a single client with the server reaches the maximum number of connections of the server for the single client, responding to the single client with a refusal to establish a connection;

[0200] when a total number of connections established by the server with clients reaches the total maximum number of connections, responding to all clients with a refusal to establish a connection; and

[0201] different servers correspond to third rules respectively, the third rules comprising at least one of:

[0202] an identifier of a server corresponding to the third rule;

[0203] at least one service instance corresponding to the server;

[0204] a weight corresponding to the service instance;

[0205] a round robin strategy, the round robin strategy being used to distribute the service invocation request to service instances of different clusters or different service instances of the same cluster based on the round robin strategy when a service instance of the server fails;

[0206] a weighted round robin strategy, the weighted round robin strategy being used to distribute the service invocation request to service instances of different clusters or different service instances of the same cluster based on weights of different service instances when a service instance of the server fails;

[0207] a minimum connection number strategy, the minimum connection number strategy being used to distribute the service invocation request to a service instance with the least current connection number according to connection conditions of each service instance of the server when a service instance of the server fails.

[0208] Optionally, the service flow proxy module is further used to:

[0209] determine whether a service instance currently responding to the service invocation request is faulty based on the target rule;

[0210] If it is determined that the service instance currently responding to the service invocation request is faulty, based on the target rule and one or more service information corresponding to the application sending the service invocation request, determine other service instances that can respond to the service invocation request and are not faulty, and distribute the service invocation request to the other service instances.

[0211] Optionally, the service traffic proxy module is further configured to:

[0212] determine, based on the target rule, whether the number of connections established by the single client to the server-side server reaches the maximum number of single-client connection services, and when the maximum number of single-client connection services is reached, respond to the single client with a refusal to establish a connection; and / or

[0213] determine, based on the target rule, whether the total number of connections established by the server-side server and the client reaches the total maximum number of connections, and when the total maximum number of connections is reached, respond to all clients with a refusal to establish a connection.

[0214] Optionally, the apparatus further comprises:

[0215] a service monitoring and analysis module, configured to, when the service traffic proxy module determines that the server-side server responds abnormally to the service invocation request, receive first information sent by the service monitoring and analysis module, the first information comprising at least one of: a service invocation request identification ID, a link identification ID of a current link, a link identification parent ID of the current link, response state information of the service invocation request, client information, service traffic proxy module information, information of the server-side server responding abnormally to the service invocation request, and information of a cluster to which the server-side server responding abnormally to the service invocation request belongs.

[0216] based on the first information, perform visual display.

[0217] Figure 13 A schematic block diagram of an example electronic device 1300 that can be used to implement embodiments of the present disclosure is shown. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present disclosure described and / or claimed herein.

[0218] As Figure 13As shown, the electronic device 1300 includes a computing unit 1301 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 1302 or a computer program loaded into a random access memory (RAM) 1303 from a storage unit 1308. Various programs and data required for the operation of the electronic device 1300 can also be stored in the RAM 1303. The computing unit 1301, the ROM 1302, and the RAM 1303 are connected to each other through a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0219] Various components in the electronic device 1300 are connected to the I / O interface 1305, including an input unit 1306 such as a keyboard, a mouse, etc., an output unit 1307 such as various types of displays, a speaker, etc., a storage unit 1308 such as a magnetic disk, an optical disk, etc., and a communication unit 1309 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1309 allows the electronic device 1300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0220] The computing unit 1301 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1301 performs various methods and processes described above, such as the network evaluation method. For example, in some embodiments, the network evaluation method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 1308. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1300 via the ROM 1302 and / or the communication unit 1309. When the computer program is loaded into the RAM 1303 and executed by the computing unit 1301, one or more steps of the network evaluation method described above can be performed. Alternatively, in other embodiments, the computing unit 1301 can be configured to perform the network evaluation method by any other appropriate means, such as by means of firmware.

[0221] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0222] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0223] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0224] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0225] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0226] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS (Virtual Private Server, or VPS for short) services. The server can also be a server of a distributed system, or a server combined with a blockchain.

[0227] According to embodiments of the present disclosure, the present disclosure also provides a vehicle. The vehicle includes the electronic device according to any one of the preceding embodiments, or the dual-electric-drive system of the vehicle according to any one of the preceding embodiments.

[0228] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technology disclosed in the present disclosure are achieved, which is not limited herein.

[0229] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A failover method, characterized in that, Applied in a failover device, the device includes a service access management module, a service policy configuration module, and a service traffic proxy module; wherein, the method includes: The service access management module determines one or more service information corresponding to at least one application information; the application information is used to indicate the application, and the service information corresponding to the application information indicates at least one of the following: the server that implements the service call request sent by the application, the address of the service instance in the server that can respond to the service call request, and the port of the service instance in the server that can respond to the service call request. The service access management module determines the target rule and sends at least one of the target rule, application information, and service information to the service policy configuration module; the target rule is used for at least one of the following: determining whether the service instance currently responding to the service call request is faulty, determining the maximum number of connections under the server load, and determining the rules for failover. The service policy configuration module configures at least one of the target rules, application information, and service information to the service traffic proxy module; the service traffic proxy module is installed in at least one of the client, the unified shared gateway of different clusters, and the server-side server of different clusters. The service traffic proxy module implements failover based on at least one of the target rules, application information, and service information. Specifically, it determines whether the service instance currently responding to the service call request is faulty based on the target rules. If it is determined that the service instance currently responding to the service call request is faulty, it determines other service instances that can respond to the service call request and are not faulty based on the target rules and one or more service information corresponding to the application that sent the service call request, and allocates the service call request to the other service instances.

2. The method as described in claim 1, characterized in that, The application information includes at least one of the following: The Chinese name of the application; The English name of the application; The application's namespace; Application description; Contacts for the application; The application's contact number; The application's contact email address; The service information includes at least one of the following: The application name corresponding to the server; The Chinese name of the server; The English name of the server; The address of the service instance in the server that can respond to service call requests; The port corresponding to the service instance in the server that can respond to service call requests.

3. The method as described in claim 1, characterized in that, The target rule includes at least one of the following: The first rule is used to determine whether the service instance currently responding to the service call request is faulty; The second rule is used to determine the maximum number of connections that the server can handle. The third rule is used to determine the rules for failover.

4. The method as described in claim 3, characterized in that, Different server-side servers each correspond to the first rule, and the first rule includes at least one of the following: The identifier of the server corresponding to the first rule; When the response time of the service instance of the server to the service call request exceeds a preset time, a service exception is recorded as occurring in the service instance of the server. When the service instance of the server returns an exception status code in response to the service call request, record that the service instance of the server has experienced a service exception. When the number of service exceptions of the server instance reaches a preset threshold within a preset time window, it is determined that the server instance has failed. as well as Different server-side servers correspond to the second rule, and the second rule includes at least one of the following: The identifier of the server corresponding to the second rule; The maximum number of connections the server can provide to a single client connection. The total maximum number of connections for the server. When the number of connections established between a single client and the server has reached the maximum number of connections a single client can connect to, the server will respond to the single client by refusing to establish a connection. When the total number of connections established between the server and clients reaches the maximum number of connections, the server will respond to all clients by refusing to establish a connection; and Different server-side servers correspond to a third rule, and the third rule includes at least one of the following: The identifier of the server corresponding to the third rule; At least one service instance corresponding to the server-side server; The weight corresponding to the service instance; Polling strategy; The polling strategy is used to: when a service instance of the server fails, allocate the service call request to service instances in different clusters or different service instances in the same cluster based on the polling strategy; Weighted round-robin strategy; The weighted round-robin strategy is used to: when a service instance of the server fails, allocate the service call request to service instances in different clusters or different service instances in the same cluster based on the weights of the different service instances; The minimum number of connections strategy is used to: when a service instance of the server fails, perform load balancing based on the connection status of each service instance of the server, so as to allocate the service call request to the service instance with the fewest current connections.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: The service traffic proxy module manages the load of the server based on the target rules.

6. The method according to any one of claims 1-4, characterized in that, The management of the server load based on the target rules includes: Based on the target rule, determine whether the number of connections established between a single client and the server has reached the maximum number of connections a single client can connect to the service. If the maximum number of connections is reached, respond to the single client by refusing to establish a connection; and / or Based on the target rule, determine whether the total number of connections established between the server and the client has reached the maximum number of connections. When the maximum number of connections is reached, respond to all clients by refusing to establish a connection.

7. The method as described in claim 1, characterized in that, The method further includes; When the service traffic proxy module determines that the server responds abnormally to the service call request, it sends first information to the service monitoring and analysis module. The first information includes at least one of the following: service call request identifier ID, current link identifier ID, current link link identifier parent ID, response status information of the service call request, client information, service traffic proxy module information, information of the server that responds abnormally to the service call request, and cluster information of the server that responds abnormally to the service call request. The service monitoring and analysis module displays the information visually based on the first information.

8. A failover device, characterized in that, The device includes a service access management module, a service policy configuration module, and a service traffic proxy module; wherein... The service access management module is used to determine one or more service information corresponding to at least one application information; the application information is used to indicate the application, and the service information corresponding to the application information indicates at least one of the following: the server that implements the service call request sent by the application, the address of the service instance in the server that can respond to the service call request, and the port of the service instance in the server that can respond to the service call request. The service access management module is also used to determine target rules and send at least one of the target rules, application information, and service information to the service policy configuration module; the target rules are used for at least one of the following: determining whether the service instance currently responding to the service call request is faulty, determining the maximum number of connections under the server load, and determining the rules for failover. The service policy configuration module is used to configure at least one of the target rules, application information, and service information to the service traffic proxy module; the service traffic proxy module is installed in at least one of the client, the unified shared gateway of different clusters, and the server-side server of different clusters; The service traffic proxy module is used to implement failover based on at least one of the target rules, application information, and service information. Specifically, it determines whether the service instance currently responding to the service call request is faulty based on the target rules. If it is determined that the service instance currently responding to the service call request is faulty, it determines other service instances that can respond to the service call request and are not faulty based on the target rules and one or more service information corresponding to the application that sent the service call request, and allocates the service call request to the other service instances.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer-executable instructions; wherein the computer-executable instructions, when executed by a processor, are capable of implementing the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • High availability method and device for Redis cluster

    CN110224871A

  • Fault transfer method, device and equipment and readable storage medium

    CN111314117A