An api fuse method based on hierarchical dynamic feedback and multi-factor decision
By employing a hierarchical dynamic feedback and multi-factor decision-making approach for API circuit breaking, the problem of inaccurate API circuit breaking in microservice architectures is solved, achieving API-level circuit breaking control and improving gateway forwarding efficiency.
Patent Information
- Application Number
- CN202311702319.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-12-12
AI Technical Summary
In a microservice architecture, existing API circuit breaker mechanisms struggle to make precise decisions down to the API level, leading to circuit breakers not meeting expectations and impacting gateway forwarding efficiency.
An API circuit breaker method with hierarchical dynamic feedback and multi-factor decision-making is adopted. Through a two-level gateway and a high-speed cache, combined with an evaluation model, the API weight and circuit breaker recovery time are dynamically updated to achieve API-level circuit breaker control.
It achieves fine-grained and flexible circuit breaker control at the API level, reduces gateway communication overhead, can detect resource pool service downtime in advance and trigger circuit breakers, and improves gateway forwarding efficiency and controllability.
Smart Images

Figure CN117827157B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of IT and software development technology, specifically relating to an API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making. Background Technology
[0002] In a microservice architecture, the API gateway serves as the unified entry point for the entire system, responsible for managing all request traffic within the system and forwarding all API requests to the backend server. It typically possesses several core functions, including unified access, protocol adaptation, traffic monitoring and fault tolerance, and security protection. The circuit breaker mechanism is a microservice link protection mechanism to address the cascading failure effect. When a microservice in the call chain becomes unavailable or has a long response time, service degradation occurs, thereby suspending the call to that node's microservice and quickly returning error response information.
[0003] The gateway is responsible for forwarding APIs of all products in all resource pools within the platform. If we want to implement circuit breaking at the API level, the amount of data in a single cache is large, and each request needs to query the cache, which affects the forwarding efficiency of the gateway. If we treat resource pool + product as a circuit breaking service object, and one or two high-frequency APIs in the service fail frequently, the commonly used failure count and failure rate decision algorithm is prone to triggering circuit breaking, which does not meet expectations. Summary of the Invention
[0004] The purpose of this invention is to provide an API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making, which can more reasonably decide whether to circuit breaker the entire product service in the resource pool by setting different weights for APIs.
[0005] The specific technical solution adopted by this invention is as follows:
[0006] An API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making includes:
[0007] Obtain the two-level gateway in the microservice architecture, which includes a national region gateway and a resource pool gateway;
[0008] Obtain statistical information for each API, including the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time, wherein the circuit breaker flag includes circuit breaker and normal.
[0009] A high-speed cache memory is constructed based on API statistics, and the high-speed cache memory includes a first cache memory and a second cache memory;
[0010] The total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory is updated based on statistical information, and then input into the evaluation model. The triggering instruction is determined based on the output of the evaluation model, wherein the triggering instruction includes triggering circuit breaking or triggering circuit breaking recovery.
[0011] In a preferred embodiment, the national gateway and the resource pool gateway maintain health monitoring, and after two consecutive failures of health monitoring, the resource pool network is determined to be unreachable, and the first buffer memory updates the circuit breaker flag and the fuse recovery time.
[0012] The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
[0013] In a preferred embodiment, when a new API request is added, the target business logic layer to which the API belongs is obtained, and the total weight of APIs that have been circuit-broken in a single business logic layer, the total weight threshold of circuit-broken APIs in a single business logic layer, the circuit breaker flag, and the circuit-broken recovery time are queried in the first buffer memory.
[0014] If the total weight threshold of the circuit breaker in a single business logic layer is zero, and the circuit breaker recovery time is after the current time, it indicates that the API is within the circuit breaker period, and the national gateway directly rejects the API; otherwise, the API is forwarded to the corresponding resource pool gateway.
[0015] In a preferred embodiment, if the total weight threshold of the circuit breaker in the single business logic layer is zero and the circuit breaker recovery time is before the current time, it indicates that the circuit breaker has expired but no update has been performed, and an update of the first buffer memory is immediately triggered asynchronously, and then the API is forwarded to the corresponding resource pool gateway.
[0016] In a preferred embodiment, before receiving an API request, the resource pool gateway queries the second buffer memory according to the routing rules to obtain the number of API failures within the corresponding sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time.
[0017] In a preferred embodiment, after the API request is read, the total weight threshold of the circuit breaker and the circuit breaker recovery time in a single business logic layer in the second buffer memory are obtained. If the total weight threshold of the circuit breaker in the single business logic layer is zero and the circuit breaker recovery time is after the current time, the resource pool gateway directly rejects the API; otherwise, the API is forwarded to the corresponding business logic layer.
[0018] In a preferred embodiment, the total weight threshold of the circuit breaker in the single business logic layer is zero, and the circuit breaker recovery time is before the current time, indicating that the circuit breaker has expired but no update has been performed, and the number of API failures and the API failure rate within the sliding window time of the corresponding routing rule in the second buffer memory are updated immediately.
[0019] In a preferred embodiment, when the second buffer memory performs an update, it obtains the API failure count threshold and the API failure rate threshold, and compares them with the API failure count and the API failure rate within the sliding window time, respectively. When the API failure count within the sliding window time is greater than the API failure count threshold and the API failure rate within the sliding window time is greater than the API failure rate threshold, the circuit breaker flag and the fuse recovery time in the second buffer memory are updated.
[0020] The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
[0021] In a preferred embodiment, the step of determining the trigger instruction based on the output of the evaluation model includes:
[0022] Obtain the circuit breaker weight of a single API under the circuit breaker flag, and label it as a parameter to be evaluated;
[0023] Call the evaluation function from the evaluation model;
[0024] Input the parameters to be evaluated into the evaluation model to obtain the total weight of the APIs that have been circuit-broken in a single business logic layer;
[0025] If the total weight of the APIs that have been circuit-broken in the single business logic layer is greater than or equal to the threshold of the total weight of the circuit-broken APIs in the single business logic layer, then a trigger instruction to trigger the circuit breaker is generated.
[0026] If the total weight of the APIs that have been circuit-broken in a single business logic layer is less than the threshold of the total weight of the circuit-broken APIs in a single business logic layer, a trigger instruction to restore the circuit breaker is generated, and the circuit breaker flag is updated to normal.
[0027] This invention also provides an API circuit breaker system based on hierarchical dynamic feedback and multi-factor decision-making, applied to the aforementioned API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making, comprising:
[0028] The first acquisition module is used to acquire the two-level gateways in the microservice architecture, the two-level gateways including the national region gateway and the resource pool gateway;
[0029] The statistics module is used to obtain statistical information for each API. The statistical information includes the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time. The circuit breaker flag includes circuit breaker and normal status.
[0030] The second acquisition module is used to build a high-speed cache memory based on the statistical information of the API. The high-speed cache memory includes a first cache memory and a second cache memory.
[0031] An evaluation module is used to update the total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory based on statistical information, and then input it into the evaluation model. The module determines the triggering instruction based on the output of the evaluation model. The triggering instruction includes triggering circuit breaking or triggering circuit breaking recovery.
[0032] The technical effects achieved by this invention are as follows:
[0033] This invention achieves API-level circuit breaker control by using multiple caches distributed through hierarchical gateways. Combined with asynchronous dynamic feedback and multi-factor decision-making, it comprehensively analyzes statistical data from different dimensions at different stages of API forwarding. By setting different weights for APIs, it makes more reasonable decisions on whether to circuit breaker the entire product service in the resource pool. Combined with the multi-factor decision-making algorithm, it controls the number of elements in a single cache, and the overhead of the gateway's circuit breaker judgment is negligible. Communication between gateways can detect service downtime in the resource pool and trigger circuit breakers in advance. In addition to supporting API-level control, it can also more flexibly manage the occurrence and recovery of circuit breakers by setting various weights and thresholds, achieving a balance of fine-grained, flexible, and controllable control. Attached Figure Description
[0034] Figure 1 This is a flowchart of the method provided by the present invention. Detailed Implementation
[0035] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0036] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0037] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in a preferred embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that mutually excludes other embodiments.
[0038] Please see Figure 1 As shown, this invention provides an API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making, including:
[0039] S1. Obtain the two-level gateway in the microservice architecture, which includes the national region gateway and the resource pool gateway.
[0040] S2. Obtain statistical information for each API. The statistical information includes the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time. The circuit breaker flag includes circuit breaker and normal.
[0041] S3. Based on the API statistics, a high-speed cache memory is built, which includes a first cache memory and a second cache memory.
[0042] S4. Update the total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory according to the statistical information, then input it into the evaluation model, and determine the trigger instruction according to the output of the evaluation model. The trigger instruction includes triggering circuit breaking or triggering circuit breaking recovery.
[0043] As described in steps S1-S4 above, with the rapid development of the Internet, Application Programming Interfaces (APIs) have become an indispensable part of modern software development. APIs allow different software systems to communicate and exchange data, thereby achieving efficient system integration. However, due to network latency, server failures, and other reasons, API calls may fail, leading to a decrease in the performance of the entire system or even a crash. To solve this problem, the API circuit breaker mechanism has emerged. In this embodiment, a two-level gateway is first built in the microservice architecture, which includes a national regional gateway and a resource pool gateway. Then, statistical information of each API is obtained, including the current time, sliding window duration, circuit breaker response time, number of API failures within the sliding window period, and the number of API failures within the sliding window period. The failure rate of the API, the circuit breaker weight of a single API, the circuit breaker flag, the total weight of APIs that have been circuit-broken in a single business logic layer, the total weight threshold of the circuit breaker in a single business logic layer, the API failure count threshold, and the API failure rate threshold are input into a high-speed cache. In this embodiment, the high-speed cache includes a first cache and a second cache, which correspond to the national regional gateway and the resource pool gateway, respectively. After obtaining a new API request, an evaluation model is used to output a trigger instruction to determine the output of the trigger instruction. Combined with a multi-factor decision algorithm, the number of elements in a single cache is controlled, and the overhead of the gateway in making circuit breaker judgments is negligible. Communication between gateways can detect service downtime in the resource pool and trigger circuit breakers in advance.
[0044] In a preferred embodiment, health monitoring is maintained between the national gateway and the resource pool gateway, and if the health monitoring fails twice in a row, the resource pool network is determined to be unreachable, and the first buffer memory updates the circuit breaker flag and the fuse recovery time.
[0045] The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
[0046] In this implementation, the purpose of continuous health monitoring is to ensure that the resource pool network can be monitored in real time, so that API call requests can be accurately read. After the circuit breaker flag is updated to the circuit breaker status, the circuit breaker recovery time will be offset based on the current time according to the sliding window duration, and the offset result will be marked as the circuit breaker recovery time.
[0047] Secondly, when a new API request is added, the target business logic layer to which the API belongs is obtained, and the total weight of APIs that have been circuit-broken in a single business logic layer, the total weight threshold of circuit-broken APIs in a single business logic layer, the circuit breaker flag, and the circuit-broken recovery time are queried in the first buffer memory.
[0048] If the total weight threshold of the circuit breaker in a single business logic layer is zero, and the circuit breaker recovery time is after the current time, it indicates that the API is within the circuit breaker period, and the national gateway directly rejects the API. Otherwise, the API is forwarded to the corresponding resource pool gateway.
[0049] In addition, if the total weight threshold of the circuit breaker in a single business logic layer is zero and the circuit breaker recovery time is before the current time, it indicates that the circuit breaker has expired but no update has been performed, and an update of the first buffer memory is immediately triggered asynchronously, and then the API is forwarded to the corresponding resource pool gateway.
[0050] In this implementation, when a new API request is added, the target business logic layer to which the API belongs is first determined. Then, the total weight of APIs that have been circuit-broken in a single business logic layer, the total weight threshold of circuit breaking in a single business logic layer, the circuit breaker flag, and the circuit breaking recovery time are queried from the first buffer memory. It is then determined whether the total weight threshold of circuit breaking in a single business logic layer is zero. If the value is zero, the national gateway directly rejects the API; otherwise, it will be sent to the resource pool gateway.
[0051] In a preferred implementation, before receiving an API request, the resource pool gateway queries the second buffer memory according to the routing rules to obtain the number of API failures within the corresponding sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time.
[0052] Secondly, after the API request is read, the total weight threshold and recovery time of the circuit breaker in a single business logic layer are obtained from the second buffer. If the total weight threshold of the circuit breaker in a single business logic layer is zero and the recovery time is after the current time, the resource pool gateway directly rejects the API. Otherwise, the API is forwarded to the corresponding business logic layer.
[0053] Secondly, if the total weight threshold of the circuit breaker in a single business logic layer is zero and the circuit breaker recovery time is before the current time, it indicates that the circuit breaker has expired but no update has been performed. The number of API failures and the API failure rate within the sliding window time of the corresponding routing rule in the second buffer memory should be updated immediately.
[0054] In this implementation, before receiving an API request, the resource pool gateway will query the second buffer to obtain the number of API failures within the corresponding sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time. Its determination process for the total circuit breaker weight threshold in a single business logic layer is the same as that of the national gateway, and will not be repeated here.
[0055] In a preferred embodiment, when the second buffer memory performs an update, it obtains the API failure count threshold and the API failure rate threshold, and compares them with the API failure count and the API failure rate within the sliding window time, respectively. When the API failure count within the sliding window time is greater than the API failure count threshold and the API failure rate within the sliding window time is greater than the API failure rate threshold, the circuit breaker flag and the fuse recovery time in the second buffer memory are updated.
[0056] The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
[0057] In this implementation, when both the national gateway and the resource pool gateway reject the API request, the API will be forwarded to the specific business logic layer. When the number of API failures exceeds the API failure threshold within the sliding window time, and the API failure rate exceeds the API failure rate threshold within the sliding window time, the circuit breaker flag and circuit breaker recovery time in the second buffer memory are updated to achieve flexible control over the occurrence and recovery of circuit breakers.
[0058] In a preferred embodiment, the step of determining the trigger command based on the output of the evaluation model includes:
[0059] S401. Obtain the circuit breaker weight of a single API under the circuit breaker flag as circuit breaker and mark it as the parameter to be evaluated.
[0060] S402. Call the evaluation function from the evaluation model;
[0061] S403. Input the parameters to be evaluated into the evaluation model to obtain the total weight of the APIs that have been circuit-broken in a single business logic layer.
[0062] If the total weight of the APIs that have been circuit-broken in a single business logic layer is greater than or equal to the threshold of the total weight of the circuit-broken APIs in a single business logic layer, then a trigger instruction to trigger the circuit breaker will be generated.
[0063] If the total weight of the APIs that have been circuit-broken in a single business logic layer is less than the threshold for the total weight of the circuit-broken APIs in a single business logic layer, a trigger instruction to restore the circuit breaker is generated, and the circuit breaker flag is updated to normal.
[0064] As described in steps S401-S403 above, when the evaluation model is executed, the fusing weight of a single API under the circuit breaker marked as fusing is first calibrated as the parameter to be evaluated, and then the parameter to be evaluated is output to the evaluation function, wherein the expression of the evaluation function is: In the formula, TW represents the total weight of APIs that have been circuit-broken in a single business logic layer, n represents the number of parameters to be evaluated, and W... iThis indicates the parameter to be evaluated. After the total weight of the APIs that have been circuit-broken in a single business logic layer is output, it will be compared with the total weight threshold of the circuit-broken API in the single business logic layer to determine the trigger for circuit breaking and the issuance of the circuit breaking command.
[0065] This invention also provides an API circuit breaker system based on hierarchical dynamic feedback and multi-factor decision-making, applied to the aforementioned API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making, comprising:
[0066] The first acquisition module is used to acquire the two-level gateways in the microservice architecture, the two-level gateways including the national region gateway and the resource pool gateway;
[0067] The statistics module is used to obtain statistical information for each API. The statistical information includes the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time. The circuit breaker flag includes circuit breaker and normal status.
[0068] The second acquisition module is used to build a high-speed cache memory based on the statistical information of the API. The high-speed cache memory includes a first cache memory and a second cache memory.
[0069] An evaluation module is used to update the total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory based on statistical information, and then input it into the evaluation model. The module determines the triggering instruction based on the output of the evaluation model. The triggering instruction includes triggering circuit breaking or triggering circuit breaking recovery.
[0070] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0071] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.
Claims
1. An API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making, characterized in that: include: Obtain the two-level gateway in the microservice architecture, which includes a national region gateway and a resource pool gateway; Obtain statistical information for each API, including the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time, wherein the circuit breaker flag includes circuit breaker and normal. A high-speed cache memory is constructed based on API statistics, and the high-speed cache memory includes a first cache memory and a second cache memory; The total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory is updated based on statistical information, and then input into the evaluation model. The triggering instruction is determined based on the output of the evaluation model, wherein the triggering instruction includes triggering circuit breaking or triggering circuit breaking recovery. When a new API request is added, the target business logic layer to which the API belongs is obtained, and the total weight of APIs that have been circuit-broken in a single business logic layer, the total weight threshold of circuit-broken APIs in a single business logic layer, the circuit breaker flag, and the circuit-broken recovery time are queried in the first buffer memory. If the total weight threshold of the circuit breaker in the single business logic layer is zero and the circuit breaker recovery time is after the current time, it indicates that the API is within the circuit breaker period and the national gateway directly rejects the API; otherwise, the API is forwarded to the corresponding resource pool gateway. If the total weight threshold of the circuit breaker in the single business logic layer is zero and the circuit breaker recovery time is before the current time, it indicates that the circuit breaker has expired but no update has been performed. The first buffer memory is then updated asynchronously and the API is forwarded to the corresponding resource pool gateway. After the API request is read, the total weight threshold and circuit breaker recovery time of a single business logic layer in the second buffer memory are obtained. If the total weight threshold of the circuit breaker in the single business logic layer is zero and the circuit breaker recovery time is after the current time, the resource pool gateway directly rejects the API. Otherwise, the API is forwarded to the corresponding business logic layer.
2. The API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making according to claim 1, characterized in that: The national gateway and the resource pool gateway maintain health monitoring, and after two consecutive failures of health monitoring, the resource pool gateway is determined to be unreachable, and the first buffer memory updates the circuit breaker flag and the fuse recovery time. The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
3. The API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making according to claim 1, characterized in that: Before receiving an API request, the resource pool gateway retrieves the number of API failures within the corresponding sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time from the second buffer memory according to the routing rules.
4. The API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making according to claim 1, characterized in that: If the total weight threshold of the circuit breaker in a single business logic layer is zero and the circuit breaker recovery time is before the current time, it indicates that the circuit breaker has expired but no update has been performed. The number of API failures and the API failure rate within the sliding window time of the corresponding routing rule in the second buffer memory are updated immediately.
5. The API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making according to claim 4, characterized in that: When the second buffer is updated, it obtains the API failure count threshold and the API failure rate threshold, and compares them with the API failure count and API failure rate within the sliding window time, respectively. When the API failure count within the sliding window time is greater than the API failure count threshold and the API failure rate within the sliding window time is greater than the API failure rate threshold, it updates the circuit breaker flag and the fuse recovery time in the second buffer. The updated circuit breaker is marked as blown, and the blown recovery time is obtained by offsetting the current time based on the sliding window duration.
6. The API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making according to claim 1, characterized in that: The step of determining the trigger command based on the output of the evaluation model includes: Obtain the circuit breaker weight of a single API under the circuit breaker flag, and label it as a parameter to be evaluated; Call the evaluation function from the evaluation model; Input the parameters to be evaluated into the evaluation model to obtain the total weight of the APIs that have been circuit-broken in a single business logic layer; If the total weight of the APIs that have been circuit-broken in the single business logic layer is greater than or equal to the threshold of the total weight of the circuit-broken APIs in the single business logic layer, then a trigger instruction to trigger the circuit breaker is generated. If the total weight of the APIs that have been circuit-broken in a single business logic layer is less than the threshold of the total weight of the circuit-broken APIs in a single business logic layer, a trigger instruction to restore the circuit breaker is generated, and the circuit breaker flag is updated to normal.
7. An API circuit breaker system based on hierarchical dynamic feedback and multi-factor decision-making, applied to the API circuit breaker method based on hierarchical dynamic feedback and multi-factor decision-making as described in any one of claims 1 to 6, characterized in that: include: The first acquisition module is used to acquire the two-level gateways in the microservice architecture, the two-level gateways including the national region gateway and the resource pool gateway; The statistics module is used to obtain statistical information for each API. The statistical information includes the number of API failures within the sliding window time, the API failure rate within the sliding window time, the circuit breaker weight of a single API, the circuit breaker flag, and the circuit breaker recovery time. The circuit breaker flag includes circuit breaker and normal status. The second acquisition module is used to build a high-speed cache memory based on the statistical information of the API. The high-speed cache memory includes a first cache memory and a second cache memory. An evaluation module is used to update the total weight of the APIs that have been circuit-broken in a single business logic layer in the first buffer memory based on statistical information, and then input it into the evaluation model. The module determines the triggering instruction based on the output of the evaluation model. The triggering instruction includes triggering circuit breaking or triggering circuit breaking recovery.
Citation Information
Patent Citations
API gateway guarantee service high availability method and system based on fusing and secondary caching
CN110413543A
Intelligent gateway dynamic flow limiting implementation method
CN113595925A