Processing method and device for service and electronic equipment

By monitoring the service status in the gateway and setting interface marking information, the fuse state is achieved, and the system instability caused by service instability in the data request processing system is solved, which improves system stability and reduces management costs.

CN120475074APending Publication Date: 2025-08-12CSC FINANCIAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510766812.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The stability of the entire system is affected due to unstable or unavailable services in the data request processing system. The existing circuit breaker mechanism is single and cannot be linked to external systems, which increases management costs.

Method used

When the gateway receives a request, it monitors the operating status of the target service, sets the interface to unavailable tag information, and cuts off communication when all interfaces meet the conditions, realizes the fuse state, reduces system instability, and sends alarm information to the management system.

Benefits of technology

It improves the stability of the data request processing system, reduces the overall system instability caused by the instability of a single service, and reduces management costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120475074A_ABST
    Figure CN120475074A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a service processing method and device and electronic equipment, and relates to the technical field of information, the method is applied to a gateway in a data request processing system, the system further comprises a plurality of services, the gateway is used for carrying out request forwarding to the services, and the initial running state of each service is a normal state; the method comprises the following steps: after a target request is received, determining a target service to which the target request needs to be forwarded; determining the current running state of the target service; when the current running state is a normal state, aiming at each service interface of the target service, determining whether the service interface meets a preset first analysis condition, and if so, setting mark information representing that the interface is unavailable for the service interface; if all the service interfaces are provided with the mark information, changing the current running state into a fusing state; and otherwise, maintaining the current running state of the target service as a normal state. According to the scheme, the stability of the data request processing system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a service processing method, device, and electronic device. Background Art

[0002] With the rapid development of the internet, the interdependencies between services in data request processing systems are becoming increasingly tight. Specifically, services collaborate to respond to data requests received by the data request processing system. However, because these services collaborate, if one service in the system becomes unstable or unavailable, it can cause instability or unavailability in other services that rely on it, thereby impacting the stability of the entire data request processing system. Summary of the Invention

[0003] The purpose of the embodiments of the present application is to provide a service-oriented processing method, device, and electronic device to improve the stability of a data request processing system. The specific technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a service processing method, which is applied to a gateway in a data request processing system, wherein the data request processing system further includes multiple services, and the gateway is configured to forward requests to the services, wherein each service is initially in a normal operating state; the method comprises:

[0005] In response to receiving a target request, determining a target service to which the currently received target request needs to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service;

[0006] Determining the current operating status of the target service;

[0007] When the current operating state of the target service is the normal state, for each service interface of the target service, determining whether the service interface of the target service meets a predetermined first analysis condition, and if so, setting tag information representing that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; the first time period is a time period that ends at the current time and has a first duration;

[0008] If all the service interfaces of the target service are set with the marking information, the current running state of the target service is changed to the fused state; otherwise, the current running state of the target service is maintained as the normal state.

[0009] In a second aspect, an embodiment of the present application provides a service processing device, which is applied to a gateway in a data request processing system, wherein the data request processing system further includes multiple services, and the gateway is configured to forward requests to the services, wherein the initial operating state of each service is a normal state; the device includes:

[0010] a first determining module configured to, in response to receiving a target request, determine a target service to which the currently received target request is to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service;

[0011] A second determining module is used to determine the current running status of the target service;

[0012] A first analysis module is configured to determine, for each service interface of the target service when the current operating state of the target service is the normal state, whether the service interface of the target service satisfies a predetermined first analysis condition, and if so, to set a marking information indicating that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; and the first time period is a time period that ends at the current time and has a first duration;

[0013] A state fuse module, configured to change the current running state of the target service to a fuse state if all service interfaces of the target service are set with the marking information; otherwise, trigger a state maintenance module;

[0014] The state maintaining module is used to maintain the current running state of the target service as the normal state.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing computer programs; and a processor for implementing any of the aforementioned service-oriented processing methods when executing the programs stored in the memory.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the aforementioned processing methods for services is implemented.

[0017] An embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the aforementioned service processing methods.

[0018] Beneficial effects of the embodiments of the present application:

[0019] As can be seen from the above, an embodiment of the present application provides a processing method for a service, which is applied to a gateway in a data request processing system. The data request processing system also includes multiple services, each service's initial operating state is normal, and the gateway is used to forward requests to the service. After receiving a target request, the gateway first determines the target service to which the currently received target request needs to be forwarded, and determines the current operating state of the target service. Thus, when the current operating state is normal, for each service interface of the target service, it is determined whether the service interface of the target service meets a predetermined first analysis condition. The above-mentioned first analysis condition is that the first number of requests received through the service interface in a first time period is greater than the first benchmark number, and the response success rate of the requests received through the service interface in the first time period is less than a predetermined threshold, wherein the above-mentioned first time period is a time period with the current time as the end time and a first duration. In this way, when the service interface meets the above-mentioned first analysis condition, it indicates that the service interface is currently unavailable. At this time, a mark information indicating that the interface is unavailable is set for the service interface. If all service interfaces of the target service are set with marking information, it indicates that the target service is currently unavailable. The current running state of the target service is changed to the fuse state to reduce the possibility of a service in the data request processing system being unavailable or unstable, which may cause the service that has coordination requirements with the service to become unavailable or unstable, thereby improving the overall stability of the data request processing system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0021] Figure 1 A flowchart of the first service processing method provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of a second service processing method provided in an embodiment of the present application;

[0023] Figure 3A flowchart of a third service processing method provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of a specific embodiment provided in the embodiments of the present application;

[0025] Figure 5 A schematic diagram of the structure of a service processing device provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.

[0028] In order to solve the above technical problems and improve the stability of the data request processing system, the embodiments of the present application provide a service processing method, device and electronic device.

[0029] This method is applicable to various application scenarios involving service processing, such as service circuit breaking and service status monitoring. Furthermore, this method can be applied to gateways, which can be various electronic devices such as switches and servers. This application does not limit the specific form of gateways, which are generally referred to as electronic devices. Therefore, the embodiments of this application do not limit the application scenarios or execution entities of this method.

[0030] An embodiment of the present application provides a service processing method, which is applied to a gateway in a data request processing system. The data request processing system also includes multiple services. The gateway is used to forward requests to the services. The initial operating state of each service is normal. The method includes:

[0031] In response to receiving a target request, determining a target service to which the currently received target request needs to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service;

[0032] Determining the current operating status of the target service;

[0033] When the current operating state of the target service is the normal state, for each service interface of the target service, determining whether the service interface of the target service meets a predetermined first analysis condition, and if so, setting tag information representing that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; the first time period is a time period that ends at the current time and has a first duration;

[0034] If all the service interfaces of the target service are set with the marking information, the current running state of the target service is changed to the fused state; otherwise, the current running state of the target service is maintained as the normal state.

[0035] As can be seen from the above, an embodiment of the present application provides a processing method for a service, which is applied to a gateway in a data request processing system. The data request processing system also includes multiple services, each service's initial operating state is normal, and the gateway is used to forward requests to the service. After receiving a target request, the gateway first determines the target service to which the currently received target request needs to be forwarded, and determines the current operating state of the target service. Thus, when the current operating state is normal, for each service interface of the target service, it is determined whether the service interface of the target service meets a predetermined first analysis condition. The above-mentioned first analysis condition is that the first number of requests received through the service interface in a first time period is greater than the first benchmark number, and the response success rate of the requests received through the service interface in the first time period is less than a predetermined threshold, wherein the above-mentioned first time period is a time period with the current time as the end time and a first duration. In this way, when the service interface meets the above-mentioned first analysis condition, it indicates that the service interface is currently unavailable. At this time, a mark information indicating that the interface is unavailable is set for the service interface. If all service interfaces of the target service are set with marking information, it indicates that the target service is currently unavailable. The current running state of the target service is changed to the fuse state to reduce the possibility of a service in the data request processing system being unavailable or unstable, which may cause the service that has coordination requirements with the service to become unavailable or unstable, thereby improving the overall stability of the data request processing system.

[0036] The following describes a service processing method provided by an embodiment of the present application in detail with reference to the accompanying drawings. The method is applied to a gateway in a data request processing system, which also includes multiple services. The gateway is used to forward requests to the services, and each service is initially in a normal operating state. Figure 1 A flowchart of a service processing method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method includes the following steps:

[0037] S101: In response to receiving a target request, determining a target service to which the currently received target request needs to be forwarded.

[0038] The target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service other than the target service within the data request processing system.

[0039] In the present application, the gateway is used to receive target requests to be processed and forward the received target requests to the corresponding service so that the target request can be processed by the target service and the response can be completed. It can be understood that the above-mentioned target requests usually include requests sent by external access terminals that communicate with the data request processing system. However, with the rapid development of the Internet, the dependencies between the various services in the data request processing system have become increasingly close, and the various services cooperate with each other to respond to the data requests received by the data request processing system. For example, after receiving the request r, the gateway forwards the request r to the corresponding service P. However, when the service P responds to the request r, it needs to call the service Q to obtain the specified data from the database. At this time, the service P needs to send a request to call the service Q to the gateway so that the service P and the service Q can cooperate with each other to respond to the request r. Therefore, the target request received by the gateway in the present application can also include a request sent by any service in the data request processing system other than the target service.

[0040] It should be noted that the request sent by the above-mentioned service P to the gateway to call service Q can be a request generated by the service P based on its own needs, or it can be a request r received by the service P, etc. This embodiment of the application does not make specific limitations on this.

[0041] Furthermore, to enhance the functional diversity of the entire data request processing system, each service in the system has a specific function; that is, each service is designed to process a specific type of request. For example, in a securities trading scenario, the data request processing system could be a financial trading system, which could include services for submitting trade orders, updating inventory, and updating account balances. For another example, in scenarios requiring data validation and concurrency control for user registration or questionnaires, the data request processing system could be an online form and data collection system, which could include services for submitting form data and updating user information.

[0042] Therefore, after receiving the target request, the gateway first determines the target service to which the currently received target request needs to be forwarded. That is, the gateway can determine the service used to process requests of the request type to which the target request belongs from multiple services in the entire system based on the request type to which the target request belongs, as the target service to which the target request needs to be forwarded.

[0043] S102: Determine the current operating status of the target service;

[0044] S103: When the current running state of the target service is normal, for each service interface of the target service, determining whether the service interface of the target service meets a predetermined first analysis condition; if so, setting a flag indicating that the interface is unavailable for the service interface;

[0045] Among them, the first analysis condition includes: the first number of requests received through the service interface during the first time period is greater than the first benchmark number, and the response success rate of the requests received through the service interface during the first time period is less than a predetermined threshold; the first time period is a time period with the current time as the end time and a first duration.

[0046] In this application, the operating state of the target service may include a normal state, a blown state, and a recovery state. Different state change conditions are set for different operating states so that the gateway can monitor the operating state of the target service.

[0047] Optionally, each service is provided with a status tag for representing the current running status, so that the gateway determines the current running status of the target service by identifying the status tag of the target service.

[0048] Optionally, the gateway monitors and records the current running status of each service in real time, and after determining the target service, directly determines the current running status of the target service.

[0049] It should be noted that a service has an interface. Thus, when the gateway forwards a request to a service, it specifically forwards the request to the service's interface so that the service receives the request forwarded by the gateway. Therefore, when determining that the current operating status of the target service is normal, it is possible to determine for each service interface of the target service whether the service interface of the target service meets the predetermined first analysis condition, specifically:

[0050] For each service interface, determine a time period with the current time as the end time and a first duration as the first time period, and then determine whether the first number of requests received through the service interface during the first time period is greater than the first benchmark number, wherein the above-mentioned first benchmark number is the minimum number for analyzing the response success rate of requests processed by the service interface, that is, the first benchmark number is the trigger condition for triggering the analysis of the response success rate of the requests processed by the service interface.

[0051] If the first number of requests received through the service interface during the first time period is not greater than the above-mentioned first benchmark number, there is no need to analyze the response success rate of the request for the service interface. At this time, it can be directly determined that the service interface is not in an unavailable or unstable state.

[0052] If the first number of requests received through the service interface during the first time period is greater than the above-mentioned first benchmark number, it indicates that the service interface has reached the trigger condition for triggering the analysis of the response success rate of the requests processed by the service interface. At this time, it can be determined whether the response success rate of the requests received through the service interface during the first time period is less than the predetermined threshold.

[0053] If it is not less than the predetermined threshold, it indicates that many requests are received through the service interface in the first time period, and the response success rate is high. The service interface does not meet the first analysis condition. The service interface is currently available or stable and can be used normally.

[0054] If it is less than the predetermined threshold, it indicates that the number of requests received through the service interface in the first time period is large, but the response success rate is low. The service interface meets the first analysis condition, and there is a high possibility that the service interface is unavailable or unstable. At this time, in order to ensure the overall stability of the system, a mark information indicating that the interface is unavailable can be set for the service interface. In this way, the gateway may not forward the request to the service interface marked with the above mark information, so as to achieve the purpose of cutting off the communication between the gateway and the service interface marked with the above mark information in the target service.

[0055] S104: If all service interfaces of the target service are set with marking information, change the current running state of the target service to the fuse state; otherwise, execute step S105;

[0056] S105: Maintain the current operating state of the target service as normal.

[0057] In the present application, each service in the data request processing system has at least two service interfaces. In this way, when one of the service interfaces is unstable or unavailable and is marked with the above-mentioned marking information, the service can support its normal operation through the remaining interfaces, that is, connect the communication between the service and the gateway through the remaining interfaces, so that the service receives the request forwarded by the gateway through the remaining interface.

[0058] Therefore, when all service interfaces of the target service are set with marking information, it indicates that all interfaces of the target service are unstable or unavailable. At this time, the current operating state of the target service can be changed to the fuse state, that is, the communication between the gateway and the entire target service is cut off; on the contrary, there is at least one service interface in the target service that is not set with marking information, which indicates that at least one service interface of the target service is stable or available, and the normal operation of the target service can be supported by the at least one service interface. At this time, the current operating state of the target service can be maintained as normal.

[0059] It should be noted that when the data request processing system includes multiple services with the same functions, that is, the multiple services are used to process requests of the same request type, then when setting the marking information, the marking information is set for the service interface of the target service, rather than for such service interfaces of all services.

[0060] As can be seen from the above, an embodiment of the present application provides a processing method for a service, which is applied to a gateway in a data request processing system. The data request processing system also includes multiple services, each service's initial operating state is normal, and the gateway is used to forward requests to the service. After receiving a target request, the gateway first determines the target service to which the currently received target request needs to be forwarded, and determines the current operating state of the target service. Thus, when the current operating state is normal, for each service interface of the target service, it is determined whether the service interface of the target service meets a predetermined first analysis condition. The above-mentioned first analysis condition is that the first number of requests received through the service interface in a first time period is greater than the first benchmark number, and the response success rate of the requests received through the service interface in the first time period is less than a predetermined threshold, wherein the above-mentioned first time period is a time period with the current time as the end time and a first duration. In this way, when the service interface meets the above-mentioned first analysis condition, it indicates that the service interface is currently unavailable. At this time, a mark information indicating that the interface is unavailable is set for the service interface. If all service interfaces of the target service are set with marking information, it indicates that the target service is currently unavailable. The current running state of the target service is changed to the fuse state to reduce the possibility of a service in the data request processing system being unavailable or unstable, which may cause the service that has coordination requirements with the service to become unavailable or unstable, thereby improving the overall stability of the data request processing system.

[0061] Optionally, in one embodiment, the service processing method provided in the embodiment of the present application further includes the following steps:

[0062] Step A1: while maintaining the current running state of the target service in a normal state, forward the currently received target request to the target interface in the target service;

[0063] The target interface is an interface that is not marked with marking information;

[0064] Step A2: When the current running state of the target service is changed to the circuit-breaking state, the currently received target request is cached in the cache queue.

[0065] In this embodiment, while maintaining the current operating status of the target service as normal, it is characterized that there is at least one service interface in the target service that is not set with marking information, that is, the at least one service interface is stable or available, and the at least one service interface can support the target service to receive requests forwarded by the gateway. Therefore, while maintaining the current operating status of the target service as normal, the interface in the target service that is not marked with marking information can be determined as the target interface, so that the currently received target request can be forwarded to the target interface in the target service.

[0066] When the current operating status of the target service is changed to the circuit-breaking state, all service interfaces representing the target service are set with marking information. All interfaces of the target service are unstable or unavailable. The gateway can cache the target requests received by the current interface and need to be forwarded to the target service in the cache queue to reduce the waste of service resources.

[0067] In this embodiment, while maintaining the current operating status of the target service in a normal state, the gateway can forward the target request normally to ensure the response efficiency of the entire system to the received request; when changing the current operating status of the target service to a blown state, the gateway can cache the currently received target request in a cache queue, and when the target service is able to process the request, forward the target request to the target service to reduce the possibility that the service that has a cooperation requirement with the target service will become unavailable or unstable due to the target service being in an unstable or unavailable state, thereby improving the overall stability of the data request processing system.

[0068] Optionally, in one embodiment, the multiple services include a designated service having a designated interface. Before the above step S102: determining the current running status of the target service, the processing method for the service provided in the embodiment of the present application further includes the following steps:

[0069] Step B: Determine whether the target service is a designated service; if not, execute the step of determining the current running status of the target service.

[0070] In this embodiment, considering that there are some designated interfaces in the data request processing system that are highly correlated with the normal operation of the entire system, the designated interface cannot be set with marking information indicating that the interface is unavailable, and the operating status of the designated service with the designated interface cannot be changed. If the operating status of the designated service is changed, it may cause the entire system to crash. Therefore, the designated service with the designated interface can be marked in advance, and before determining the current operating status of the target service, it can be determined whether to execute a processing method for the service provided by the embodiment of the present application on the target service by identifying whether the target service is a designated service. If so, the target service is characterized as a designated service. At this time, it is not necessary to execute a processing method for the service provided by the embodiment of the present application on the target service. If not, the current operating status of the target service is determined.

[0071] Optionally, a designated field is set for the code of the designated service in the data request processing system to mark the designated service with the designated interface. In this way, the gateway can determine whether the target service is a designated service by identifying whether the designated field exists in the target service.

[0072] In this embodiment, through the added amnesty mechanism, that is, for the designated service in the data request processing system, a service processing method provided in the embodiment of the present application is not executed, and marking information is not set for the designated interface of the designated service to maintain communication between the designated interface of the designated service and the gateway, thereby maintaining the overall stability of the data request processing system.

[0073] Optionally, in one embodiment, as Figure 2 As shown, in a processing method for a service provided in an embodiment of the present application, after changing the current running state of the target service to the fuse state, the following steps are also included:

[0074] S106: Outputting predetermined alarm information to a designated management system corresponding to the data request processing system;

[0075] The alarm information is used to indicate that the target service in the data request processing system is in a broken state.

[0076] In this embodiment, after changing the current running state of the target service, the gateway may output predetermined alarm information to the designated management system corresponding to the data request processing system, indicating that the target service in the data request processing system is in a blown state.

[0077] Optionally, after changing the current running status of the target service, the gateway may configure the target field of the target service to a target value, and automatically report predetermined alarm information to a designated management system corresponding to the data request processing system through logs.

[0078] In this way, after receiving the above-mentioned alarm information, the administrator of the designated management system can directly determine the target service that is in an unstable or unavailable state, thereby eliminating the need to determine in turn which specific service in the data request processing system is in a circuit-breaker state. In addition, by exposing the above-mentioned alarm information to the outside world, the designated management system corresponding to the data request processing system is notified to monitor and alarm, thereby reducing the sunk costs of the administrator of the designated management system (for example, the operation and maintenance platform) in handling abnormal services, so as to facilitate the system operation and maintenance of the data request processing system.

[0079] Optionally, in one embodiment, as Figure 3 As shown, a processing method for a service provided in an embodiment of the present application further includes the following steps:

[0080] S301: In response to the current running state of the target service being changed to the blown state, monitoring whether the duration for which the target service is in the blown state reaches a predetermined second duration;

[0081] S302: In response to the second duration, determining whether at least one service interface of the target service does not meet the first analysis condition; if so, executing step S303;

[0082] S303: For the service interface of the target service that does not meet the first analysis condition, remove the marking information and change the current running state of the target service to the recovery state.

[0083] In this embodiment, after the current running status of the target service is changed to the blown state, in order to ensure the overall stability of the data request processing system, the gateway can continue to monitor the running status of the target service, thereby timely changing the state of the target service in the blown state so that the target service can continue to process the requests forwarded by the gateway.

[0084] Therefore, in response to the current operating status of the target service changing to the blown state, the gateway monitors whether the duration for which the target service is in the blown state reaches a predetermined second duration. Thus, when the above second duration is reached, it can be determined whether at least one service interface of the target service does not meet the above first analysis condition.

[0085] If the first analysis condition is met, it indicates that all service interfaces of the target service are still unstable or unavailable. In this case, the current operation state of the target service is maintained as the fuse state.

[0086] If the above-mentioned first analysis condition is not met, it indicates that at least one service interface of the target service has escaped from an unstable or unavailable state and has the possibility of becoming stable or available. At this time, for the service interface of the target service that does not meet the first analysis condition, the above-mentioned marking information is removed and the current running state of the target service is changed to a recovery state.

[0087] Optionally, in one embodiment, as Figure 3 As shown, a processing method for a service provided in an embodiment of the present application may further include the following steps:

[0088] S304: After the current running state of the target service is changed to the recovery state, monitor whether the duration of the target service in the recovery state reaches a third duration; if it does not reach the third duration, execute step S305; if it reaches the third duration, execute step S306;

[0089] S305: Determine the requests corresponding to the target service that meet the predetermined release conditions, and forward the determined requests to the target service;

[0090] The requests corresponding to the target service include the target requests that the gateway has received and needs to forward to the target service and the requests that have not been forwarded;

[0091] S306: Determine whether the target service meets the second analysis condition; if so, execute step S307;

[0092] The second analysis condition includes: a second number of requests processed by the target service in the second time period is greater than a second benchmark number, and a response success rate of requests processed by the target service in the second time period is not less than a predetermined threshold; the second time period is a time period that ends at the current time and has a fourth duration;

[0093] S307: Change the current running state of the target service to normal state.

[0094] In this embodiment, after the current running state of the target service is changed to the recovery state, the gateway continues to monitor whether the time the target service is in the recovery state reaches a third time period; wherein, the time the above-mentioned target service is in the recovery state can be the interval between the start time and the current time of the target service when the target service is changed to the fuse state.

[0095] If the third duration is reached, it indicates that the target service can currently process some requests. At this point, the gateway can resume communication with the target service's service interface and allow some requests to be passed to the target service's service interface to determine whether to change the target service's operating status to normal. The aforementioned partial requests that can be passed to the target service are those requests corresponding to the target service that meet the predetermined release conditions. Specifically, among the target requests that the gateway has received but has not yet forwarded to the target service, the gateway determines the requests that meet the predetermined release conditions and forwards the determined requests to the target service.

[0096] If the third duration has not been reached, then continue to determine whether the target service meets the second analysis condition, specifically:

[0097] For the target service, determine that the time period with the current time as the end time and having a fourth time length is the second time period, and then determine whether the second number of requests processed by the target service in the second time period is greater than the second benchmark number; wherein the above-mentioned second benchmark number is the minimum number for analyzing the response success rate of requests processed by the target service, that is, the second benchmark number is the trigger condition for triggering the analysis of the response success rate of requests processed by the target service.

[0098] If the second number of requests processed by the target service during the second time period is not greater than the above-mentioned second benchmark number, there is no need to analyze the response success rate of the target service regarding the requests. At this time, it can be directly determined that the target service is still in the fuse state, and the current operating state of the target service is maintained in the fuse state.

[0099] If the second number of requests processed by the target service in the second time period is greater than the above-mentioned second benchmark number, it indicates that the target service has reached the trigger condition for triggering the analysis of the response success rate of the requests processed by the target service. At this time, it is possible to continue to determine whether the response success rate of the requests processed by the target service in the second time period is not less than the predetermined threshold.

[0100] If it is less than the predetermined threshold, it indicates that the number of requests processed by the target service in the second time period is large and the response success rate is low. The service interface does not meet the second analysis condition, and the target service is still in the fuse state. The current operating state of the target service is maintained in the fuse state.

[0101] If it is not less than the predetermined threshold, it indicates that many requests are processed by the target service during the second time period, and the response success rate is high. The service interface meets the second analysis condition, and the target service is likely to be stable or available. At this time, the current operating status of the target service can be changed to normal.

[0102] In this embodiment, after the target service is changed to the blown state, the gateway continues to monitor the target service and analyzes whether the target service meets the predetermined state change conditions based on the monitoring results. The current operating state of the target service can be changed in a timely manner to promote the reuse of the target service, thereby improving the stability of the data request processing system.

[0103] Optionally, in one implementation, after changing the current operating status of the target service to a normal state, the gateway continues to monitor the target service, and for each service interface of the target service, determines again whether the service interface of the target service meets a predetermined first analysis condition to determine whether the current operating status of the target service is a normal state for verification, so as to reduce the possibility of the service being in a blown state again after returning to normal state.

[0104] Optionally, in one embodiment, a method for determining whether any request meets a predetermined release condition includes the following steps:

[0105] Step C1: determining a fifth duration between the time when the request is received and the time when the current running state of the target service is changed to the blown state;

[0106] Step C2: Determine whether the ratio of the fifth duration to the third duration is greater than a predetermined reference value; if so, execute step C3;

[0107] Step C3: Determine whether the request meets the predetermined release conditions.

[0108] In this embodiment, for each request, the gateway can determine the time the request was received, as well as the fifth duration between the time the request was received and the time the target service's current operating state was changed to the blown state. Thus, by determining whether the ratio of the fifth duration to the third duration is greater than a predetermined reference value, it is determined whether the request meets the predetermined release conditions. The reference value can be any value within 1, and this application does not impose any specific limitations on this.

[0109] If the ratio is greater than the reference value, it indicates that the request is forwarded to the target service, the target service can process the request, and the request meets the predetermined release conditions.

[0110] If the ratio is not greater than the reference value, it indicates that the request is forwarded to the target service, the target service cannot process the request, and the request does not meet the predetermined release conditions.

[0111] In this embodiment, by setting predetermined release conditions, the number of requests that the target service needs to process in the recovery state is limited, thereby avoiding a sudden increase in the number of requests that need to be processed after the target service changes from the fuse state to the recovery state, which may cause the target service to become unstable or unavailable again.

[0112] The following is an illustrative introduction to the solutions provided in the embodiments of the present application in conjunction with specific embodiments.

[0113] With the rapid development of the internet, the interdependencies between services in data request processing systems are becoming increasingly tight. Specifically, services collaborate to respond to data requests received by the data request processing system. However, because these services collaborate, if one service in the system becomes unstable or unavailable, it can cause instability or unavailability in other services that rely on it, thereby impacting the stability of the entire data request processing system.

[0114] For example, taking the microservice system in the data request processing system as an example, in the microservice distributed architecture, circuit breaking is a very important technical means for ensuring the high availability and stability of the system. Among them, the microservice system is composed of a large number of services, which can be remote services, databases, third-party APIs (Application Programming Interfaces), etc. In the above-mentioned microservice system, a service can call other services to achieve mutual cooperation between various services and respond to data requests received by the microservice system. However, the service as the caller cannot guarantee the stability of the service as the callee. If the called service becomes unstable, the response time of the called service in responding to the data request will be longer, and accordingly, the response time of the caller's service in responding to the data request will also be longer. When processing data requests, the entire system sets up a corresponding thread for the request to be processed. In the process of processing the request, the corresponding thread will occupy part of the service resources of the entire system. Therefore, if the thread cannot be terminated due to service instability and occupies a large number of service resources, it may cause the service resources of the entire system to be exhausted, making the service itself as the caller unavailable. In other words, if a service in the system is unstable or unavailable, it may cause instability or unavailability of services that need to cooperate with the service. In addition, considering that the dependencies between various services in the system are relatively close, the unavailability of a single service will produce an unavailability amplification effect in the system through the cascade between various services, and ultimately make the entire system unavailable.

[0115] In related technologies, the method for determining the circuit breaker status is based solely on the number of errors reported by the entire data request processing system. Specifically, when the number of errors in the entire system reaches a predetermined number, the abnormal service is circuit-breakered. However, because the number of requests called to process each service interface varies, using only the number of errors as the judgment criterion is not applicable to all interfaces. Moreover, if each interface is called to process a large number of requests, it is not easy to set an appropriate number as the predetermined number. In addition, existing gateway circuit breaker mechanisms often rely on probes, additional code block intrusion, and other methods to implement them, and cannot be decoupled from the gateway's functional modules.

[0116] In summary, the relevant technologies have the following exemplary problems: the method for judging the circuit breaker status is single; after the circuit breaker processing, it will not be linked with the external system, that is, no alarm information will be sent to the designated management system corresponding to the data request processing system, resulting in the management personnel of the designated management system being unable to deal with the abnormal services in time, resulting in the process of handling the circuit breaker problem (there are abnormal services in the circuit breaker status in the data request processing system) increasing the sunk cost; the method for judging the circuit breaker status is based on the overall judgment of the entire data request processing system, without distinguishing between single services, and there is no function of releasing specific services; the method for judging the circuit breaker status cannot be decoupled from the functional modules of the gateway itself.

[0117] Gateway circuit breakers are a protection mechanism used to prevent cascading failures across the entire system caused by service failures. When a service in the system fails, the gateway circuit breaker temporarily disconnects from that service, preventing the failure from spreading. Once the service is restored, the gateway circuit breaker automatically restores the connection to the service.

[0118] This specific embodiment provides a gateway fuse implementation scheme that may include the following five points:

[0119] First, monitor service status. Before implementing the gateway circuit breaker mechanism, it is necessary to monitor all services within the data request processing system and promptly detect and record abnormal service states (i.e., the circuit breaker state and recovery state in this application). Monitoring can be achieved through a monitoring system or a custom monitoring program. The key is to promptly detect abnormal service states and record and analyze them.

[0120] Second, set the circuit breaker rules (i.e., the first and second analysis conditions in the embodiments of the present application). After monitoring the service to be in an abnormal state, it is necessary to set the corresponding circuit breaker rules according to the specific situation. The circuit breaker rules may include the duration of the abnormal state, the number of abnormal states, etc., and these rules are used to determine whether a circuit breaker operation is needed.

[0121] Third, a circuit breaker operation is executed (i.e., all interfaces of a service in the embodiment of the present application are set with a marker indicating that the interface is unavailable). Once the circuit breaker rules are met, the circuit breaker operation needs to be executed to temporarily cut off the connection between the gateway and the abnormal service. When executing the circuit breaker operation, the impact of the circuit breaker on the system needs to be considered to avoid system unavailability caused by the circuit breaker.

[0122] Fourth, regularly check the service status. After executing the circuit breaker operation, it is necessary to regularly check the status of the abnormal service. Once the service returns to normal, it is necessary to cancel the circuit breaker operation in time and restore the connection with the service.

[0123] Fifth, logging and alarming. When implementing the gateway circuit breaker mechanism, all operations need to be logged, including monitoring service status, setting circuit breaker rules, executing circuit breaker operations, canceling circuit breaker operations, etc. At the same time, a corresponding alarm mechanism needs to be set up to promptly notify relevant personnel to handle the situation (i.e., outputting alarm information to a designated management system in the embodiment of this application).

[0124] This specific embodiment combines the characteristics of the circuit breaker to avoid the avalanche effect (i.e., system crash). When the success rate of a service request within a certain time window (i.e., the first and second time periods in the embodiment of the present application) is lower than the set value, the circuit breaker is triggered. After the circuit breaker is blown, all traffic of the service is stopped for a certain period of time (i.e., the second time period in the embodiment of the present application), and then enters a recovery period. During the recovery period, part of the traffic is released. If the success rate rises to meet the standard, it returns to normal. After returning to normal, the service is analyzed again. If the success rate of the service within a certain time window (i.e., the first and second time periods in the embodiment of the present application) is still lower than the set value, the circuit breaker is blown again.

[0125] It should be noted that the circuit breaker unit is a specific interface of a service. For example, the circuit breaker unit is a specific service ID (service name) + host IP (the network address of the physical or virtual host where the service is located) + port (the port number used to identify the target service). For example, the " / vertxblank / demo / sample" API on port 192.168.10.102:9999 is fused. At this time, the gateway can still forward the request to the sample interface on other service nodes. If all sample interfaces are fused, the gateway will return an alert message indicating that the service is unavailable.

[0126] Next, combine Figure 4 It should be noted that circuit breaking, as a means of protecting the service itself, is usually configured in the calling service, that is, the circuit breaking is targeted at the target service itself.

[0127] Figure 4The health judgment in is for the target service. Within buckets (time window, i.e., the first time period or the second time period in the embodiment of the present application) seconds before the current time of the target service, if the number of requests responded by the target service is less than min (the minimum number of samples in the time window, i.e., the first benchmark number in the embodiment of the present application), then the health judgment of the target service is passed; otherwise, calculate whether the response success rate of the target service processing requests within buckets seconds before the current time of the target service is not less than healthyRate (downstream health success rate threshold, i.e., the predetermined threshold in the embodiment of the present application). If so, then the health judgment of the target service is passed; otherwise, the health judgment of the target service is failed.

[0128] Figure 4 The strict health judgment is for the target service. If the number of requests responded by the target service is 0 (i.e., the second benchmark number in the embodiment of the present application) within buckets seconds before the current time of the target service, it indicates that the strict health judgment of the target service has failed. If the number of requests responded by the target service is greater than 0, it is calculated whether the response success rate of the target service processing requests within buckets seconds before the current time of the target service is not less than healthyRate. If so, it indicates that the strict health judgment of the target service has passed. Otherwise, the strict health judgment of the target service has failed.

[0129] The above response success rate is calculated as follows: obtain the number of first requests that responded successfully and the number of second requests that failed to respond within buckets seconds before the current time of the target service, calculate the sum of the number of first requests and the number of second requests; and calculate the ratio of the number of first requests to the above sum, and determine whether the calculated ratio is greater than healthyRate to determine whether the health judgment or strict health judgment of the target service has passed.

[0130] Figure 4 The duration corresponding to breakPeriod is used to represent the duration during which the service stops receiving requests after the circuit breaker is blown, that is, the second duration in the embodiment of the present application. The duration corresponding to recoverPeriod is used to represent the duration during which the service changes from the blown state to the recovered state. The duration corresponding to breakPeriod+recoverPeriod is used to represent the duration during which the service changes from the blown state to the recovered state, that is, the third duration in the embodiment of the present application.

[0131] After receiving pending requests, the data request processing system directs all requests to its gateway, which then forwards the requests. Upon receiving the request, the gateway first determines the target service to which the request is to be forwarded, and then determines the target service's current operating status. The service's current operating status can be categorized as normal, circuit-breaker, or recovery. Only when the target service is in a normal state can the request be forwarded directly to it.

[0132] When the gateway determines that the current running status of the target service is normal, it determines whether the target service passes the health judgment. If the health judgment passes, it continues to be normal; if the health judgment fails within the buckets time, and the health judgment of all service interfaces of the target service fails, an alarm message is output (for example, 10002 is output as an alarm message), and then, the current running status of the target service is triggered to be changed to the circuit-breaking status, and the log records that the running status of the target service is changed to the circuit-breaking status.

[0133] When the gateway determines that the current running state of the target service is in the breaker state, if the target service has been in the breaker state for less than the breakPeriod, or the target service has been in the breaker state for a period of time that reaches the breakPeriod but the health judgment of the target service fails, the current running state of the target service will continue to be maintained in the breaker state; if the target service has been in the breaker state for a period of time that reaches the breakPeriod and the health judgment of the target service passes, the target service will be triggered to change its current running state to the recovery state, and the log will record that the running state of the target service has been changed to the recovery state.

[0134] When the gateway determines that the current running state of the target service is the recovery state, if the interval time from the current time of the target service to the change to the fuse state does not reach breakPeriod+recoverPeriod, or reaches breakPeriod+recoverPeriod but the strict health judgment of the target service fails, the current running state of the target service will continue to be maintained as the recovery state, and enter the random release mode (that is, in the embodiment of the present application, the request that meets the predetermined release conditions is sent to the service); if breakPeriod+recoverPeriod is reached and the strict health judgment of the target service passes, the current running state of the target service is triggered to be changed to the normal state, and the log records that the running state of the target service is changed to the normal state.

[0135] It should be noted that after the running state of the target service is changed from the recovery state to the normal state, the health judgment of the target service is performed again (for example, Figure 4The dotted line 402 in the figure indicates that after the running state of the target service is changed from the recovery state to the normal state, the health judgment of the target service is performed again. The solid line 401 indicates that the health judgment of the target service is performed when it is determined that the current running state of the target service is normal. If the health judgment fails, an alarm message is output, and then the current running state of the target service is triggered to be changed to the circuit-breaker state, and the log records that the running state of the target service is changed to the circuit-breaker state, so as to reduce the possibility of the target service being circuit-breakered again in subsequent processing requests.

[0136] In a data request processing system, there may be multiple services with the same functionality. Service-specific circuit breaking refers to circuit breaking all service interfaces of a target service (i.e., in this embodiment, tag information is set for all service interfaces of the target service), rather than circuit breaking all service interfaces of other services with the same functionality. In other words, service-specific circuit breaking refers to circuit breaking the interface of a particular service, rather than circuit breaking all services running that type of interface.

[0137] In addition, in this specific embodiment, by configuring the report (the action or result of the status, performance, and other information sent by the device or system to the superior node) item to be true (correct), the log automatically reports the alarm information to the operation and maintenance alarm system (i.e., the designated management system in the embodiment of the present application), thereby reducing the sunk cost of the operation and maintenance colleagues (i.e., the management personnel in the embodiment of the present application) in handling the problem; at the same time, a designated field can be set in the service code, for example, the specialservice Id item, to release the specific interface. The code example is as follows:

[0138] <circuitBreaker buckets="10"healthyRate="0.75"min="3"

[0139] breakPeriod="5"recoverPeriod="3"report="true"default="true">

[0140] <specialserviceId=" / xx / yy"min="1" / >

[0141] <specialserviceId=" / aa / bb / *"healthyRate="0.5" / >

[0142]

[0143] The above code sets the buckets for this service to 10 seconds, the healthyRate to 0.75, the min to 3, the breakPeriod to 5 seconds, and the recoverPeriod to 3 seconds. When report="true", the gateway automatically reports alarm information to the operation and maintenance alarm system. When default="true", the default circuit breaker action applies to all services except those with special settings (implementing a release-without-circuit-breaker mechanism for service interfaces). When default="false", the default circuit breaker action applies only to services with special settings, and no circuit breaker action is applied to other services.<specialserviceId=" / xx / yy"min="1" / > For the service " / xx / yy" with special settings, the minimum value is 1, and the values of other attributes such as buckets and healthyRate are all default values;<special serviceId=" / aa / bb / *"healthyRate="0.5" / > This indicates that for the service " / aa / bb / " with special settings, its healthyRate is 0.5, and the values of other attributes such as buckets and min are all default values. In addition, the character "*" indicates that the matching method for the service " / aa / bb / " is prefix matching. The character "*" is used to indicate the matching priority of the service, that is, when matching, the priority of exact matching is higher than that of prefix matching.

[0144] In this specific embodiment, a scientifically designed method for determining circuit breaking is used. Instead of determining circuit breaking based on the number of microservice error reports, this method uses a time window combined with data sampling (obtaining the number of requests received by the service interface within a certain period of time) to calculate the health of the service interface and its response rate. This determines whether to initiate a circuit breaker, and the response rate is determined for each specific service interface. Furthermore, this specific embodiment incorporates an amnesty mechanism, which allows specific service interfaces to be released without circuit breaking.

[0145] In addition, the circuit breaker mechanism provided in this specific embodiment is introduced into the gateway service in the form of a software program toolkit. Unlike existing gateway circuit breaker mechanisms, which mostly rely on probes, additional code block intrusions, etc., the gateway circuit breaker mechanism of this specific embodiment does not require probes or additional hard coding. It only needs to be directly introduced into the software program toolkit, thereby achieving decoupling from the gateway's own code module.

[0146] It should be noted that in this specific embodiment, the blown state can be exposed to the outside in a message method (outputting alarm information), notifying the external system (such as the operation and maintenance platform) to monitor and alarm, thereby facilitating system operation and maintenance.

[0147] The first gateway circuit breaker mechanism provided in this specific embodiment is an important protection mechanism that effectively prevents cascading failures caused by service failures and ensures stable system operation. Reasonable circuit breaker rules are set to ensure the accuracy and timeliness of circuit breaker operations. Circuit breaker operations are logged and alarmed, allowing for the timely detection and handling of abnormal situations and ensuring stable system operation.

[0148] Corresponding to the above method embodiment, the embodiment of the present application further provides a processing device for services, which is applied to a gateway in a data request processing system, wherein the data request processing system further includes multiple services, and the gateway is used to forward requests to the services, and the initial operating state of each service is a normal state; Figure 5 As shown, the device includes:

[0149] A first determining module 510 is configured to, in response to receiving a target request, determine a target service to which the currently received target request is to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service;

[0150] A second determining module 520 is configured to determine the current operating state of the target service;

[0151] The first analysis module 530 is configured to determine, for each service interface of the target service when the current operating state of the target service is the normal state, whether the service interface of the target service satisfies a predetermined first analysis condition, and if so, set a marking information indicating that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; the first time period is a time period that ends at the current time and has a first duration;

[0152] The state fuse module 540 is configured to change the current running state of the target service to the fuse state if all the service interfaces of the target service are set with the marking information; otherwise, trigger the state maintenance module 550;

[0153] The state maintaining module 550 is configured to maintain the current running state of the target service as the normal state.

[0154] As can be seen from the above, an embodiment of the present application provides a processing method for a service, which is applied to a gateway in a data request processing system. The data request processing system also includes multiple services, each service's initial operating state is normal, and the gateway is used to forward requests to the service. After receiving a target request, the gateway first determines the target service to which the currently received target request needs to be forwarded, and determines the current operating state of the target service. Thus, when the current operating state is normal, for each service interface of the target service, it is determined whether the service interface of the target service meets a predetermined first analysis condition. The above-mentioned first analysis condition is that the first number of requests received through the service interface in a first time period is greater than the first benchmark number, and the response success rate of the requests received through the service interface in the first time period is less than a predetermined threshold, wherein the above-mentioned first time period is a time period with the current time as the end time and a first duration. In this way, when the service interface meets the above-mentioned first analysis condition, it indicates that the service interface is currently unavailable. At this time, a mark information indicating that the interface is unavailable is set for the service interface. If all service interfaces of the target service are set with marking information, it indicates that the target service is currently unavailable. The current running state of the target service is changed to the fuse state to reduce the possibility of a service in the data request processing system being unavailable or unstable, which may cause the service that has coordination requirements with the service to become unavailable or unstable, thereby improving the overall stability of the data request processing system.

[0155] Optionally, in one implementation, the device further includes:

[0156] A first forwarding module is configured to forward the currently received target request to a target interface in the target service while maintaining the current operating state of the target service in the normal state; wherein the target interface is an interface that is not marked with the marking information;

[0157] The request cache module is used to cache the currently received target request in a cache queue when the current running state of the target service is changed to the fuse state.

[0158] Optionally, in one implementation, the multiple services include a designated service having a designated interface, and before determining the current running status of the target service, the apparatus further includes:

[0159] The designated service determination module is used to determine whether the target service is the designated service; if not, the step of determining the current running status of the target service is executed.

[0160] Optionally, in one implementation, the device further includes:

[0161] An information output module is used to output predetermined alarm information to the designated management system corresponding to the data request processing system after the current operating status of the target service is changed to a blown state; wherein, the alarm information is used to indicate that the target service in the data request processing system is in a blown state.

[0162] Optionally, in one implementation, the device further includes:

[0163] A first monitoring module is configured to monitor, in response to the current running state of the target service being changed to a blown state, whether a duration for which the target service is in the blown state reaches a predetermined second duration;

[0164] a second analysis module, configured to, in response to reaching the second duration, determine whether at least one service interface of the target service does not satisfy the first analysis condition; and if so, trigger a status reply module;

[0165] The status recovery module is configured to remove the marking information for the service interface of the target service that does not meet the first analysis condition, and change the current running status of the target service to a recovery status.

[0166] Optionally, in one implementation, the device further includes:

[0167] a second monitoring module, configured to monitor, after the current running state of the target service is changed to the recovery state, whether the duration for which the target service is in the recovery state reaches a third duration; if the third duration is not reached, triggering the third analysis module; if the third duration is reached, triggering the fourth analysis module;

[0168] The third analysis module is configured to determine requests corresponding to the target service that meet predetermined release conditions and forward the determined requests to the target service; wherein the requests corresponding to the target service include requests that have been received by the gateway and need to be forwarded to the target service but have not been forwarded;

[0169] The fourth analysis module is configured to determine whether the target service satisfies a second analysis condition, and if so, trigger a normal status module; wherein the second analysis condition includes: a second number of requests processed by the target service within a second time period is greater than a second benchmark number, and a response success rate of requests processed by the target service within the second time period is not less than a predetermined threshold; and the second time period is a time period that ends at the current time and has a fourth duration;

[0170] The normal status module is used to change the current running status of the target service to the normal status.

[0171] Optionally, in one implementation, a method for determining whether any request meets predetermined release conditions includes:

[0172] Determine the fifth time duration between the reception time corresponding to the request and the change time of changing the current operating state of the target service to the fuse state; determine whether the ratio of the fifth time duration to the third time duration is greater than a predetermined benchmark value; if greater, determine that the request is a request that meets the predetermined release conditions.

[0173] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 601 , a communication interface 602 , a memory 603 and a communication bus 604 , wherein the processor 601 , the communication interface 602 , and the memory 603 communicate with each other via the communication bus 604 .

[0174] Memory 603, used for storing computer programs;

[0175] The processor 601 is configured to implement any of the service processing methods described in the above embodiments when executing the program stored in the memory 603 .

[0176] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0177] The communication interface is used for communication between the above electronic device and other devices.

[0178] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0179] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0180] In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned processing methods for services are implemented.

[0181] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the service processing methods in the above embodiments.

[0182] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0183] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0184] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, since the apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are generally similar to the method embodiments, their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.

[0185] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.

Claims

1. A processing method for a service, characterized in that: A gateway is applied to a data request processing system, wherein the data request processing system further includes a plurality of services, the gateway is used to forward requests to the services, and the initial operating state of each service is a normal state; the method includes: In response to receiving a target request, determining a target service to which the currently received target request needs to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service; Determining the current operating status of the target service; When the current operating state of the target service is the normal state, for each service interface of the target service, determining whether the service interface of the target service meets a predetermined first analysis condition, and if so, setting tag information representing that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; the first time period is a time period that ends at the current time and has a first duration; If all the service interfaces of the target service are set with the marking information, the current running state of the target service is changed to the fused state; otherwise, the current running state of the target service is maintained as the normal state.

2. The method according to claim 1, characterized in that The method further comprises: While maintaining the current running state of the target service as the normal state, forwarding the currently received target request to the target interface in the target service; wherein the target interface is an interface that is not marked with the marking information; When the current running state of the target service is changed to the fuse state, the currently received target request is cached in the cache queue.

3. The method according to claim 1 or 2, characterized in that The multiple services include a designated service having a designated interface. Before determining the current running state of the target service, the method further includes: Determining whether the target service is the designated service; If not, the step of determining the current running status of the target service is performed.

4. The method according to claim 1 or 2, characterized in that After changing the current running state of the target service to a broken state, the method further includes: Outputting predetermined alarm information to a designated management system corresponding to the data request processing system; wherein the alarm information is used to indicate that the target service in the data request processing system is in a fuse state.

5. The method according to claim 1 or 2, characterized in that The method further comprises: In response to the current running state of the target service being changed to a blown state, monitoring whether the duration for which the target service is in the blown state reaches a predetermined second duration; In response to reaching the second time length, determine whether at least one service interface of the target service does not meet the first analysis condition; if so, for the service interface of the target service that does not meet the first analysis condition, remove the marking information and change the current running state of the target service to a recovery state.

6. The method according to claim 5, characterized in that The method further comprises: After the current running state of the target service is changed to the recovery state, monitoring whether the duration for which the target service is in the recovery state reaches a third duration; If the third duration has not been reached, determining a request among the requests corresponding to the target service that meets the predetermined release condition, and forwarding the determined request to the target service; wherein the request corresponding to the target service includes a request among the target requests that the gateway has received and needs to forward to the target service but has not forwarded; If the third duration is reached, determining whether the target service meets a second analysis condition; wherein the second analysis condition includes: a second number of requests processed by the target service in the second time period is greater than a second benchmark number, and a response success rate of requests processed by the target service in the second time period is not less than a predetermined threshold; the second time period is a time period that ends at the current time and has a fourth duration; If satisfied, change the current running state of the target service to the normal state.

7. The method according to claim 6, characterized in that The method for determining whether any request meets the predetermined release conditions includes: Determining a fifth duration between the moment the request is received and the moment the current running state of the target service is changed to a blown state; determining whether a ratio of the fifth duration to the third duration is greater than a predetermined reference value; If it is greater, the request is determined to be a request that meets the predetermined release conditions.

8. A processing device for a service, characterized in that: A gateway used in a data request processing system, wherein the data request processing system further comprises a plurality of services, the gateway being used to forward requests to the services, wherein each service is initially in a normal operating state; The device comprises: a first determining module configured to, in response to receiving a target request, determine a target service to which the currently received target request is to be forwarded; wherein the target request includes: a request sent by an external access terminal communicating with the data request processing system, or a request sent by any service within the data request processing system other than the target service; A second determining module is used to determine the current running status of the target service; A first analysis module is configured to determine, for each service interface of the target service when the current operating state of the target service is the normal state, whether the service interface of the target service satisfies a predetermined first analysis condition, and if so, to set a marking information indicating that the interface is unavailable for the service interface; wherein the first analysis condition includes: a first number of requests received through the service interface within a first time period is greater than a first benchmark number, and a response success rate of requests received through the service interface within the first time period is less than a predetermined threshold; and the first time period is a time period that ends at the current time and has a first duration; A state fuse module, configured to change the current running state of the target service to a fuse state if all service interfaces of the target service are set with the marking information; otherwise, trigger a state maintenance module; The state maintaining module is used to maintain the current running state of the target service as the normal state.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.