CN115150400A - Service fault processing method and device, cloud service platform and storage medium - Google Patents

Service fault processing method and device, cloud service platform and storage medium Download PDF

Info

Publication number
CN115150400A
CN115150400A CN202210783636.2A CN202210783636A CN115150400A CN 115150400 A CN115150400 A CN 115150400A CN 202210783636 A CN202210783636 A CN 202210783636A CN 115150400 A CN115150400 A CN 115150400A
Authority
CN
China
Prior art keywords
service
server
service end
weight
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210783636.2A
Other languages
Chinese (zh)
Other versions
CN115150400B (en
Inventor
周广昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202210783636.2A priority Critical patent/CN115150400B/en
Priority claimed from CN202210783636.2A external-priority patent/CN115150400B/en
Publication of CN115150400A publication Critical patent/CN115150400A/en
Application granted granted Critical
Publication of CN115150400B publication Critical patent/CN115150400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The application belongs to the field of a server, and particularly relates to a processing method and device for service failure, a cloud service platform and a storage medium. The method comprises the following steps: acquiring a target service request; determining a first service end in a plurality of service ends for providing service, wherein the plurality of service ends for providing service comprise at least two service ends for processing target service requests; sending a target service request to a first service end; when the first server fails, a second server is determined in a plurality of servers providing services, and a target service request is sent to the second server, wherein the first server and the second server are different servers. The technical scheme includes that a first service end is determined among a plurality of service ends providing services, and when the first service end fails, a target service request is sent to a second service end to achieve the target service request, so that the target service request can be rapidly transferred to the second service end, and the influence on achieving the target service request when the first service end fails is reduced.

Description

Service fault processing method and device, cloud service platform and storage medium
Technical Field
The application belongs to the field of services, and particularly relates to a service fault processing method and device, a cloud service platform and a storage medium.
Background
In the prior art, when a main service end has a fault, the adopted fault processing scheme is a cold standby scheme, and when the main service end which the service request depends on fails, calling the standby service end to realize the service request.
The cold preparation scheme has the following defects: the backup server does not operate when the main service end operates, and operates when the main service fails, because the backup server does not support the service request when the backup server is flat, the capability of taking over the service request when the main service end fails is unknown, the service request cannot be taken over to influence the service request realization, and the backup server cannot ensure the accuracy of the service request realization.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a service fault, a server and a readable storage medium, which can reduce the influence on the realization of a target service request when a first server fails.
In a first aspect, an embodiment of the present application provides a method for processing a service failure, where the method includes:
acquiring a target service request;
determining a first service end in a plurality of service ends for providing services, wherein the plurality of service ends for providing services comprise at least two service ends for processing the target service request;
sending the target service request to the first server;
when the first server fails, a second server is determined in the plurality of servers providing services, the target service request is sent to the second server, and the first server and the second server are different servers.
In a possible implementation manner of the first aspect, the determining a first service end among the plurality of service ends providing services includes:
acquiring the weight of each server in a plurality of servers providing services, and determining the sum of the weights;
generating a random number within the weight and corresponding first range of values;
and determining a first service end according to the random number and the weight of each service end.
Wherein, when the first server fails, determining a second server among the plurality of servers providing services comprises:
when the first server side fails, determining a second server side from each stock server side according to the weight corresponding to each stock server side; the stock server is a server other than the first server among the plurality of servers providing services.
Wherein, when the first server fails, determining a second server among the plurality of servers providing services comprises:
when the first server fails, setting the weight of the first server to 0;
and determining a second server from each server according to the weight corresponding to each server.
After the setting the weight of the first server to 0, the processing method includes:
when detecting whether the fault of the first service end is relieved, adjusting the weight of the first service end to any weight in a second value range corresponding to the initial weight of the service end;
and if the fault of the first service end is removed, adjusting the weight of the first service end to be the initial weight of the service end.
The processing method comprises the following steps:
and when an error response returned by the first service end is received, determining a second service end in the plurality of service ends providing services, and sending the target service request to the second service end.
Before the time when the server fails, the method further comprises the following steps:
determining an error rate when the first service end is called in a counting window or a timing window, and if the error rate is greater than or equal to a preset first threshold, the first service end breaks down;
or;
and determining the timeout rate when the first service end is called in a counting window or a timing window, and if the timeout rate is greater than or equal to a preset second threshold, the first service end fails.
In a second aspect, an embodiment of the present application provides a processing apparatus when a server fails, where the processing apparatus includes:
the acquisition module is used for acquiring a target service request;
a determining module, configured to determine a first service end among a plurality of service providing ends, where the plurality of service providing ends include at least two service ends for processing the target service request;
a sending module, configured to send the target service request to the first server;
and the fault migration module is used for determining a second service end in the plurality of service ends providing services when the first service end has a fault, and sending the target service request to the second service end, wherein the first service end and the second service end are different service ends.
In a third aspect, an embodiment of the present application provides a cloud server, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for processing a service failure according to any one of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the method for processing when a service fails according to any one of the first aspect.
Compared with the prior art, the embodiment of the application has the beneficial effects that: in the technical scheme of the application, the method comprises the following steps, obtaining a target service request; determining a first service end in a plurality of service providing ends, wherein the plurality of service providing ends comprise at least two service ends for processing a target service request; sending a target service request to a first service end; when the first server fails, a second server is determined in a plurality of servers providing services, and a target service request is sent to the second server, wherein the first server and the second server are different servers. The technical scheme includes that a first service end is determined among a plurality of service ends providing services, and when the first service end fails, a target service request is sent to a second service end to achieve the target service request, so that the target service request can be rapidly transferred to the second service end, and the influence on achieving the target service request when the first service end fails is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a processing method for service failure according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for processing service failure according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for determining a first service end according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a processing device in the event of a service failure according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a cloud service platform according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail, and in other instances, specific technical details may be mutually referenced in various embodiments, and a specific system not described in one embodiment may be referenced in other embodiments.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Reference throughout this specification to "one embodiment of the present application" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in other embodiments," "an embodiment of the present application," "other embodiments of the present application," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
In the prior art, when a main service end fails, an adopted fault processing scheme is a cold standby scheme, and when the main service end on which a service request depends fails, a standby service end is called to realize the service request.
The cold preparation scheme has the following defects: the backup server does not operate when the main service end operates, and operates when the main service fails, because the backup server does not support the service request when the backup server is flat, the capability of taking over the service request when the main service end fails is unknown, the service request cannot be taken over to influence the service request realization, and the backup server cannot ensure the accuracy of the service request realization.
In order to solve the above defects, the inventive concept of the present application is:
the plurality of service terminals for providing services comprise at least two service terminals for processing service requests; when the first service end fails, the service request can be migrated to other running service ends in the plurality of service ends, so that the influence on the realization of the service request when the service end fails is reduced, and the accuracy of the realization of the service request is ensured.
In order to explain the technical means of the present application, the following description will be given by way of specific examples.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a service failure processing method according to an embodiment of the present application, and for convenience of description, only a portion related to the present application is shown. The application scenario includes: the cloud service platform 100 comprises a plurality of service terminals 200 for providing services. The plurality of service terminals 200 providing services include a service terminal a, a service terminal B, and a service terminal C.
The cloud service platform 100 is a business computing model that distributes computing tasks over a resource pool of a large number of computers, enabling various application systems to obtain computing power, storage space, and various software services as needed. The cloud service platform is a metaphor of a network and the internet, and resources in the cloud service platform can be infinitely expanded, can be obtained at any time, can be used as required and can be expanded at any time.
The plurality of service terminals 200 for providing services include a service terminal a, a service terminal B, and a service terminal C, and certainly, the plurality of service terminals 200 for providing services in the embodiment of the present application may further include more service terminals, and the number of the service terminals is not limited in the embodiment of the present application. The plurality of service terminals 200 providing services only appear to the client as one service terminal. The multiple service terminals 200 providing services can utilize multiple computers to perform parallel computation, so as to obtain a high computation speed, and also can use multiple computers to perform backup, so that any one service terminal fails, and the multiple service terminals 200 providing services in the whole system can also operate normally. The plurality of service terminals 200 for providing services are configured to process service requests issued by the cloud service platform.
The cloud service platform 100 in the embodiment of the application is used for migrating a service request to other running servers when a fault occurs in the service request processing at the server.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for processing a service failure according to an embodiment of the present disclosure. The execution subject of the method in fig. 2 may be the cloud service platform 100 in fig. 1. As shown in fig. 2, the method includes: s201 to S204.
S201, the cloud service platform obtains a target service request.
Specifically, the target service request includes a short message service request, a mail service request, an object storage service request, and the like, and the type of the target service request is not limited in the embodiment of the present application.
The embodiment of the application acquires the target service request through the cloud service platform.
S202, the cloud service platform determines a first service end from a plurality of service ends providing services.
Specifically, the plurality of service terminals providing services include at least two service terminals for processing the target service request.
In this embodiment, each of the multiple service terminals providing services is configured to process a service request simultaneously, for example, while the service terminal a processes the service request 1, the service terminal B processes the service request 2, and the service terminal C processes the service request 3. In the embodiment of the present application, a server that is processing a service request is referred to as a first server.
In the embodiment of the application, after the cloud service platform acquires the target service request, a first service end is determined in a plurality of service ends providing services through a weight load algorithm, and the target service request is processed by the first service end.
In some embodiments, the cloud service platform determines the first service end according to a load of each of a plurality of service ends providing services. In the embodiment of the application, the load includes not only the load of the central processing unit, but also the pressure of the current service end. The pressure of the current server can be obtained by calculating parameters such as Input/Output (I/O) utilization rate and network card throughput.
In some embodiments, the cloud service platform determines the first service end according to response time of each processor service end in a plurality of service ends providing services. For example: the cloud service platform can preferentially distribute the target service request to the service end with the fastest response, and the service end is determined to be the first service end.
In some embodiments, please refer to fig. 3, a method for determining a first server among a plurality of servers providing services. Fig. 3 is a schematic flowchart of a method for determining a first service end according to an embodiment of the present application. The execution subject of the method in fig. 3 may be the cloud service platform 100 in fig. 1. As shown in fig. 3, the method includes: s301 to S303.
S301, the cloud service platform obtains the weight of each service end in a plurality of service ends providing services, and determines the sum of the weights.
Specifically, the cloud service platform configures a weight for each of a plurality of service terminals providing services in advance. For example: the weight pre-allocated to server a is 2, the weight pre-allocated to server B is 3, and the weight pre-allocated to server C is 5.
In this embodiment of the present application, the weights configured by the cloud service platform for each processor in the multiple service terminals providing services in advance may be the same or different, and this is not limited in this embodiment of the present application. The embodiments of the present application are exemplified by different configuration weights.
In the embodiment of the application, the weight configured by each server needs to be set according to the condition that the cloud service platform calls the server, for example, the stability of the server, the calling delay and the like are the more stable the server is, the shorter the calling delay is, the higher the configuration weight of the server is, the more unstable the server is, the longer the calling delay is, and the lower the configuration weight of the server is.
After the cloud service platform obtains the weight of each service end in a plurality of service ends for providing services, the weight sum is calculated. For example, the calculated weight sum is 10.
S302, the cloud service platform generates a random number in the weight and the corresponding first numerical range.
Specifically, the cloud service platform generates a random number within the weight and the corresponding first numerical range. The weight and the corresponding first numerical range in the embodiments of the present application refer to the first numerical range with the weight and the weight as the upper limit value and 0 as the lower limit value. For example: the weight and corresponding first range of values are [0, 10], and the generated random number is 5.
S303, the cloud service platform determines the first service end according to the random number and the weight of each service end.
Specifically, the cloud service platform may generate a server list according to the weight of each server. Illustratively, the server list may be AABBBCCCCC. In other embodiments, the server list may be abacbbccc. The embodiment of the present application does not limit the sequence of the server in the server list.
In this embodiment of the application, the cloud service platform may determine the first service end according to the random number and the service end list in S302, for example: if the generated random number in S302 is 5 and the server list is AABBBCCCCC, the server B is determined to be the first server.
In an embodiment of the present application, the cloud service platform determines the first service end according to the service end list and the sequence of the service end list, for example: the server list is AABBBCCCCC, and A, A, B, B, B, C, C, C, C, C is respectively determined as the first server according to the list sequence.
S203, the cloud service platform sends a target service request to the first service end.
Specifically, the cloud service platform sends a target service request to the first service end determined in S202 to implement the target service.
In the embodiment of the present application, a cloud service platform needs to detect whether a first service end fails at any time, and in the embodiment of the present application, a method for detecting that a first service end fails by a cloud service platform is as follows:
1. the cloud service platform determines an error rate when the first service end is called in a counting window or a timing window, and if the error rate is larger than or equal to a preset first threshold value, the first service end breaks down.
In the embodiment of the present application, the error rate refers to a ratio of the number of times of error of calling the first service end to the total number of times of error.
For example: setting 100 times of calling the first service end as a counting window second, and determining that the error rate is 58% when the first service end is called in the counting window if the number of times of calling the first service end by the cloud service platform in the counting window is 58 times of errors.
Another example is: and setting the timing window to be 10 seconds, calling the first service end for 100 times by the cloud service platform within 10 seconds, and determining that the error rate is 49% when the first service end is called within the preset time length if the error times are 49 times.
In the embodiment of the application, the preset first threshold may be set according to the importance degree of the target service, the size of the preset first threshold is inversely proportional to the importance degree of the target service, the more important the target service is, the smaller the preset first threshold is, the less important the target service is, and the larger the preset first threshold is.
2. The cloud service platform determines the timeout rate when the first service end is called in the counting window or the timing window, and if the timeout rate is larger than or equal to a preset second threshold value, the first service end breaks down.
In this embodiment of the present application, the timeout rate refers to a ratio of the number of times of calling the first service end is timed out to the total number of times.
For example: setting 100 times of calling the first server as a counting window, and if the overtime frequency of calling the first server in the counting window by the cloud service platform is 58 times, determining that the overtime rate is 58% when the first server is called in the counting window.
Another example is: and setting the timing window to be 10 seconds, calling the first service end for 100 times by the cloud service platform within 10 seconds, and determining that the timeout rate is 49% when the first service end is called within the preset time length if the timeout times are 49 times.
In the embodiment of the present application, a setting method of the preset second threshold is the same as a setting method of the preset first threshold, and details are not repeated here.
In the existing cold standby method, the method for determining whether the server fails is as follows: the method for determining whether the server fails has a low false positive rate and a low policy false positive rate compared with the prior art, and effectively avoids frequent fault migration caused by the fact that the first server cannot be called occasionally.
S204, when the first server fails, the cloud service platform determines a second server in the plurality of servers providing services, and sends a target service request to the second server.
Specifically, the first service end and the second service end are different service ends.
In this embodiment of the present application, when a first service end fails, the failure needs to be migrated to another service end of a plurality of service ends providing services, and a specific migration method includes:
1. and when the first server side fails, determining a second server side from all stock server sides according to the weight corresponding to each stock server side.
Specifically, the stock server is a server other than the first server among the plurality of servers providing services. Illustratively, the plurality of service terminals providing services include the service terminals A, B and C, and when a first service terminal (the service terminal B) fails, the service terminal a and the service terminal C may be referred to as inventory service terminals.
In the embodiment of the application, when the first server fails, the second server is determined from each stock server only according to the weight corresponding to the stock server. In the implementation of the present application, the method for determining the second service end from each stock service end is the same as the method for determining the first service end from the plurality of service ends providing services, and details are not described here again.
2. When the first service end fails, setting the weight of the first service end to be 0; and determining a second server from each server according to the weight corresponding to each server.
For example, when the server B fails, the weight 3 of the server B is set to 0, and the second server is determined from each server according to the corresponding weight of each server (the weight of the server a is 2, the weight of the server B is 0, and the weight of the server C is 5). In the embodiment of the present application, a method for determining a second service end from each service end is the same as a method for determining a first service end from a plurality of service ends providing services, and details are not repeated here.
In the fault migration method in the prior art, the backup server is started only when the server fails, and the backup server does not usually perform service processing, so that the timeliness of fault recovery and the accuracy of the recovered service cannot be guaranteed. According to the fault migration method, the service ends in the plurality of service ends carry out service processing all at ordinary times, and when one service end in the plurality of service ends breaks down, the fault can be quickly migrated to the other service end, so that the fault can be timely recovered, and the accuracy of the service after the fault is recovered is ensured.
The embodiment of the present application further provides a method for service migration, including: when an error response returned by the first server is received, a second server is determined in the plurality of servers providing services, and a target service request is sent to the second server.
Specifically, when the cloud service platform sends a target service request to the first service end, and the first service end cannot process the target service request due to factors such as too large load, too large pressure, saturated utilization rate, or too large network card throughput, an error response is returned to the cloud service platform, and when the cloud service platform receives the error response returned by the first service end, a second service end is determined among the plurality of service ends providing services, and the target service request is sent to the second service end. The method for determining a second server among the multiple servers providing services and sending the target service request to the second server is the same as S204, and is not described herein again.
The service migration method provided by the embodiment of the application can send the target service request to the second service end after the first service end returns the error response, so that the target service can be realized without damage, and the realization of the target service is not influenced by the error response.
In this embodiment of the present application, after detecting a failure of the first service end, that is, after setting the weight of the first service end to 0, the processing method includes:
and when detecting whether the fault of the first service end is relieved, adjusting the weight of the first service end to any weight in a second value range corresponding to the initial weight of the service end.
Specifically, when detecting whether the failure of the first service end is resolved, the cloud service platform does not determine whether the failure of the first service end is truly resolved, and first adjusts the weight of the first service end to a weight value smaller than the initial weight. Namely, the weight of the first service end is adjusted to any weight in a second value range corresponding to the initial weight of the service end.
The second numerical range corresponding to the initial weight in the embodiment of the present application is a numerical range in which the initial weight is the upper limit value and 0 is the lower limit value. For example: the initial weight corresponds to a first range of values of [0,3]. Illustratively, any weight within the second range of values corresponding to the initial weight is 2.
The method and the device for adjusting the weight of the first service end to any weight in the second numerical range corresponding to the initial weight of the service end are used for enabling the first service end to receive a small number of service requests on the premise of not determining whether the fault of the first service end is removed or not so as to avoid the situation that the implementation of the target service is influenced when the fault of the first service end is not removed.
If the fault of the first service end is removed, the weight of the first service end is adjusted to be the initial weight of the service end.
For example, if the failure of the first server is resolved, the weight 0 of the first server is adjusted to the initial weight 3 of the first server.
The method for the cloud service platform to determine whether the first service end relieves the fault comprises the following steps:
if the error rate of the cloud service terminal when the first service terminal is called in the counting window or the timing window is smaller than a preset first threshold value, or the timeout rate of the cloud service terminal when the first service terminal is called in the counting window or the timing window is smaller than a preset second threshold value, the first service terminal removes the fault.
In summary, in the technical solution of the present application, the target service request is obtained; determining a first service end in a plurality of service ends for providing service, wherein the plurality of service ends for providing service comprise at least two service ends for processing target service requests; sending a target service request to a first service end; when the first server fails, a second server is determined in a plurality of servers providing services, and a target service request is sent to the second server, wherein the first server and the second server are different servers. The technical scheme includes that a first service end is determined among a plurality of service ends providing services, and when the first service end fails, a target service request is sent to a second service end to achieve the target service request, so that the target service request can be rapidly transferred to the second service end, and the influence on achieving the target service request when the first service end fails is reduced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a processing device when a server fails according to an embodiment of the present application, where the processing device includes:
the obtaining module 41 is configured to obtain the target service request.
The determining module 42 is configured to determine a first service end among a plurality of service providing ends, where the plurality of service providing ends include at least two service ends for processing the target service request.
A sending module 43, configured to send the target service request to the first service end.
The failure migration module 44 is configured to determine a second server among the multiple servers providing services when the first server fails, and send a target service request to the second server, where the first server and the second server are different servers.
The determining module 42 is further configured to obtain a weight of each of the multiple service terminals providing the service, and determine a weight sum;
generating a random number within the weight and corresponding first range of values;
and determining the first service end according to the random number and the weight of each service end.
The fault migration module 44 is further configured to, when the first server fails, determine a second server from each stock server according to the weight corresponding to each stock server; the stock server is a server other than the first server among the plurality of servers providing services.
The failure migration module 44 is further configured to determine a second service end among the multiple service ends providing the service when receiving the error response returned by the first service end, and send the target service request to the second service end.
The failure migration module 44 is further configured to set the weight of the first service end to 0 when the first service end fails;
and determining a second server from each server according to the weight corresponding to each server.
The device also includes:
an adjusting module 45, configured to adjust the weight of the first service end to any weight within a second value range corresponding to the initial weight of the service end when detecting whether the failure of the first service end is resolved;
and if the fault of the first service end is removed, adjusting the weight of the first service end to be the initial weight of the service end.
Wherein, the device still includes:
a failure determining module 46, configured to determine an error rate when the first service end is called in the counting window or the timing window, and if the error rate is greater than or equal to a preset first threshold, a failure occurs in the first service end;
or;
and determining the timeout rate when the first service terminal is called in the counting window or the timing window, and if the timeout rate is greater than or equal to a preset second threshold, the first service terminal fails.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules, so as to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
As shown in fig. 5, the cloud service platform 200 according to the embodiment of the present application further includes a memory 21, a processor 22, and a computer program 23 stored in the memory 21 and executable on the processor 22, where the processor 22 implements the processing method when the service fails according to the foregoing embodiments when executing the computer program 23.
The Processor 22 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the cloud service platform 200. The memory 21 may also be an external storage device of the cloud service platform 200, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the cloud service platform 200. Further, the memory 21 may also include both an internal storage unit and an external storage device of the cloud service platform 200. The memory 21 is used to store computer programs and other programs and data required by the cloud service platform 200. The memory 21 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the processing method for service failure in the foregoing embodiments is implemented.
The embodiment of the present application provides a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the processing method for service failure in the foregoing embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer memory, read-only memory (ROM), random Access Memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In some jurisdictions, computer-readable storage media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and proprietary practices.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present application, and they should be construed as being included in the present application.

Claims (10)

1. A processing method for service failure is characterized in that the processing method comprises the following steps:
acquiring a target service request;
determining a first service end in a plurality of service ends for providing services, wherein the plurality of service ends for providing services comprise at least two service ends for processing the target service request;
sending the target service request to the first server;
when the first server fails, a second server is determined in the plurality of servers providing services, the target service request is sent to the second server, and the first server and the second server are different servers.
2. The processing method according to claim 1, wherein the determining a first service among the plurality of services providing services comprises:
acquiring the weight of each server in a plurality of servers providing services, and determining the sum of the weights;
generating a random number within the weight and corresponding first range of values;
and determining a first service end according to the random number and the weight of each service end.
3. The processing method according to claim 2, wherein the determining a second server among the plurality of servers providing services when the first server fails comprises:
when the first server side fails, determining a second server side from each stock server side according to the weight corresponding to each stock server side; the stock server is a server except the first server in the plurality of servers providing services.
4. The processing method according to claim 2, wherein the determining a second server among the plurality of servers providing services when the first server fails comprises:
when the first server fails, setting the weight of the first server to 0;
and determining a second server from each server according to the weight corresponding to each server.
5. The processing method according to claim 4, wherein after the setting of the weight of the first server to 0, the processing method comprises:
when detecting whether the fault of the first service end is relieved, adjusting the weight of the first service end to any weight in a second value range corresponding to the initial weight of the service end;
and if the fault of the first service end is removed, adjusting the weight of the first service end to be the initial weight of the service end.
6. The processing method according to claim 1, further comprising, before the time when the first server fails:
when an error response returned by the first service terminal is received, a second service terminal is determined in the plurality of service terminals providing services, and the target service request is sent to the second service terminal.
7. The processing method according to claim 1, further comprising, before the time when the first server fails:
determining an error rate when the first service end is called in a counting window or a timing window, and if the error rate is greater than or equal to a preset first threshold, the first service end breaks down;
or;
determining the timeout rate when the first service end is called in a counting window or a timing window, and if the timeout rate is greater than or equal to a preset second threshold, the first service end fails.
8. A processing apparatus for service failure, the processing apparatus comprising:
the acquisition module is used for acquiring a target service request;
a determining module, configured to determine a first service end among a plurality of service providing ends, where the plurality of service providing ends include at least two service ends for processing the target service request;
a sending module, configured to send the target service request to the first server;
and the fault migration module is used for determining a second service end in the plurality of service ends providing services when the first service end has a fault, and sending the target service request to the second service end, wherein the first service end and the second service end are different service ends.
9. A cloud service platform comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method for handling a service failure according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a method of handling a service failure according to any one of claims 1 to 7.
CN202210783636.2A 2022-07-05 Service fault processing method and device, cloud service platform and storage medium Active CN115150400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210783636.2A CN115150400B (en) 2022-07-05 Service fault processing method and device, cloud service platform and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210783636.2A CN115150400B (en) 2022-07-05 Service fault processing method and device, cloud service platform and storage medium

Publications (2)

Publication Number Publication Date
CN115150400A true CN115150400A (en) 2022-10-04
CN115150400B CN115150400B (en) 2024-04-30

Family

ID=

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5828847A (en) * 1996-04-19 1998-10-27 Storage Technology Corporation Dynamic server switching for maximum server availability and load balancing
US20020169889A1 (en) * 2001-04-26 2002-11-14 Chu-Sing Yang Zero-loss web service system and method
WO2005122472A1 (en) * 2004-06-14 2005-12-22 Huawei Technologies Co., Ltd. A method for realizing the reliability guarantee of end-to-end quality of service
CN109558246A (en) * 2018-12-04 2019-04-02 北京字节跳动网络技术有限公司 A kind of load-balancing method, device, electronic equipment and storage medium
CN110401568A (en) * 2019-07-31 2019-11-01 普联技术有限公司 A kind of method for discovering network topology and equipment
CN110502326A (en) * 2019-08-27 2019-11-26 珠海格力电器股份有限公司 The method and terminal device of cloud service scheduling and recovery based on fault detection
CN112039710A (en) * 2020-09-02 2020-12-04 曙光信息产业(北京)有限公司 Service fault processing method, terminal device and readable storage medium
CN113268329A (en) * 2021-05-31 2021-08-17 北京奇艺世纪科技有限公司 Request scheduling method, device and storage medium
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform
CN114598711A (en) * 2022-03-29 2022-06-07 百果园技术(新加坡)有限公司 Data migration method, device, equipment and medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5828847A (en) * 1996-04-19 1998-10-27 Storage Technology Corporation Dynamic server switching for maximum server availability and load balancing
US20020169889A1 (en) * 2001-04-26 2002-11-14 Chu-Sing Yang Zero-loss web service system and method
WO2005122472A1 (en) * 2004-06-14 2005-12-22 Huawei Technologies Co., Ltd. A method for realizing the reliability guarantee of end-to-end quality of service
CN109558246A (en) * 2018-12-04 2019-04-02 北京字节跳动网络技术有限公司 A kind of load-balancing method, device, electronic equipment and storage medium
CN110401568A (en) * 2019-07-31 2019-11-01 普联技术有限公司 A kind of method for discovering network topology and equipment
CN110502326A (en) * 2019-08-27 2019-11-26 珠海格力电器股份有限公司 The method and terminal device of cloud service scheduling and recovery based on fault detection
CN112039710A (en) * 2020-09-02 2020-12-04 曙光信息产业(北京)有限公司 Service fault processing method, terminal device and readable storage medium
CN113268329A (en) * 2021-05-31 2021-08-17 北京奇艺世纪科技有限公司 Request scheduling method, device and storage medium
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform
CN114598711A (en) * 2022-03-29 2022-06-07 百果园技术(新加坡)有限公司 Data migration method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张锦华: "《网络信息安全监察与防御对策研究》", vol. 1, 北京工业大学出版社, pages: 48 - 49 *

Similar Documents

Publication Publication Date Title
CN110138756B (en) Current limiting method and system
US20170126583A1 (en) Method and electronic device for bandwidth allocation based on online media services
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
CN105516347A (en) Method and device for load balance allocation of streaming media server
CN110795284B (en) Data recovery method, device and equipment and readable storage medium
CN112965823B (en) Control method and device for call request, electronic equipment and storage medium
CN111159195A (en) Data storage control method and equipment in block chain system
CN110868323B (en) Bandwidth control method, device, equipment and medium
CN113517985A (en) File data processing method and device, electronic equipment and computer readable medium
CN111538572A (en) Task processing method, device, scheduling server and medium
CN112653632A (en) Flow control realization method and device
CN112506619B (en) Job processing method, job processing device, electronic equipment and storage medium
CN113742389A (en) Service processing method and device
CN115150400A (en) Service fault processing method and device, cloud service platform and storage medium
CN115150400B (en) Service fault processing method and device, cloud service platform and storage medium
CN115952003A (en) Method, device, equipment and storage medium for cluster server load balancing
CN116382892A (en) Load balancing method and device based on multi-cloud fusion and cloud service
CN115190180A (en) Method and device for scheduling network resource request during sudden increase of network resource request
CN111092959B (en) Request processing method, system and related device for servers in cluster
CN114374657A (en) Data processing method and device
CN114296869A (en) Server node service method and device based on TCP long connection
US9479579B2 (en) Grouping processing method and system
CN113395319A (en) Method, system, electronic device and storage medium for sensing network fault
TW202215262A (en) Reverse proxy method and storage device with delay sensing and load balancing
CN113055199A (en) Gateway access method and device and gateway equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant