Microservice abnormality compensation method, device, equipment and computer-readable storage medium
By detecting the compensation identifier and interface type of the service request in the microservice exception compensation method, and executing the corresponding compensation method or interface logic, the problem of insufficient intelligence of the compensation mechanism in the existing technology is solved, and intelligence in any service scenario is realized. Compensation and reusability improvements.
Patent Information
- Application Number
- CN202010603662.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-09-24
AI Technical Summary
When existing technology handles microservice exceptions, the compensation mechanism stays at the business state level, resulting in insufficient intelligence and inability to effectively cope with complex service scenarios. It also requires developers to write specific compensation methods for each business state, resulting in high development pressure. , poor reusability.
A microservice anomaly compensation method is proposed. By detecting whether the service request carries a compensation identifier, the microservice interface type is determined, and the corresponding compensation method or interface logic is executed based on the interface type. It focuses on the microservice interface level and reduces dependence on business status. , to achieve intelligent compensation.
It realizes intelligent compensation in any service scenario, reduces the development pressure of R&D personnel, improves the reusability of the compensation mechanism, and can cope with complex service scenarios.
Smart Images

Figure CN111752740B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a microservice anomaly compensation method, device, equipment and computer-readable storage medium. Background Art
[0002] In recent years, with the continuous development of Fintech, especially Internet finance, microservice technology has been introduced into the daily services of banks and other financial institutions. In the daily service process of banks and other financial institutions, the service system often needs to call multiple microservice interfaces to jointly complete a service request, such as a transfer request, which can be completed by multiple microservices such as transfer object management service, transfer order submission service, balance inquiry service, and arrival notification service. In this process, if there are abnormalities such as network jitter, the entire transfer service will be unable to proceed. Therefore, how to handle the abnormalities in the service system to ensure the smooth operation of the service is a technical problem that banks and other financial institutions need to solve.
[0003] In the prior art, when an abnormality occurs in a service system, a compensation mechanism is usually used to compensate for the abnormal condition. Specifically, corresponding compensation methods are written for business states corresponding to different abnormalities, so that when the service system detects a service abnormality, it selects a corresponding compensation method, such as retry, according to the business state, such as transfer failure, so that the service system re-executes according to the original execution logic.
[0004] However, the existing compensation mechanism remains at the business status level. Therefore, as the number of business states increases, such as the failure of the account arrival notification, developers are required to write new compensation methods for the new business states. In other words, the existing compensation mechanism generally chooses to re-execute the entire call method, or write a customized compensation logic for the business state. It can be seen that the existing compensation mechanism is still relatively rigid and not intelligent enough to cope with complex service scenarios. Summary of the invention
[0005] The main purpose of the present invention is to propose a microservice anomaly compensation method, device, equipment and computer-readable storage medium, aiming to achieve intelligent compensation in any service scenario.
[0006] To achieve the above object, the present invention provides a microservice abnormality compensation method, which comprises the following steps:
[0007] If a service request is detected, determining whether the service request carries a compensation identifier, the compensation identifier being used to indicate that the current service request is abnormal;
[0008] If it is carried, determine the microservice interface corresponding to the service request and determine the interface type of the microservice interface;
[0009] If the microservice interface is an interface to be compensated, then based on the skip flag of the interface to be compensated, executing the compensation method corresponding to the interface to be compensated;
[0010] If the microservice interface is a normal interface, the interface logic corresponding to the normal interface is executed.
[0011] Preferably, if the microservice interface is an interface to be compensated, the step of executing the compensation method corresponding to the interface to be compensated based on the skip flag of the interface to be compensated includes:
[0012] If the microservice interface is an interface to be compensated, determining a skip flag of the interface to be compensated;
[0013] If the skip flag is not to skip, determining the logic type of the interface to be compensated;
[0014] If the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated;
[0015] If the logic type is insert logic or update logic, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated;
[0016] If the skip flag is skip, the interface to be compensated is skipped and the compensation logic corresponding to the interface to be compensated is executed.
[0017] Preferably, if the microservice interface is an interface to be compensated, the step of determining a skip flag of the interface to be compensated includes:
[0018] If the microservice interface is an interface to be compensated, determining whether the interface to be compensated is an idempotent interface;
[0019] If yes, determining the skip flag of the interface to be compensated as not skipping;
[0020] If not, determining the calling scenario of the interface to be compensated;
[0021] If the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated as skip;
[0022] If the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, the skip flag of the interface to be compensated is determined to be not skipped.
[0023] Preferably, if the service request is carried, the step of determining the microservice interface corresponding to the service request and determining the interface type of the microservice interface includes:
[0024] If it is carried, determining the microservice interface corresponding to the service request and the abnormal interface corresponding to the service request, wherein the abnormal interface is at least one interface in the microservice interface;
[0025] Determine the upstream interface and the downstream interface corresponding to the abnormal interface based on the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface;
[0026] The upstream interface and the abnormal interface are determined as interfaces to be compensated, and the downstream interface is determined as a normal interface.
[0027] Preferably, in the process of executing the compensation mode or executing the interface logic, the microservice exception compensation method further includes:
[0028] If it is determined that the current microservice interface is an abnormal interface, the number of compensation times of the compensation identifier is determined;
[0029] If the number of compensations is less than the preset number, the step ID of the abnormal interface is determined based on the microservice orchestration corresponding to the microservice interface, the execution of the compensation method or interface logic is terminated, and the number of compensations of the compensation identifier is updated;
[0030] If the number of compensation times is still less than the preset number, the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting the service request.
[0031] Preferably, after the step of determining whether the service request carries a compensation identifier if a service request is detected, the microservice exception compensation method further includes:
[0032] If not, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface, and execute the interface logic corresponding to the microservice interface in sequence based on the microservice orchestration;
[0033] Among them, if the current microservice interface is determined to be an abnormal interface when executing the interface logic of the current microservice interface, the step ID of the abnormal interface is determined based on the microservice orchestration, the execution of the interface logic is terminated, and the service request is marked with a compensation identifier, and the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting service requests.
[0034] Preferably, the step of determining that the current microservice interface is an abnormal interface includes:
[0035] Determine the service status of the current microservice interface, wherein if the service status is stopped, determine that the current microservice interface is an abnormal interface; or
[0036] Determine the number of calls of the call request of the current microservice interface, wherein if the number of calls exceeds a preset number, determine that the current microservice interface is an abnormal interface; or
[0037] Determine the call response time of the current microservice interface, wherein if the call response time exceeds a preset time, determine that the current microservice interface is an abnormal interface.
[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a microservice abnormality compensation device, the microservice abnormality compensation device comprising:
[0039] A detection module, for determining, if a service request is detected, whether the service request carries a compensation identifier, wherein the compensation identifier is used to indicate that the current service request is abnormal;
[0040] A determination module, used to determine the microservice interface corresponding to the service request, and determine the interface type of the microservice interface;
[0041] An execution module, configured to execute a compensation method corresponding to the interface to be compensated based on a skip flag of the interface to be compensated if the microservice interface is the interface to be compensated;
[0042] The execution module is used to execute the interface logic corresponding to the normal interface if the microservice interface is a normal interface.
[0043] Preferably, the execution module is also used for:
[0044] If the microservice interface is an interface to be compensated, determining a skip flag of the interface to be compensated;
[0045] If the skip flag is not to skip, determining the logic type of the interface to be compensated;
[0046] If the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated;
[0047] If the logic type is insert logic or update logic, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated;
[0048] If the skip flag is skip, the interface to be compensated is skipped and the compensation logic corresponding to the interface to be compensated is executed.
[0049] Preferably, the execution module is also used for:
[0050] If the microservice interface is an interface to be compensated, determining whether the interface to be compensated is an idempotent interface;
[0051] If yes, determining the skip flag of the interface to be compensated as not skipping;
[0052] If not, determining the calling scenario of the interface to be compensated;
[0053] If the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated as skip;
[0054] If the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, the skip flag of the interface to be compensated is determined to be not skipped.
[0055] Preferably, the determining module is further used for:
[0056] If it is carried, determining the microservice interface corresponding to the service request and the abnormal interface corresponding to the service request, wherein the abnormal interface is at least one interface in the microservice interface;
[0057] Determine the upstream interface and the downstream interface corresponding to the abnormal interface based on the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface;
[0058] The upstream interface and the abnormal interface are determined as interfaces to be compensated, and the downstream interface is determined as a normal interface.
[0059] Preferably, in the process of executing the compensation mode or executing the interface logic, the execution module is further used for:
[0060] If it is determined that the current microservice interface is an abnormal interface, the number of compensation times of the compensation identifier is determined;
[0061] If the number of compensations is less than the preset number, the step ID of the abnormal interface is determined based on the microservice orchestration corresponding to the microservice interface, the execution of the compensation method or interface logic is terminated, and the number of compensations of the compensation identifier is updated;
[0062] If the number of compensation times is still less than the preset number, the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting the service request.
[0063] Preferably, the determining module is further used for:
[0064] If not, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface;
[0065] The execution module is also used for:
[0066] Based on the microservice orchestration, the interface logic corresponding to the microservice interface is executed in sequence;
[0067] Among them, if the current microservice interface is determined to be an abnormal interface when executing the interface logic of the current microservice interface, the step ID of the abnormal interface is determined based on the microservice orchestration, the execution of the interface logic is terminated, and the service request is marked with a compensation identifier, and the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting service requests.
[0068] Preferably, the determining module is further used for:
[0069] Determine the service status of the current microservice interface, wherein if the service status is stopped, determine that the current microservice interface is an abnormal interface; or
[0070] Determine the number of calls of the call request of the current microservice interface, wherein if the number of calls exceeds a preset number, determine that the current microservice interface is an abnormal interface; or
[0071] Determine the call response time of the current microservice interface, wherein if the call response time exceeds a preset time, determine that the current microservice interface is an abnormal interface.
[0072] In addition, to achieve the above-mentioned purpose, the present invention also provides a microservice exception compensation device, which includes: a memory, a processor, and a microservice exception compensation program stored in the memory and executable on the processor, and when the microservice exception compensation program is executed by the processor, the steps of the microservice exception compensation method as described above are implemented.
[0073] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a microservice exception compensation program is stored, and when the microservice exception compensation program is executed by a processor, the steps of the microservice exception compensation method as described above are implemented.
[0074] The microservice exception compensation method proposed in the present invention, if a service request is detected, determines whether the service request carries a compensation identifier, and the compensation identifier is used to characterize the current service request exception; if it does, determines the microservice interface corresponding to the service request, and determines the interface type of the microservice interface; if the microservice interface is an interface to be compensated, based on the skip identifier of the interface to be compensated, executes the compensation method corresponding to the interface to be compensated; if the microservice interface is a normal interface, executes the interface logic corresponding to the normal interface. The present invention focuses the compensation mechanism on the microservice interface level, without paying attention to changes in business status, reducing the development pressure of R&D personnel, and at the same time, because it is compensation for microservice interfaces, it can be reused in any service scenario, thereby realizing intelligent compensation. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0076] Figure 2 This is a flow chart of the first embodiment of the microservice exception compensation method of the present invention.
[0077] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0078] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0079] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0080] The device in the embodiment of the present invention may be a mobile terminal or a server device.
[0081] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0082] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0083] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a microservice abnormality compensation program.
[0084] Among them, the operating system is a program for managing and controlling microservice exception compensation equipment and software resources, supporting the operation of network communication modules, user interface modules, microservice exception compensation programs and other programs or software; the network communication module is used to manage and control network interface 1002; the user interface module is used to manage and control user interface 1003.
[0085] exist Figure 1 In the microservice abnormality compensation device shown, the microservice abnormality compensation device calls the microservice abnormality compensation program stored in the memory 1005 through the processor 1001, and performs the operations in each embodiment of the following microservice abnormality compensation method.
[0086] Based on the above hardware structure, an embodiment of a microservice abnormality compensation method of the present invention is proposed.
[0087] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a microservice abnormality compensation method according to the present invention, wherein the method comprises:
[0088] Step S10: if a service request is detected, determining whether the service request carries a compensation identifier, wherein the compensation identifier is used to indicate that the current service request is abnormal;
[0089] Step S20: If it is carried, determine the microservice interface corresponding to the service request, and determine the interface type of the microservice interface;
[0090] Step S30: If the microservice interface is an interface to be compensated, based on the skip flag of the interface to be compensated, executing the compensation method corresponding to the interface to be compensated;
[0091] Step S40: If the microservice interface is a normal interface, the interface logic corresponding to the normal interface is executed.
[0092] The microservice anomaly compensation method of this embodiment is applied to the microservice anomaly compensation device of financial institutions such as financial institutions or banks. The microservice anomaly compensation device can be a terminal, a robot or a PC device. For the convenience of description, the microservice anomaly compensation device is referred to as the compensation device. In this embodiment, an aggregation layer is deployed in the compensation device, wherein the aggregation layer is a system of service request entry, which is used to combine the calls of various downstream microservices, that is, there are multiple microservice interfaces under the aggregation layer, and each microservice interface corresponds to a service, such as order management service, account arrival notification service, etc. When the compensation device detects a service request at the aggregation layer, it completes the service request by calling multiple microservice interfaces and executing the interface logic of the microservice interface.
[0093] In the compensation device, a top-level object attribute is defined, including RequestId (request ID), StepId (step ID), IsIgnore (skip flag, indicating whether to skip), CompensateExecute (compensation flag), CompensateInterface (compensation interface or compensation logic). Each microservice interface in the compensation device inherits the top-level object attribute when processing the current corresponding service request. During the flow of service requests through various microservice interfaces, RequestId remains unchanged (representing the current service scenario); CompensateExecute (compensation identifier, false for normal requests (without compensation identifier); if it is a compensation call, that is, an exception has occurred in the current service request, it is true (with compensation identifier)); StepId is incremented by the underlying mechanism implemented by the compensation program of the compensation device when it is running. Each time a microservice interface is called, StepID is incremented by 1. Specifically, before the current service request flows to the next microservice interface, StepID is incremented by 1; IsIgnore, CompensateInterface is specified by the compensation program of the compensation device according to logic, such as performing multiple compensation tests in advance to determine the skip identifiers of different microservice interfaces and the corresponding compensation logic.
[0094] Compared with the prior art, which requires defining different error codes in different steps of the current service scenario to mark the step at which the error is executed, and then writing compensation logic for retrying according to the business status (error code) of the current service scenario, the present invention can quickly lock the microservice interface where the exception occurs, that is, the exception interface, through the top-level object attributes, and customize the compensation logic for each microservice interface. When any microservice interface is abnormal, the corresponding compensation logic can be used for compensation. It is not limited by the business status of the current service scenario and can be applied to any service scenario to achieve intelligent compensation.
[0095] It should be noted that, for users, they only need to initiate a service request, such as a transfer request, and the front end of the compensation device will respond to the corresponding request result, such as a successful transfer or a failed transfer, etc., and the transfer object, transfer order, transfer account number and transfer arrival notification involved in the transfer process are all handled by the transfer object management service, transfer order management service, transfer account number management service and transfer arrival notification service of the compensation device. Microservices, that is, one service request is jointly completed by multiple back-end microservices. Therefore, the embodiment of the invention is aimed at the abnormal situation of the microservice of the compensation device processing back-end matters, while the prior art is aimed at compensating for the business status of the service request, that is, the abnormal situation of the business status of the front-end service request.
[0096] In view of the abnormal situations that may occur in microservices, this embodiment adopts the compensation methods of various microservice interfaces that are pre-written. When a service request abnormality is detected, different compensation methods are executed for different microservice interfaces, so that the compensation device can cope with any complex service scenarios and realize intelligent compensation for microservice abnormalities.
[0097] The following is a detailed description of each step:
[0098] Step S10: If a service request is detected, it is determined whether the service request carries a compensation identifier, where the compensation identifier is used to indicate that the current service request is abnormal.
[0099] In this embodiment, if the compensation device detects a service request, it determines whether the current service request carries a compensation identifier, wherein the compensation identifier is used to characterize that the current service request is abnormal. That is, when a service request is detected, it first determines whether the current service request has been abnormal, thereby deciding which method to choose to respond to the current service request.
[0100] It should be noted that, in one embodiment, the compensation identifier is included in the service request, that is, the compensation identifier circulates along with the service request in each microservice interface.
[0101] In another embodiment, the step of determining whether the current service request carries a compensation identifier specifically includes:
[0102] Determine the request ID (RequestId) of the service request, and search the aggregation layer for the compensation identifier (CompensateExecute) corresponding to the request ID;
[0103] It is determined whether the state of the compensation identifier is a compensation state, and if so, it is determined that the service request carries the compensation identifier.
[0104] That is, in another embodiment, the compensation identifier is placed at the aggregation layer instead of being attached to the service request, which facilitates unified management and can ensure that the service request is clean during the flow of each microservice interface, which is beneficial to improving the flow performance of the compensation device.
[0105] Step S20: If it is carried, determine the microservice interface corresponding to the service request, and determine the interface type of the microservice interface.
[0106] In this embodiment, if it is determined that the current service request carries a compensation identifier, that is, it is determined that the current service request has an exception, the microservice interface corresponding to the service request is determined. Specifically, the corresponding microservice interface can be determined by the service type of the service request. For example, if the service type of the current service request is a transfer service, the corresponding microservice interface is determined to be a transfer object management service interface, a transfer order management service interface, a transfer account management service interface, and a transfer arrival notification service interface, etc.
[0107] Then, determine the interface type of each microservice interface, where the interface type includes interfaces to be compensated and normal interfaces. Interfaces to be compensated refer to microservice interfaces that need to be rerun, while normal interfaces refer to microservice interfaces that are executed normally.
[0108] It can be understood that when processing a service request, if an exception occurs in a microservice interface, resulting in the inability to perform the service normally, it is necessary to rerun the interface where the exception occurs and the upstream microservice interface before the interface, and the normal interface is the downstream microservice interface after the interface where the exception occurs. When an exception occurs, the downstream microservice interface of the abnormal interface is not called in time, and it is impossible to determine whether the downstream interface of the abnormal interface will have an exception. Therefore, it is temporarily determined as a normal interface. When compensating, you only need to call the normal interface normally. If a call exception occurs in the process of calling the normal interface, that is, there is an abnormal interface in the normal interface, then an error will be reported, and the normal interface will be determined as an abnormal interface, and it will be rerun according to the steps of this embodiment.
[0109] Further, in one embodiment, step S20 includes:
[0110] Step a1: if it is carried, determine the microservice interface corresponding to the service request and the abnormal interface corresponding to the service request, wherein the abnormal interface is at least one interface in the microservice interface;
[0111] In one embodiment, if it is determined that the current service request carries a compensation identifier, that is, it is determined that the current service request has an exception, then the microservice interface corresponding to the current service request and the exception interface corresponding to the service request are determined, wherein the exception interface is at least one interface in the microservice interface, that is, it is determined which microservice interface or microservice interfaces are the exception interface where the service request has an exception.
[0112] It should be noted that, in one embodiment, when determining that the current service request is abnormal, the compensation device will mark the abnormal location, specifically marking the step ID (stepID) of the abnormal interface. Therefore, the compensation device can determine the abnormal interface in the microservice interface based on the mark. The specific mark is described in detail in the following embodiment.
[0113] Step a2, determining the upstream interface and the downstream interface corresponding to the abnormal interface based on the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface;
[0114] Next, according to the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface, the upstream interface (i.e., the upstream microservice interface) and the downstream interface (i.e., the downstream microservice interface) corresponding to the abnormal interface are determined, wherein the microservice orchestration refers to the combination of the calling logic of these microservice interfaces when a service request calls multiple microservice interfaces, that is, the calling order of the microservice interfaces; the step ID refers to the order of the microservice interface in the calling order, for example, step 1 or step 2.
[0115] To distinguish different service requests, the compensation device generates a request ID (RequestId) when the service request enters the aggregation layer. After that, each time a microservice interface is called, the compensation device generates a step ID for the microservice interface, where the step ID increases as the calling order increases.
[0116] If the compensation device detects a service request at the aggregation layer, it generates a unique request ID for the current service request, and then determines the microservice interface corresponding to the current service request and the microservice orchestration corresponding to the microservice interface, such as A→B→C→D→E. That is, the current service request corresponds to five microservice interfaces A, B, C, D and E, and the calling order of the five microservice interfaces is call A call B call C call D call E. When calling A, the compensation device generates step 1 for A, when calling B, the compensation device generates step 2 for B, when calling C, the compensation device generates step 3 for C, when calling D, the compensation device generates step 4 for D, and when calling E, the compensation device generates step 5 for E.
[0117] If C is abnormal, that is, C is an abnormal interface, then according to C's step ID = step3 and the calling sequence of A→B→C→D→E, it can be determined that A and B are C's upstream interfaces and D and E are C's downstream interfaces.
[0118] Step a3: determine that the upstream interface and the abnormal interface are interfaces to be compensated, and determine that the downstream interface is a normal interface.
[0119] In one embodiment, the upstream interface and the abnormal interface are determined as interfaces to be compensated, and the downstream interface is determined as a normal interface. For example, in the above example, when C is an abnormal interface, A, B, and C need to be rerun. Since it is meaningless to call D and E when an exception occurs in C, there is no need to call D and E. During compensation, only D and E need to be called normally.
[0120] Step S30: If the microservice interface is an interface to be compensated, a compensation method corresponding to the interface to be compensated is executed based on the skip flag of the interface to be compensated.
[0121] In this embodiment, if it is determined that the current microservice interface is the interface to be compensated, that is, the current microservice interface is an abnormal interface or the upstream interface of the abnormal interface, the skip flag (IsIgnore) of the interface to be compensated is identified, and according to the skip flag, it is decided which compensation method to perform on the interface to be compensated.
[0122] Specifically, in one embodiment, step S30 includes:
[0123] Step b1: if the microservice interface is an interface to be compensated, determine a skip flag of the interface to be compensated;
[0124] In one embodiment, if it is determined that the current microservice interface is the interface to be compensated, the skip flag of the interface to be compensated is first determined. In one embodiment, the skip flag can be determined in advance, that is, multiple compensation tests are performed in advance for different microservice interfaces to determine the skip flags of different microservice interfaces.
[0125] In one embodiment, step b1 includes:
[0126] Step b11: if the microservice interface is an interface to be compensated, determine whether the interface to be compensated is an idempotent interface;
[0127] In one embodiment, if it is determined that the current microservice interface is an interface to be compensated, it is further determined whether the interface to be compensated is an idempotent interface, where an idempotent interface refers to an interface where the same conditions are used and the impact of a single request and repeated multiple requests on interface resources is consistent. For example, for an order, no matter how many times the user initiates payment, the order payment interface will only deduct money once, that is, multiple calls to the idempotent interface will not affect the call results.
[0128] Step b12: If yes, determine the skip flag of the interface to be compensated as not skipping;
[0129] If it is determined that the current interface to be compensated is an idempotent interface, since the final call result is not affected, the skip flag of the interface to be compensated is determined to be not skipped, that is, the current interface to be compensated is rerun, and the call result is not affected.
[0130] Step b13: if not, determining the calling scenario of the interface to be compensated;
[0131] If it is determined that the current interface to be compensated is not an idempotent interface, that is, the call result obtained each time the interface to be compensated is called is different, then the call scenario of the interface to be compensated is further determined. It is understandable that since the call dependencies between the microservice interfaces are not the same, it is necessary to analyze the call scenario of the current interface to be compensated.
[0132] Step b14: if the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, then determining the skip flag of the interface to be compensated as skip;
[0133] In one embodiment, if the calling scenario of the current interface to be compensated is: the downstream interface corresponding to the current interface to be compensated does not depend on the return result of the current interface to be compensated, that is, the calling result, then the skip flag of the current interface to be compensated is determined to be skip, that is, no matter what the final return result of the current interface to be compensated is, it will not affect the calling of the next interface, and therefore, it can be skipped directly.
[0134] Step b15: If the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, then determine the skip flag of the interface to be compensated as not skipping.
[0135] In one embodiment, if the calling scenario of the current interface to be compensated is: the downstream interface corresponding to the current interface to be compensated depends on the return result of the current interface to be compensated, then the skip flag of the current interface to be compensated is determined to be not skipped, that is, calling the next interface requires the return result of the current interface to be compensated, and therefore, it cannot be skipped.
[0136] Step b2: if the skip flag is not to skip, determining the logic type of the interface to be compensated;
[0137] In one embodiment, if it is determined that the skip flag of the current interface to be compensated is not to skip, that is, the current interface to be compensated needs to be re-run, then the logic type of the current interface to be compensated is determined to decide which compensation method to use for re-running, wherein the logic type includes query logic, insert logic and update logic.
[0138] Step b3: if the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated;
[0139] In one embodiment, if it is determined that the logic type of the interface to be compensated is query logic, the current interface to be compensated is called to re-execute the corresponding interface logic, that is, to re-run according to the interface logic, wherein the query logic refers to searching for a target object in the database without changing the target object in the database, and is consistent with the previous execution result. For example, for an order query service, a target order number was returned during the last execution, and the same target order number is returned during this execution, etc.
[0140] Step b4: if the logic type is insert logic or update logic, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated;
[0141] In one embodiment, if it is determined that the logic type of the interface to be compensated is insert logic or update logic, the current interface to be compensated is skipped, and the compensation logic corresponding to the interface to be compensated is executed.
[0142] The insertion logic means that when the current interface to be compensated obtains a return result, the return result needs to be inserted into the database for storage. To avoid repeated insertion of the same return result and an error, the current interface to be compensated needs to be skipped. For example, the order management service obtains an order number after executing the corresponding interface logic, and the order number needs to be inserted into the database for storage. When the order management service is abnormal, if the order management service is re-run, the same order number will be inserted, causing an error in the database that the order number is not unique. Therefore, when compensating, the current interface to be compensated is skipped and the corresponding compensation logic is executed.
[0143] It should be explained that when the compensation logic is implemented, a separate compensation interface can be set up, which includes the compensation logic, or the compensation logic can be set in the current interface to be compensated, where the compensation logic is a preset execution method. As in the above example, the compensation logic can be to delete the return results in the database and insert new compensation results, which can be set in advance according to the business attributes of the interface to be compensated.
[0144] Update logic means that each return result of the current compensation interface needs to carry update information, such as time and other information. For example, when submitting an order, the current compensation interface needs to carry the submission time. Therefore, even if the order submitted during compensation is consistent with the order submitted during the exception, additional compensation logic is required to update the submission time.
[0145] That is, if the interface logic of the current interface to be compensated is executed when the logic type of the current interface to be compensated is insert logic or update logic, an error will be reported.
[0146] Step b5: If the skip flag is skip, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated.
[0147] In one embodiment, if it is determined that the skip flag of the current interface to be compensated is skip, the current interface to be compensated is skipped and the compensation logic corresponding to the current interface to be compensated is executed. That is, if the current interface to be compensated is abnormal and cannot be rerun, an additional compensation mechanism is used to replace the current interface to be compensated.
[0148] Among them, the compensation logic of each microservice interface is defined in advance according to the business attributes of the interface. For example, the function of the current microservice interface is to return a received notification after submitting an order, but due to the abnormality of the current microservice interface, the received notification cannot be returned, resulting in the inability to call the subsequent microservice interface. At this time, the compensation logic can be defined in advance: always return a received notification. Therefore, when the current microservice interface is abnormal, the compensation logic can be executed to return a received notification, etc.
[0149] Therefore, the compensation method of this embodiment includes re-executing the interface logic and executing the compensation logic.
[0150] Step S40: If the microservice interface is a normal interface, the interface logic corresponding to the normal interface is executed.
[0151] In this embodiment, if it is determined that the current microservice interface is a normal interface, that is, the current microservice interface is the downstream interface of the abnormal interface, it means that when the abnormality occurs, the interface logic of the microservice interface is not executed, and it is not clear whether the current microservice interface will have an abnormality. At this time, the microservice interface can be called normally and the corresponding interface logic can be executed.
[0152] Further, in one embodiment, in the process of executing the compensation method or executing the interface logic, the microservice exception compensation method further includes:
[0153] Step c: if it is determined that the current microservice interface is an abnormal interface, the number of compensation times of the compensation identifier is determined;
[0154] In one embodiment, during the process of executing the compensation method or executing the interface logic, if the current microservice interface is determined to be an abnormal interface, that is, the service request is abnormal again, the number of compensation times of the compensation identifier of the service request is determined to avoid multiple compensations leading to processing timeouts or meaningless work.
[0155] Step d: if the number of compensations is less than the preset number, the step ID of the abnormal interface is determined based on the microservice orchestration corresponding to the microservice interface, the execution of the compensation method or interface logic is terminated, and the number of compensations of the compensation identifier is updated;
[0156] In one embodiment, if the number of compensations requested by the current service is less than a preset number, the step ID of the abnormal interface is re-determined based on the microservice orchestration corresponding to the microservice interface. It should be noted that the abnormal interface can be the microservice interface when the last exception occurred, or it can be another microservice interface.
[0157] Then, the execution of the compensation method or interface logic is terminated. For example, in the above example, A→B→C→D→E, when the C interface is abnormal, the call of the DE interface is terminated, that is, the DE interface does not need to execute the corresponding compensation method or interface logic.
[0158] Finally, since the exception occurred again, the number of compensations in the compensation flag is updated.
[0159] Step e: if the number of compensation times is still less than the preset number, the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting the service request.
[0160] In one embodiment, after the compensation times are updated, if the updated compensation times are still less than the preset times, the service request is returned to the aggregation layer so that the compensation device can compensate it again, wherein the aggregation layer is the entry point for the compensation device to detect the service request.
[0161] If a service request is detected in this embodiment, it is determined whether the service request carries a compensation identifier, and the compensation identifier is used to characterize the abnormality of the current service request; if it does, the microservice interface corresponding to the service request is determined, and the interface type of the microservice interface is determined; if the microservice interface is an interface to be compensated, the compensation method corresponding to the interface to be compensated is executed based on the skip identifier of the interface to be compensated; if the microservice interface is a normal interface, the interface logic corresponding to the normal interface is executed. The present invention focuses the compensation mechanism on the microservice interface level, without paying attention to changes in business status, reducing the development pressure of R&D personnel. At the same time, because it is compensation for microservice interfaces, it can be reused in any service scenario, thereby realizing intelligent compensation.
[0162] Furthermore, based on the first embodiment of the microservice abnormality compensation method of the present invention, a second embodiment of the microservice abnormality compensation method of the present invention is proposed.
[0163] The second embodiment of the microservice abnormality compensation method is different from the first embodiment of the microservice abnormality compensation method in that, after step S10, the microservice abnormality compensation method further includes:
[0164] Step f: if not carried, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface, and execute the interface logic corresponding to the microservice interface in sequence based on the microservice orchestration;
[0165] Among them, if the current microservice interface is determined to be an abnormal interface when executing the interface logic of the current microservice interface, the step ID of the abnormal interface is determined based on the microservice orchestration, the execution of the interface logic is terminated, and the service request is marked with a compensation identifier, and the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting service requests.
[0166] When this embodiment determines that the current service request does not carry a compensation identifier, the interface logic of each microservice interface is executed normally. If an exception occurs during the execution of the interface logic, the abnormal microservice interface is marked. At the same time, the current service request is also marked so that it can be compensated later. That is, the compensation device of this embodiment can execute normal interface calls and compensate for abnormal interface calls. It can be applied to any complex service scenarios and is highly intelligent.
[0167] The following is a detailed description of each step:
[0168] Step f: If not carried, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface, and based on the microservice orchestration, execute the interface logic corresponding to the microservice interface in sequence.
[0169] In this embodiment, if the compensation device determines that the current service request does not carry a compensation identifier, indicating that the current service request has not had any exceptions, it first determines the microservice interface corresponding to the current service request and the microservice orchestration corresponding to the microservice interface, thereby determining the calling order of each microservice interface. Therefore, according to the microservice orchestration corresponding to the microservice interface, the interface logic corresponding to the microservice interface can be executed in sequence without triggering the compensation logic.
[0170] Among them, if when executing the interface logic of the current microservice interface, it is determined that the current microservice interface is an abnormal interface, the step ID of the abnormal interface is determined according to the microservice orchestration corresponding to the microservice interface, and then the execution of the interface logic is terminated, and the service request is marked with a compensation identifier so that the current service request carries the compensation identifier. Specifically, it is preferred to bind the RequestId of the current service request to CompensateExecute at the aggregation layer, and set the compensation state of the CompensateExecute to true, so that the current service request carries the compensation identifier, and finally return the service request carrying the compensation identifier to the aggregation layer so that the compensation device can compensate it.
[0171] Furthermore, the step of determining that the current microservice interface is an abnormal interface includes:
[0172] Step i, determining the service status of the current microservice interface, wherein if the service status is stopped, determining that the current microservice interface is an abnormal interface; or
[0173] Step ii, determining the number of calls of the call request of the current microservice interface, wherein if the number of calls exceeds a preset number, determining that the current microservice interface is an abnormal interface; or
[0174] Step iii: determine the call response time of the current microservice interface, wherein if the call response time exceeds a preset time, determine that the current microservice interface is an abnormal interface.
[0175] In one embodiment, whether the current microservice interface is an abnormal interface can be determined through the service status of the microservice interface. If the service status is stopped service, the current microservice interface is determined to be an abnormal interface. For example, in the above example, A→B→C→D→E, if B is updating and restarting, B cannot be called at this time. Therefore, the service status of B is stopped service, and B is an abnormal interface.
[0176] In addition, it can also be determined based on the number of call requests of the microservice interface. If the number of call requests exceeds a preset number, the current microservice interface is determined to be an abnormal interface. This is to avoid multiple call requests that may cause concurrent exceptions.
[0177] In addition, it can also be determined based on the call response time of the microservice interface. If the call time of the microservice interface exceeds the preset time, it is determined that the current microservice interface is an abnormal interface. It can be understood that if network jitter occurs, such as network freeze, it will cause untimely response, and thus issue an exception.
[0178] When this embodiment determines that the current service request does not carry a compensation identifier, the interface logic of each microservice interface is executed normally. If an exception occurs during the execution of the interface logic, the abnormal microservice interface is marked. At the same time, the current service request is also marked so that it can be compensated later. That is, the compensation device of this embodiment can execute normal interface calls and compensate for abnormal interface calls. It can be applied to any complex service scenarios and is highly intelligent.
[0179] The present invention also provides a microservice abnormality compensation device. The microservice abnormality compensation device of the present invention comprises:
[0180] A detection module, for determining, if a service request is detected, whether the service request carries a compensation identifier, wherein the compensation identifier is used to indicate that the current service request is abnormal;
[0181] A determination module, used to determine the microservice interface corresponding to the service request, and determine the interface type of the microservice interface;
[0182] An execution module, configured to execute a compensation method corresponding to the interface to be compensated based on a skip flag of the interface to be compensated if the microservice interface is the interface to be compensated;
[0183] The execution module is used to execute the interface logic corresponding to the normal interface if the microservice interface is a normal interface.
[0184] Preferably, the execution module is also used for:
[0185] If the microservice interface is an interface to be compensated, determining a skip flag of the interface to be compensated;
[0186] If the skip flag is not to skip, determining the logic type of the interface to be compensated;
[0187] If the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated;
[0188] If the logic type is insert logic or update logic, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated;
[0189] If the skip flag is skip, the interface to be compensated is skipped and the compensation logic corresponding to the interface to be compensated is executed.
[0190] Preferably, the execution module is also used for:
[0191] If the microservice interface is an interface to be compensated, determining whether the interface to be compensated is an idempotent interface;
[0192] If yes, determining the skip flag of the interface to be compensated as not skipping;
[0193] If not, determining the calling scenario of the interface to be compensated;
[0194] If the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated as skip;
[0195] If the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, the skip flag of the interface to be compensated is determined to be not skipped.
[0196] Preferably, the determining module is further used for:
[0197] If it is carried, determining the microservice interface corresponding to the service request and the abnormal interface corresponding to the service request, wherein the abnormal interface is at least one interface in the microservice interface;
[0198] Determine the upstream interface and the downstream interface corresponding to the abnormal interface based on the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface;
[0199] The upstream interface and the abnormal interface are determined as interfaces to be compensated, and the downstream interface is determined as a normal interface.
[0200] Preferably, in the process of executing the compensation mode or executing the interface logic, the execution module is further used for:
[0201] If it is determined that the current microservice interface is an abnormal interface, the number of compensation times of the compensation identifier is determined;
[0202] If the number of compensations is less than the preset number, the step ID of the abnormal interface is determined based on the microservice orchestration corresponding to the microservice interface, the execution of the compensation method or interface logic is terminated, and the number of compensations of the compensation identifier is updated;
[0203] If the number of compensation times is still less than the preset number, the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting the service request.
[0204] Preferably, the determining module is further used for:
[0205] If not, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface;
[0206] The execution module is also used for:
[0207] Based on the microservice orchestration, the interface logic corresponding to the microservice interface is executed in sequence;
[0208] Among them, if the current microservice interface is determined to be an abnormal interface when executing the interface logic of the current microservice interface, the step ID of the abnormal interface is determined based on the microservice orchestration, the execution of the interface logic is terminated, and the service request is marked with a compensation identifier, and the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting service requests.
[0209] Preferably, the determining module is further used for:
[0210] Determine the service status of the current microservice interface, wherein if the service status is stopped, determine that the current microservice interface is an abnormal interface; or
[0211] Determine the number of calls of the call request of the current microservice interface, wherein if the number of calls exceeds a preset number, determine that the current microservice interface is an abnormal interface; or
[0212] Determine the call response time of the current microservice interface, wherein if the call response time exceeds a preset time, determine that the current microservice interface is an abnormal interface.
[0213] The present invention also provides a computer-readable storage medium.
[0214] A microservice anomaly compensation program is stored on a computer-readable storage medium of the present invention, and when the microservice anomaly compensation program is executed by a processor, the steps of the microservice anomaly compensation method described above are implemented.
[0215] Among them, the method implemented when the microservice abnormality compensation program running on the processor is executed can refer to the various embodiments of the microservice abnormality compensation method of the present invention, and will not be repeated here.
[0216] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0217] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0218] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0219] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A microservice abnormality compensation method, characterized in that: The microservice abnormality compensation method comprises the following steps: If a service request is detected, determining whether the service request carries a compensation identifier, the compensation identifier being used to indicate that the current service request is abnormal; If it is carried, determine the microservice interface corresponding to the service request and determine the interface type of the microservice interface; If the microservice interface is an interface to be compensated, determining whether the interface to be compensated is an idempotent interface; If yes, determining the skip flag of the interface to be compensated as not skipping; If not, determining the calling scenario of the interface to be compensated; If the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated as skip; If the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated as not skipping; If the skip flag is not to skip, determining the logic type of the interface to be compensated; If the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated; If the logic type is insert logic or update logic, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated; If the skip flag is skip, skip the interface to be compensated and execute the compensation logic corresponding to the interface to be compensated; If the microservice interface is a normal interface, the interface logic corresponding to the normal interface is executed.
2. The microservice abnormality compensation method according to claim 1, characterized in that: If the service request is carried, the step of determining the microservice interface corresponding to the service request and determining the interface type of the microservice interface includes: If it is carried, determining the microservice interface corresponding to the service request and the abnormal interface corresponding to the service request, wherein the abnormal interface is at least one interface in the microservice interface; Determine the upstream interface and the downstream interface corresponding to the abnormal interface based on the step ID of the abnormal interface and the microservice orchestration corresponding to the microservice interface; The upstream interface and the abnormal interface are determined as interfaces to be compensated, and the downstream interface is determined as a normal interface.
3. The microservice abnormality compensation method according to any one of claims 1 to 2, characterized in that: In the process of executing the compensation method or executing the interface logic, the microservice exception compensation method also includes: If it is determined that the current microservice interface is an abnormal interface, the number of compensation times of the compensation identifier is determined; If the number of compensations is less than the preset number, the step ID of the abnormal interface is determined based on the microservice orchestration corresponding to the microservice interface, the execution of the compensation method or interface logic is terminated, and the number of compensations of the compensation identifier is updated; If the number of compensation times is still less than the preset number, the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting the service request.
4. The microservice abnormality compensation method according to any one of claims 1 to 2, characterized in that: After the step of determining whether the service request carries a compensation identifier if a service request is detected, the microservice exception compensation method further includes: If not, determine the microservice interface corresponding to the service request and the microservice orchestration corresponding to the microservice interface, and execute the interface logic corresponding to the microservice interface in sequence based on the microservice orchestration; Among them, if the current microservice interface is determined to be an abnormal interface when executing the interface logic of the current microservice interface, the step ID of the abnormal interface is determined based on the microservice orchestration, the execution of the interface logic is terminated, and the service request is marked with a compensation identifier, and the service request is returned to the aggregation layer, wherein the aggregation layer is the entry for detecting service requests.
5. The microservice abnormality compensation method according to claim 4, characterized in that: The step of determining that the current microservice interface is an abnormal interface includes: Determine the service status of the current microservice interface, wherein if the service status is stopped, determine that the current microservice interface is an abnormal interface; or Determine the number of calls of the call request of the current microservice interface, wherein if the number of calls exceeds a preset number, determine that the current microservice interface is an abnormal interface; or Determine the call response time of the current microservice interface, wherein if the call response time exceeds a preset time, determine that the current microservice interface is an abnormal interface.
6. A microservice abnormality compensation device, characterized in that: The microservice abnormality compensation device comprises: A detection module, for determining, if a service request is detected, whether the service request carries a compensation identifier, wherein the compensation identifier is used to indicate that the current service request is abnormal; A determination module, used to determine the microservice interface corresponding to the service request, and determine the interface type of the microservice interface; An execution module, for determining whether the interface to be compensated is an idempotent interface if the microservice interface is an interface to be compensated; if so, determining the skip flag of the interface to be compensated to be not skipped; if not, determining the calling scenario of the interface to be compensated; if the calling scenario is that the downstream interface corresponding to the interface to be compensated does not depend on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated to be skipped; if the calling scenario is that the downstream interface corresponding to the interface to be compensated depends on the return result of the interface to be compensated, determining the skip flag of the interface to be compensated to be not skipped; if the skip flag is not skipped, determining the logic type of the interface to be compensated; if the logic type is query logic, calling the interface to be compensated to re-execute the interface logic corresponding to the interface to be compensated; if the logic type is insert logic or update logic, skipping the interface to be compensated and executing the compensation logic corresponding to the interface to be compensated; if the skip flag is skipped, skipping the interface to be compensated and executing the compensation logic corresponding to the interface to be compensated; The execution module is used to execute the interface logic corresponding to the normal interface if the microservice interface is a normal interface.
7. A microservice abnormality compensation device, characterized in that: The microservice exception compensation device includes: a memory, a processor, and a microservice exception compensation program stored in the memory and executable on the processor. When the microservice exception compensation program is executed by the processor, the steps of the microservice exception compensation method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a microservice anomaly compensation program, and when the microservice anomaly compensation program is executed by the processor, the steps of the microservice anomaly compensation method according to any one of claims 1 to 5 are implemented.
