Micro-service fusing processing method, micro-service system, storage medium and program product

By obtaining exception call information in the flash monitoring center of the microservice system and probing it, the problem of low timeliness of existing microservice flash processing methods is solved, and faster flash processing and reduced business losses are achieved.

CN119415296APending Publication Date: 2025-02-11CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411403690.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing microservice circuit breaker processing method has low time efficiency, which causes the business system to continue to have an impact during the waiting period to determine the abnormality of the server instance, increasing business losses.

Method used

By obtaining exception call information in the fuse monitoring center of the microservice system, including a second application instance whose call request response time is greater than the preset time threshold for the first application instance, the detection is performed and the fuse processing is performed when the detection fails.

Benefits of technology

Improve the timeliness of circuit breaker processing, reduce business losses, timely isolate abnormal instances, and avoid large-scale call exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415296A_ABST
    Figure CN119415296A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-service fusing processing method, a micro-service system, a storage medium and a program product, and relates to the technical field of micro-services. When the response duration of a second application instance to a call request of a first application instance is greater than a preset duration threshold, it is considered that the second application instance may have an abnormality; therefore, after the fusing monitoring center obtains the abnormal calling information, the second application instance needs to be detected, and a detection result is obtained; when the detection result is that the detection fails, fusing processing can be performed on the second application instance; according to the application, the fusing monitoring center can detect the second application instance which may be abnormal in time when acquiring the abnormal calling information of which the response duration is greater than the preset duration threshold value, and when the detection result is that the detection fails, the second application instance can be fused, so that the effectiveness of fusing processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of microservice technology, and in particular to a microservice fuse processing method, a microservice system, a storage medium, and a program product. Background Art

[0002] The existing microservice circuit breaker processing method mainly determines that the server instance is abnormal when the client instance and the server instance are called online. If there are multiple connection failures or multiple read timeouts, the server instance will be judged to be abnormal and circuit breaker measures will be taken.

[0003] However, while waiting for a determination that an abnormality has occurred in the server instance, the abnormality that has already occurred in the server instance will continue to have an impact on the business system, resulting in a continuous increase in business losses.

[0004] Therefore, there is a technical problem in the related art that the efficiency of fuse processing is low. Summary of the invention

[0005] The main purpose of this application is to provide a microservice fuse processing method, a microservice system, a storage medium and a program product, aiming to solve the technical problem of low efficiency of fuse processing.

[0006] To achieve the above objectives, the present application proposes a microservice fuse processing method, which is applied to a fuse monitoring center in a microservice system. The method includes:

[0007] Acquire abnormal call information, where the abnormal call information includes a second application instance whose response time to the call request of the first application instance is greater than a preset time threshold;

[0008] Detecting the second application example to obtain a detection result;

[0009] When the detection result is a detection failure, a fuse is performed on the second application instance.

[0010] In one embodiment, the microservice system further includes a microservice registration center, and when the detection result is a detection failure, the step of performing a fuse process on the second application instance includes:

[0011] When the detection result is a detection failure, the detection result is sent to the microservice registration center, so that the microservice registration center can determine whether to perform a fuse process on the second application instance based on the number of available instances of the target application to which the second application instance belongs and the number of instances that have triggered the fuse process;

[0012] When the microservice registration center feedbacks that the second application instance needs to be fused, the second application instance is fused.

[0013] In one embodiment, when the microservice registration center feedbacks that the second application instance needs to be subjected to a fuse process, after the step of conducting a fuse process on the second application instance, the step further includes:

[0014] When the microservice registration center feedbacks that the second application instance needs to be fused, the instance address of the upstream application corresponding to the second application instance is obtained from the microservice registration center;

[0015] Based on the instance address, information that the second application instance needs to be fused is broadcasted to the upstream instance, so that the upstream instance updates routing information, stops sending service requests to the second application instance, and completes fused processing.

[0016] To achieve the above objectives, the present application proposes a microservice fuse processing method, which is applied to an abnormality monitoring module in a microservice system, and the method further includes:

[0017] Obtaining the first response time of the other application instances to the calling request after the first application instance initiates the calling request to the other application instances;

[0018] Determine whether the first response time is greater than a preset time threshold;

[0019] If it is greater, an exception call information is sent to the message middleware, so that the fuse monitoring center can obtain the exception call information from the message middleware, detect the second application instance based on the exception call information, and perform fuse processing on the second application instance when the detection result is a detection failure, wherein the second application instance is an application instance in which the first response duration among the other application instances is greater than the preset duration threshold.

[0020] In one embodiment, before the step of determining whether the response time is greater than a preset time threshold, the step further includes:

[0021] Obtaining a second response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to the other application instances within the first historical period;

[0022] Mapping the second response time to a plurality of different preset response time intervals to obtain the number of first requests determined to be outside each preset response time interval;

[0023] The preset duration threshold is determined based on the first number of requests and a target number threshold, wherein the target number threshold is determined based on the second number of requests in the first historical period and a preset accuracy.

[0024] In one embodiment, the step of determining the preset duration threshold based on the first number of requests and a preset accuracy includes:

[0025] When the first number of requests is greater than or equal to a target number threshold, determining the preset duration threshold to be a preset multiple of a starting value of a target response duration interval;

[0026] The target response time interval is determined based on preset response time intervals sorted from small to large and a preset accuracy, and the preset multiple is greater than one.

[0027] In one embodiment, after the step of determining the preset duration threshold as a preset multiple of the starting value of the target response duration interval when the first request number is greater than or equal to the target number threshold, the method further includes:

[0028] Obtaining a third response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to the other application instances within a second historical period, wherein the first historical period is a period previous to the second historical period;

[0029] Mapping the third response duration to the preset response duration intervals to obtain the number of third requests outside each preset response duration interval;

[0030] If the third request number is less than or equal to the preset number threshold, the first number is added to the target number threshold to obtain an updated target number threshold, so as to reduce the preset accuracy;

[0031] If the third request number is greater than the preset number threshold, the second number is reduced based on the target number threshold to obtain an updated target number threshold to improve the preset accuracy.

[0032] In addition, to achieve the above objectives, the present application also proposes a microservice system, which includes a fuse monitoring center and an abnormality monitoring module:

[0033] The abnormal monitoring module is used to obtain the first response time of the other application instance to the call request after the first application instance initiates the call request to the other application instance, and determine whether the first response time is greater than a preset time threshold. If so, send abnormal call information to the message middleware;

[0034] The fuse monitoring center is used to obtain abnormal call information, detect the second application instance, and obtain a detection result. When the detection result is a detection failure, the second application instance is subjected to fuse processing.

[0035] In addition, to achieve the above-mentioned objectives, the present application also proposes a microservice fuse processing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the microservice fuse processing method described above.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the microservice fuse processing method described above are implemented.

[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the microservice fuse processing method described above.

[0038] One or more technical solutions proposed in this application have at least the following technical effects:

[0039] The fuse monitoring center in the microservice system of the present application obtains abnormal call information. Since the abnormal call information includes the second application instance whose response time to the call request of the first application instance is longer than the preset time threshold, it can be understood that when the response time of the second application instance to the call request of the first application instance is longer than the preset time threshold, the call of the first application instance to the second application instance is considered to be an abnormal call, that is, it is considered that the second application instance may have an abnormality; therefore, after the fuse monitoring center obtains the abnormal call information, it is necessary to detect the second application instance to obtain the detection result; when the detection result is a detection failure, the second application instance can be fused. Instead of the related art that needs to determine whether there are multiple connection failures or multiple read timeouts before the fuse is fused, the fuse monitoring center of the present application can timely detect the second application instance that may have an abnormality when obtaining the abnormal call information whose response time is longer than the preset time threshold. When the detection result is a detection failure, the second application instance can be fused, thereby improving the effectiveness of the fusion processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A flowchart of the first embodiment of the microservice fuse processing method of the present application is provided;

[0043] Figure 2 A schematic diagram of a scenario provided for Embodiment 1 of the microservice fuse processing method of this application;

[0044] Figure 3 A flow chart of the second embodiment of the microservice fuse processing method of the present application;

[0045] Figure 4 A schematic diagram of a scenario provided for Embodiment 2 of the microservice fuse processing method of this application;

[0046] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the microservice fuse processing method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] Based on this, the embodiment of the present application provides a microservice fuse processing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the microservice fuse processing method of the present application.

[0051] In this embodiment, the microservice fuse processing method includes steps S10 to S30:

[0052] Step S10, obtaining abnormal call information, wherein the abnormal call information includes a second application instance whose response time to the call request of the first application instance is greater than a preset time threshold;

[0053] It should be noted that the execution subject of this embodiment is the fuse monitoring center in the microservice system, which can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a microservice fuse processing device capable of realizing the above functions. The following takes the fuse monitoring center in the microservice system as an example to illustrate this embodiment and the following embodiments.

[0054] The existing microservice circuit breaker processing method mainly determines that the server instance is abnormal if multiple connection failures or multiple read timeouts occur during the online call between the client instance and the server instance, and then takes circuit breaker measures; however, while waiting for the server instance to be determined to be abnormal, the abnormality that has occurred in the server instance will continue to affect the business system, resulting in continued increase in business losses.

[0055] To solve the above problems, this embodiment aims to improve the timeliness of circuit breaker processing and reduce business losses through the circuit breaker monitoring center in the microservice system.

[0056] Specifically, Figure 2 As shown, the microservice system also includes multiple applications, for example, application A, application B, application C, application X, etc. Each application corresponds to multiple instances, for example, application A corresponds to instance 1 and instance 2, application X corresponds to instance 1, instance 2 and instance 3, etc.

[0057] It can be understood that during the business processing process, the application instances will access each other. The first application instance is the application instance that initiates the call request (for example, the client instance), and the second application instance is the application instance that should theoretically respond to the call request (for example, the server instance). For example, instance 2 of application A may call instance 2 of application X. Instance 2 of application A is the first application instance, and instance 2 of application X is the second application instance.

[0058] It should be noted that the abnormal call information obtained by the fuse monitoring center includes the second application instance whose response time to the call request of the first application instance is greater than the preset time threshold. Specifically, the abnormal call information can be obtained by the fuse monitoring center from the abnormal monitoring module in the microservice system, or from the message middleware in the microservice system.

[0059] The preset time threshold may be determined based on experimental data.

[0060] It can be understood that when the exception monitoring module detects that the response time of the second application instance to the call request of the first application instance is greater than the preset time threshold, it will generate exception call information and send the exception call information to the message middleware or the fuse monitoring center.

[0061] Step S20, detecting the second application instance to obtain a detection result;

[0062] Since the exception monitoring module generates exception call information each time it monitors that the response time of the second application instance to the call request of the first application instance is greater than the preset time threshold, it can be understood that within a period of time, the exception call information obtained by the fuse monitoring center may be issued multiple times for the same application instance.

[0063] Therefore, the fuse monitoring center can integrate the target application to which the application instance corresponding to the received abnormal call information belongs within a preset time period (for example, within 1 second, within 2 seconds, etc.) (for example, 100 abnormal call records only involve 4 applications), and detect the target application, thereby avoiding performing a detection every time an abnormal call information is received, resulting in frequent detection of a certain application and affecting the normal operation of the application.

[0064] Specifically, the fuse monitoring center detects the second application instance and obtains a detection result, which includes a detection failure and a detection success; if the detection fails, it is considered that the target application has an abnormality, and if the detection succeeds, it is considered that the target application does not have an abnormality.

[0065] Step S30: When the detection result is a detection failure, a fuse is performed on the second application instance.

[0066] Therefore, when the detection result is a detection failure, it is necessary to perform fuse processing on the second application instance; specifically, the fuse monitoring center can directly send a fuse processing signal to the first application instance so that the first application instance can update the routing information, stop sending service requests to the second application instance, and complete the fuse processing of the second application instance.

[0067] Further, in order to ensure the normal operation of the microservice system, when the detection result is a detection failure, the specific implementation method of performing a fuse process on the second application instance may be:

[0068] When the detection result is a detection failure, the detection result is sent to the microservice registration center, so that the microservice registration center can determine whether to perform circuit breaking processing on the second application instance based on the number of available instances of the target application to which the second application instance belongs and the number of instances that have triggered circuit breaking processing; when the microservice registration center feedbacks that circuit breaking processing needs to be performed on the second application instance, circuit breaking processing is performed on the second application instance.

[0069] It should be noted that the microservice system also includes a microservice registration center. Each application instance needs to register with the microservice registration center when it is started. When each application instance accesses each other, it can obtain the location of each other through the microservice registration center. That is, the microservice registration center is used to manage the registration and subscription of each application instance.

[0070] Therefore, when the detection result is a detection failure, the fuse monitoring center can first send the detection result to the microservice registration center. Since the microservice registration center is used to manage the registration and subscription of each application instance, the microservice registration center can obtain the number of available instances of the target application to which the second application instance belongs, and the number of instances in the target application that have triggered the fuse processing. For example, the number of available instances of the target application is 1, and the number of instances in the target application that have triggered the fuse processing is 3, etc.

[0071] Furthermore, the microservice registration center determines whether to perform circuit breaking processing on the second application instance based on the number of available instances of the target application to which the second application instance belongs and the number of instances for which circuit breaking processing has been triggered. For example, when there is only one available instance of the target application, the second application instance is not subjected to circuit breaking processing, otherwise the target application will have no instance available.

[0072] Specifically, for example, based on the number of available instances of the target application to which the second application instance belongs and the number of instances for which the fuse processing has been triggered, a specific implementation method for determining whether to perform the fuse processing on the second application instance may be: when at least one of the following two conditions is met, the second application instance is not subjected to the fuse processing, so as to avoid the situation where unlimited fuse processing occurs and no instance is available:

[0073] 1. The target application corresponding to the second application instance has two application instances disconnected;

[0074] 2. After the second application instance is fused, the number of available instances of the corresponding target application is zero.

[0075] It should be noted that the current microservice circuit breaker processing method is mainly to update the routing information of the client instance when the client instance determines that the server instance has an abnormality, so as to achieve the circuit breaker of the server instance; for other upstream clients, they need to have multiple connection failures or multiple read timeouts when calling the server instance online before determining that the server instance has an abnormality, and then completely isolate the faulty instance; resulting in a slow circuit breaker speed for the microservice system for the faulty instance, a wide range of impact, and a poor circuit breaker effect.

[0076] In order to solve the above problem, when the microservice registration center feedbacks that the second application instance needs to be fused, after the step of fused processing on the second application instance, the following steps may be performed:

[0077] When the microservice registration center feedbacks that the second application instance needs to be fused, the instance address of the upstream application corresponding to the second application instance is obtained from the microservice registration center; based on the instance address, the information that the second application instance needs to be fused (fused information) is broadcast to the upstream instance, so that the upstream instance updates the routing information, stops sending service requests to the second application instance, and completes the fused processing.

[0078] Specifically, the fuse monitoring center can obtain the instance address of the upstream application corresponding to the second application instance from the microservice registration center, and broadcast the information that the second application instance needs to be fused to the upstream instance.

[0079] For example, if there is an exception in instance 2 of application X, the instance address of the upstream application (for example, instance 2 of application A, instance 1 of application B, etc.) corresponding to instance 2 of application X is obtained, the upstream instance synchronously updates the routing information, stops sending service requests to the second application instance, completes the fuse processing, implements fast fuse, reduces the impact time of the abnormal instance on business processing, and reduces the scope of impact.

[0080] Specifically, the fuse information can be obtained from the fuse monitoring center through the abnormal monitoring module SDK (Software Development Kit, a tool with abnormal monitoring function), and the routing information of the first application instance can be updated to achieve rapid fuse and reduce the scope of fault impact.

[0081] In this embodiment, when the fuse monitoring center obtains abnormal call information with a response time greater than a preset time threshold, it can promptly detect the second application instance that may have an abnormality. When the detection result is a detection failure, the second application instance can be fused, thereby improving the effectiveness of the fusion processing. At the same time, the information that the second application instance needs to be fused is broadcast to all upstream instances of the abnormal instance through broadcasting, thereby avoiding large-scale call abnormalities, reducing the scope of impact, and improving the fusion speed.

[0082] Based on this, the embodiment of the present application provides a microservice fuse processing method, referring to Figure 3 , Figure 3 This is a flow chart of the second embodiment of the microservice fuse processing method of the present application.

[0083] In this embodiment, the microservice fuse processing method includes steps A1 to A3:

[0084] Step A1, obtaining the first response time of the other application instances to the calling request after the first application instance initiates the calling request to the other application instances;

[0085] It should be noted that the execution subject of this embodiment is the abnormality monitoring module in the microservice system, which can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a microservice fuse processing device capable of realizing the above functions. The following takes the abnormality monitoring module in the microservice system as an example to illustrate this embodiment and the following embodiments.

[0086] To solve the above problems, this embodiment aims to analyze the time consumption of call requests through the abnormal monitoring module, and promptly discover timed requests, thereby improving the timeliness of circuit breaking and reducing business losses.

[0087] Specifically, the exception monitoring module obtains the first response time of the other application instances to the call request after the first application instance initiates the call request to the other application instances. The first application instance can call the SDK interface to monitor the response time of the call request.

[0088] Step A2, determining whether the first response duration is greater than a preset duration threshold;

[0089] When the abnormality monitoring module monitors the first response time, it determines in real time whether the first response time is greater than the preset time threshold. If the first response time is less than or equal to the preset time threshold, it is considered that the second application instance has no abnormality. If the first response time is greater than the preset time threshold, it is considered that the second application instance may have an abnormality.

[0090] In order to improve the abnormality monitoring accuracy of the abnormality monitoring module, a preset time threshold may be determined based on an adaptive P99 algorithm. Specifically, before the step of determining whether the response time is greater than the preset time threshold, the following steps may be performed:

[0091] Obtain the second response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to other application instances within the first historical period; map the second response duration to multiple different preset response duration intervals to obtain the number of first requests outside each preset response duration interval; determine the preset duration threshold based on the first request number and a target number threshold, wherein the target number threshold is determined based on the second request number within the first historical period and a preset accuracy.

[0092] Specifically, the abnormal call information within the first historical period (within the first 60 seconds, the first 30 seconds, etc.) can be obtained. Assuming that the abnormal call information within the first 60 seconds involves 1,000 requests, the second response time is mapped to multiple different preset response time intervals. For example, based on the second response time and the preset response time interval, the 1,000 requests are mapped to multiple different preset response time intervals. For example, multiple different preset response time intervals include interval 1, interval 2,..., wherein the number of preset response time intervals can be pre-set, for example, can be set to 200 or 300, etc.

[0093] Among them, the length of each preset response time interval can be the same, and the length of each preset response time interval can be determined based on the maximum response time among the second response time intervals within the first historical period. Specifically, the length (scale) of each preset response time interval can be determined based on the judgment conditions in Table 1 below.

[0094] Judgment conditions scale value 2*Maximum response time <= 2*300 2 2*300<2*maximum response time<=5*300 5 5*300<2*maximum response time<=10*300 10

[0095] Table 1, the judgment conditions for the length of each preset response time interval;

[0096] The following is an example in which the length of each preset response time interval is 2 and the number of intervals is 300. The different preset response time intervals are 0ms-2ms, 2ms-4ms, ..., 298ms-300ms.

[0097] When there is a request corresponding to the second response duration in the response duration interval of 2ms-4ms, the number of requests corresponding to the response duration interval of 2ms-4ms increases by 1. Similarly, when there is a request corresponding to the second response duration in the response duration interval of 298ms-300ms, the number of requests corresponding to the response duration interval of 298ms-300ms increases by 1, until all requests in the first historical period are traversed, and the number of requests corresponding to each preset response duration interval is obtained. At the same time, based on the number of all requests in the first historical period, the number of first requests outside each preset response duration interval is obtained.

[0098] For example, the sum of the number of requests corresponding to each preset response time interval is 980, and the number of first requests outside each preset response time interval is 20; since each preset response time interval is divided from 0, the first number of requests outside each preset response time interval is the number of first requests whose response time is greater than the right end point of the maximum interval in each preset response time interval, that is, the number of first requests whose response time is greater than 600ms, refer to Figure 4 .

[0099] Furthermore, based on the first number of requests and the target number threshold, the preset duration threshold is determined, wherein the target number threshold is determined based on the second number of requests in the first historical period and a preset accuracy; since the second number of requests in the first historical period is 1000, the preset accuracy may be 1% pre-set in the P99 algorithm, and therefore, the target number threshold is 1000*1%=10, that is, the target number threshold is 10. If the first number of requests is less than 10, it is considered that more than 99% of the requests meet the requirements.

[0100] Based on this, the specific implementation of determining the preset duration threshold based on the first number of requests and the preset accuracy may be:

[0101] When the first number of requests is greater than or equal to a target quantity threshold, the preset time threshold is determined to be a preset multiple of the starting value of the target response time interval; wherein the target response time interval is determined based on a preset response time interval sorted from small to large and a preset accuracy, and the preset multiple is greater than one.

[0102] Specifically, when the first number of requests is greater than or equal to the target number threshold, it is considered that only less than 99% of the requests meet the requirements. Therefore, the preset time threshold needs to be in the response time interval that 99% of the requests meet. Therefore, by sorting the preset response time intervals from small to large, the distribution corresponding to the second response time of each request in the first time period can be obtained. Based on the preset response time intervals sorted from small to large and the preset accuracy of 99%, the target response time interval in which the 990th request that meets the requirements is located is determined. Assuming that the target response interval is 180ms-182ms, the preset multiples of the starting value of the target response time interval can be used as the preset time threshold, thereby covering the response time of most requests. At the same time, it also leaves a certain room for monitoring abnormal instances. For example, if the preset multiple is 2, the preset time threshold is 360ms.

[0103] When the first number of requests is greater than or equal to the target number threshold, the starting value 180ms of the target response time interval of the 990th request that meets the requirements can be directly used as the preset time threshold.

[0104] Further, in order to improve the accuracy of the preset duration threshold, after the step of determining that the preset duration threshold is a preset multiple of the starting value of the target response duration interval when the first number of requests is greater than or equal to the target number threshold, the following steps may be performed:

[0105] Obtain the third response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to other application instances within the second historical period, the first historical period being the previous period of the second historical period; map the third response duration to the preset response duration interval, and obtain the third number of requests outside each preset response duration interval; if the third number of requests is less than or equal to the preset number threshold, then increase the first number on the basis of the target number threshold to obtain an updated target number threshold to reduce the preset accuracy; if the third number of requests is greater than the preset number threshold, then reduce the second number on the basis of the target number threshold to obtain an updated target number threshold to improve the preset accuracy.

[0106] At the same time, in order to cope with the different traffic and response times of the business system in different periods, the preset time threshold and target quantity threshold can be periodically adjusted based on the adaptive P99 algorithm.

[0107] Specifically, the abnormality monitoring module obtains the third response time of the other application instances to the historical call request after the first application instance initiates the historical call request to other application instances within the second historical period, that is, obtains the third response time of the historical call request in the next period corresponding to the first historical period, for example, the request within 60s after the first historical period, maps the third response time to the preset response time interval, and obtains the number of third requests outside each preset response time interval.

[0108] It can be understood that if the third number of requests is less than or equal to the preset quantity threshold, it is considered that the current preset accuracy requirement is too high, and it is necessary to increase the first number on the basis of the target quantity threshold to obtain an updated target quantity threshold; if the third number of requests is greater than the preset quantity threshold, it is considered that the current preset accuracy requirement is too low, and the second number is reduced on the basis of the target quantity threshold to obtain an updated target quantity threshold to improve the preset accuracy.

[0109] The preset quantity threshold may be 1, 2, etc., and the first quantity and the second quantity may be determined based on historical experience data, respectively.

[0110] Step A3, if it is greater than, send abnormal call information to the message middleware, so that the fuse monitoring center can obtain the abnormal call information from the message middleware, detect the second application instance based on the abnormal call information, and perform fuse processing on the second application instance when the detection result is a detection failure, wherein the second application instance is an application instance in the other application instances whose first response duration is greater than the preset duration threshold.

[0111] Furthermore, if the abnormal monitoring module determines that the first response duration is greater than a preset duration threshold, abnormal call information is sent to the message middleware.

[0112] The fuse monitoring center can obtain abnormal call information from the message middleware, detect the second application instance based on the abnormal call information, and when the detection result is a detection failure, perform fuse processing on the second application instance in the other application instances whose first response duration is greater than a preset duration threshold, refer to the fuse processing method of embodiment 1.

[0113] In this embodiment, the anomaly monitoring module can continuously adjust the correction accuracy according to the judgment result through the adaptive P99 algorithm, and can better apply the traffic changes of the business system in different periods, improve the accuracy of anomaly judgment, and reduce misjudgment; thereby, the fuse monitoring center can obtain more accurate abnormal call information with a response time greater than the preset time threshold, and promptly detect the second application instance that may have an abnormality. When the detection result is a detection failure, the second application instance can be fused, thereby improving the effectiveness of the fusion processing; at the same time, the fuse monitoring center broadcasts the information that the second application instance needs to be fused to all upstream instances of the abnormal instance, thereby avoiding large-scale call anomalies, reducing the scope of impact, and increasing the fusion speed.

[0114] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the microservice fuse processing method of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.

[0115] This application also provides a microservice system, please refer to Figure 5 , the microservice system includes a fuse monitoring center and an abnormality monitoring module:

[0116] The abnormal monitoring module is used to obtain the first response time of the other application instance to the call request after the first application instance initiates the call request to the other application instance, and determine whether the first response time is greater than a preset time threshold. If so, send abnormal call information to the message middleware;

[0117] The fuse monitoring center is used to obtain abnormal call information, detect the second application instance, and obtain a detection result. When the detection result is a detection failure, the second application instance is subjected to fuse processing.

[0118] The microservice system provided by the present application adopts the microservice fuse processing method in the above embodiment, which can solve the technical problem of low time efficiency of fuse processing. Compared with the prior art, the beneficial effects of the microservice system provided by the present application are the same as the beneficial effects of the microservice fuse processing method provided by the above embodiment, and other technical features in the microservice system are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0119] The present application provides a microservice fuse processing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the microservice fuse processing method in the above-mentioned embodiment 1.

[0120] Reference below Figure 5 , which shows a schematic diagram of the structure of a microservice fuse processing device suitable for implementing the embodiment of the present application. The microservice fuse processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, tablet computers, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The microservice fuse processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0121] like Figure 5As shown, the microservice fuse processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the microservice fuse processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the microservice fuse processing device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a microservice fuse processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0122] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0123] The microservice fuse processing device provided by the present application adopts the microservice fuse processing method in the above embodiment, which can solve the technical problem of low time efficiency of fuse processing. Compared with the prior art, the beneficial effects of the microservice fuse processing device provided by the present application are the same as the beneficial effects of the microservice fuse processing method provided by the above embodiment, and other technical features in the microservice fuse processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0124] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0125] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0126] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the microservice fuse processing method in the above-mentioned embodiment.

[0127] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0128] The above-mentioned computer-readable storage medium may be included in the microservice fuse processing device; or it may exist independently without being assembled into the microservice fuse processing device.

[0129] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the microservice fuse processing device, the microservice fuse processing device executes the microservice fuse processing method.

[0130] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to each embodiment of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0133] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned microservice fuse processing method, and can solve the technical problem of low time efficiency of fuse processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the microservice fuse processing method provided by the above-mentioned embodiment, and will not be repeated here.

[0134] The present application also provides a computer program product, including a computer program, which implements the steps of the microservice fuse processing method as described above when executed by a processor.

[0135] The computer program product provided by this application can solve the technical problem of low efficiency of fuse processing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the microservice fuse processing method provided in the above embodiment, which will not be repeated here.

[0136] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A microservice fuse processing method, characterized in that: The method is applied to a fuse monitoring center in a microservice system, and the method includes: Acquire abnormal call information, where the abnormal call information includes a second application instance whose response time to the call request of the first application instance is greater than a preset time threshold; Detecting the second application example to obtain a detection result; When the detection result is a detection failure, a fuse is performed on the second application instance.

2. The method according to claim 1, characterized in that The microservice system further includes a microservice registration center, and when the detection result is a detection failure, the step of performing a fuse process on the second application instance includes: When the detection result is a detection failure, the detection result is sent to the microservice registration center, so that the microservice registration center can determine whether to perform a fuse process on the second application instance based on the number of available instances of the target application to which the second application instance belongs and the number of instances that have triggered the fuse process; When the microservice registration center feedbacks that the second application instance needs to be fused, the second application instance is fused.

3. The method according to claim 2, characterized in that When the microservice registration center feedbacks that the second application instance needs to be subjected to a fuse, after the step of conducting a fuse on the second application instance, the step further includes: When the microservice registration center feedbacks that the second application instance needs to be fused, the instance address of the upstream application corresponding to the second application instance is obtained from the microservice registration center; Based on the instance address, information that the second application instance needs to be fused is broadcasted to the upstream instance, so that the upstream instance updates routing information, stops sending service requests to the second application instance, and completes fused processing.

4. A microservice fuse processing method according to any one of claims 1 to 3, characterized in that: The abnormality monitoring module applied to the microservice system, the method further includes: Obtaining the first response time of the other application instances to the calling request after the first application instance initiates the calling request to the other application instances; Determine whether the first response time is greater than a preset time threshold; If it is greater, an exception call information is sent to the message middleware, so that the fuse monitoring center can obtain the exception call information from the message middleware, detect the second application instance based on the exception call information, and perform fuse processing on the second application instance when the detection result is a detection failure, wherein the second application instance is an application instance among the other application instances whose first response duration is greater than the preset duration threshold.

5. The method according to claim 4, characterized in that Before the step of determining whether the response time is greater than a preset time threshold, the method further includes: Obtaining a second response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to the other application instances within the first historical period; Mapping the second response time to a plurality of different preset response time intervals to obtain the number of first requests determined to be outside each preset response time interval; The preset duration threshold is determined based on the first number of requests and a target number threshold, wherein the target number threshold is determined based on the second number of requests in the first historical period and a preset accuracy.

6. The method according to claim 5, characterized in that The step of determining the preset duration threshold based on the first number of requests and the preset accuracy includes: When the first number of requests is greater than or equal to a target number threshold, determining the preset duration threshold to be a preset multiple of a starting value of a target response duration interval; The target response time interval is determined based on preset response time intervals sorted from small to large and a preset accuracy, and the preset multiple is greater than one.

7. The method according to claim 5, characterized in that After the step of determining the preset duration threshold as a preset multiple of the starting value of the target response duration interval when the first request number is greater than or equal to the target quantity threshold, the method further includes: Obtaining a third response duration of the other application instances to the historical call request after the first application instance initiates the historical call request to the other application instances within a second historical period, wherein the first historical period is a period previous to the second historical period; Mapping the third response duration to the preset response duration intervals to obtain the number of third requests outside each preset response duration interval; If the third request number is less than or equal to the preset number threshold, the first number is added to the target number threshold to obtain an updated target number threshold, so as to reduce the preset accuracy; If the third request number is greater than the preset number threshold, the second number is reduced on the basis of the target number threshold to obtain an updated target number threshold, so as to improve the preset accuracy.

8. A microservice system, characterized in that: The microservice system includes a fuse monitoring center and an abnormality monitoring module: The abnormal monitoring module is used to obtain the first response time of the other application instance to the call request after the first application instance initiates the call request to the other application instance, and determine whether the first response time is greater than a preset time threshold. If so, send abnormal call information to the message middleware; The fuse monitoring center is used to obtain abnormal call information, detect the second application instance, and obtain a detection result. When the detection result is a detection failure, the second application instance is subjected to fuse processing.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the microservice fuse processing method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the microservice fuse processing method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Service fusing method, device and equipment of power distribution communication network and medium

    CN120499259A