A service fusing method, device, equipment and medium for a power distribution communication network

By analyzing the interface call logs and error call time series of the microservice architecture and dynamically adjusting the service circuit breaker strategy, the efficiency and reliability issues of the service circuit breaker mechanism in the existing technology are solved, and the stability and fault tolerance of the system are improved.

CN120499259BActive Publication Date: 2025-09-26STATE GRID ZHEJIANG ELECTRIC POWER CO LTD HANGZHOU POWER SUPPLY CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510991827.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-09-26
Estimated Expiration
2045-07-18

AI Technical Summary

Technical Problem

The existing service circuit breaker mechanism lacks the ability to dynamically respond to real-time fault characteristics, resulting in poor efficiency and reliability of the service circuit breaker mechanism and reduced system stability.

Method used

By obtaining the interface call logs of each service instance in the microservice architecture, calculating the service circuit breaker threshold, recording the error call time series, using the linear regression algorithm to analyze the error change trend, and adjusting the traffic distribution rules and retry policy parameters according to the trend, the service circuit breaker policy is dynamically adjusted.

Benefits of technology

It improves the efficiency and reliability of the service circuit breaker mechanism, enhances the stability of the microservice architecture system, avoids the spread of faults, and optimizes system resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499259B_ABST
    Figure CN120499259B_ABST
Patent Text Reader

Abstract

The present invention discloses a service disconnection method for a power distribution communication network, comprising: obtaining an interface call log of each service instance in a microservice architecture, and calculating a service disconnection threshold based on the interface call log; sending the service disconnection threshold to each service instance so that the service instance performs service disconnection according to the service disconnection threshold; recording all error calls of each service instance within a preset time period, and generating an error call time series for each service instance; based on the error call time series, using a linear regression algorithm to calculate an error change trend; adjusting the traffic distribution rules and retry strategy parameters of each service instance according to the error change trend, and obtaining a service adjustment strategy for the microservice architecture; the present invention can improve the efficiency and reliability of the service disconnection mechanism, and improve the stability of the microservice architecture system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data communication processing technology, and in particular to a service fusing method, device, equipment and medium for a power distribution communication network. Background Art

[0002] In a microservice architecture, each service instance has a certain dependency relationship. If a service call is slow or has a large number of timeouts, the service will become unavailable, which will indirectly cause other dependent services to become unavailable, and may cause the business system to crash. Service circuit breaker is an important fault-tolerant mechanism in the microservice architecture. When a microservice fails, the circuit breaker mechanism will be triggered, temporarily cutting off the call to the service to prevent the fault from spreading to the entire system.

[0003] Existing service circuit breaker mechanisms usually rely on statically configured circuit breakers and retry strategies. The system is often unable to adjust the service response strategy in a timely manner, resulting in overly aggressive or overly slow service degradation. The system lacks the ability to dynamically respond to real-time fault characteristics, resulting in poor efficiency and reliability of the service circuit breaker mechanism and reduced system stability. Summary of the Invention

[0004] An embodiment of the present invention provides a service fusing method for a power distribution communication network, which can improve the efficiency and reliability of the service fusing mechanism and enhance the stability of a microservice architecture system.

[0005] In a first aspect, an embodiment of the present invention provides a service fusing method for a power distribution communication network, comprising:

[0006] Obtain the interface call logs of each service instance in the microservice architecture, and calculate the service circuit breaker threshold based on the interface call logs;

[0007] Send the service disconnect threshold to each service instance so that the service instance disconnects the service according to the service disconnect threshold;

[0008] Record all error calls of each service instance within a preset time period and generate a time series of error calls for each service instance;

[0009] Based on the error call time series, a linear regression algorithm is used to calculate the error change trend; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time;

[0010] The traffic distribution rules and retry policy parameters of each service instance are adjusted according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry policy parameters include but are not limited to the number of retries, the retry interval and the retry timeout.

[0011] Furthermore, the service fuse threshold is calculated based on the interface call log, including:

[0012] Filtering out abnormal calls and the call time of each abnormal call from the interface call log; wherein the abnormal calls include timeout calls and error response calls;

[0013] Calculate the proportion of the timed calls and the error response calls to the total calls respectively to obtain the timeout rate and the error response ratio;

[0014] The timeout rate and the error response ratio are weightedly fused to obtain a fusion result, and a service fuse threshold is calculated based on the fusion result.

[0015] Furthermore, the method further comprises:

[0016] Monitor the traffic fluctuations of each service instance in real time, and dynamically adjust the service fuse threshold according to the traffic fluctuations.

[0017] Furthermore, the method further comprises:

[0018] The health status of each service instance is determined based on the timeout rate and the error response ratio using a preset judgment rule; wherein the judgment rule is:

[0019] When the timeout rate and error response ratio of the service instance are within the first range, the service instance is in a healthy state;

[0020] When the timeout rate and error response ratio of the service instance are in the second range, the service instance is in a sub-healthy state;

[0021] When the timeout rate and the error response ratio of the service instance are in the third range, the service instance is in an unhealthy state.

[0022] Furthermore, adjusting the traffic distribution rules and retry policy parameters of each service instance according to the error change trend includes:

[0023] Calculate the error call ratio for each service instance;

[0024] Mark the service instance whose error call ratio is higher than a preset error call ratio threshold and whose error change trend is increasing as a faulty service, and mark the service instance with the same function and whose error call ratio is lower than the error call ratio threshold as a healthy service;

[0025] The traffic allocation ratio of the faulty service is reduced, and the traffic allocation ratio of the healthy service is increased.

[0026] Furthermore, the method further comprises:

[0027] When the error change trend of the faulty service becomes downward and the error call ratio is lower than the error call ratio threshold, the faulty service is marked as a healthy service and the traffic distribution ratio of the service is restored.

[0028] Furthermore, the adjusting of the traffic distribution rules and retry policy parameters of each service instance according to the error change trend further includes:

[0029] Use machine learning algorithms to build trend prediction models based on historical data;

[0030] Inputting the error change trend into the trend prediction model and outputting a trend prediction result;

[0031] Based on the trend prediction results, the traffic distribution rules of each service instance are adjusted.

[0032] In a second aspect, an embodiment of the present invention provides a service fuse device for a power distribution communication network, comprising:

[0033] The circuit breaker threshold calculation module is used to obtain the interface call log of each service instance in the microservice architecture and calculate the service circuit breaker threshold based on the interface call log;

[0034] A fuse threshold application module is used to send the service fuse threshold to each service instance so that the service instance performs service fuse according to the service fuse threshold;

[0035] The error call recording module is used to record all error calls of each service instance within a preset time period and generate an error call time series for each service instance;

[0036] An error trend calculation module is used to calculate the error change trend based on the error call time series using a linear regression algorithm; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time;

[0037] A service strategy adjustment module is used to adjust the traffic distribution rules and retry strategy parameters of each service instance according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry strategy parameters include but are not limited to the number of retries, the retry interval time and the retry timeout time.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0039] memory for storing computer programs;

[0040] a processor for executing the computer program;

[0041] Wherein, when the processor executes the computer program, the service fuse method of the power distribution communication network described in any one of the first aspects above is implemented.

[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the service fuse method of the distribution communication network described in any one of the first aspects above is implemented.

[0043] Compared with the prior art, the embodiment of the present invention provides a service breaking method for a distribution communication network, which has the following beneficial effects: by obtaining the interface call log of each service instance in the microservice architecture, a service breaking threshold is calculated according to the interface call log; the service breaking threshold is sent to each service instance so that the service instance performs service breaking according to the service breaking threshold; all error calls of each service instance within a preset time period are recorded to generate an error call time series for each service instance; based on the error call time series, a linear regression algorithm is used to calculate the error change trend; wherein, the error change trend is a dynamic trend of the error occurrence frequency of each service instance over time; according to the error change trend, the traffic distribution rules and retry strategy parameters of each service instance are adjusted to obtain the service adjustment strategy of the microservice architecture; wherein, the retry strategy parameters include but are not limited to the number of retries, the retry interval time and the retry timeout time; the present invention can improve the efficiency and reliability of the service breaking mechanism and improve the stability of the microservice architecture system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical features of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 This is a flow chart of an embodiment of a service fusing method for a power distribution communication network provided by the present invention;

[0046] Figure 2 It is a structural diagram of an embodiment of a service fuse device for a power distribution communication network provided by the present invention;

[0047] Figure 3 It is a structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0049] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention pertains. The terms used herein are for the purpose of describing embodiments of the present invention only and are not intended to limit the present invention.

[0051] In a first aspect, an embodiment of the present invention provides a method for disconnecting a service in a power distribution communication network. Figure 1 , which is a flow chart of an embodiment of a service fusing method for a power distribution communication network provided by the present invention.

[0052] like Figure 1 As shown, the method includes the following steps:

[0053] S1: Obtain the interface call logs of each service instance in the microservice architecture, and calculate the service circuit breaker threshold based on the interface call logs;

[0054] S2: Send the service disconnection threshold to each service instance, so that the service instance performs service disconnection according to the service disconnection threshold;

[0055] S3: Record all error calls of each service instance within a preset time period and generate an error call time series for each service instance;

[0056] S4: Based on the error call time series, a linear regression algorithm is used to calculate the error change trend; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time;

[0057] S5: Adjust the traffic distribution rules and retry policy parameters of each service instance according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry policy parameters include but are not limited to the number of retries, the retry interval time and the retry timeout time.

[0058] In the specific implementation, we first obtain the interface call log of each service instance in the microservice architecture. The interface call log can provide detailed information about the service request and response, including request timestamp, interface name, call duration and return status. By analyzing these logs, we can understand the running status and performance of the service, and calculate the service circuit breaker threshold. The calculated service circuit breaker threshold is sent to each service instance, which enables the service instance to automatically perform service circuit breaker when an abnormal situation is detected. When the service instance receives a request, it will decide whether to process the request based on the current status and circuit breaker threshold. If the service instance is in a circuit breaker state, it will directly return an error response without trying to process the request. This can prevent the service instance from continuing to receive requests when a failure occurs, thereby reducing the burden on the system.

[0059] Record all error calls of each service instance within a preset time period, and generate an error call time series for each service instance. Based on the error call time series, the error change trend can be calculated using a linear regression algorithm. The error change trend can reflect the dynamic trend of the error frequency of each service instance over time. If the error change trend shows an upward trend, it means that the error frequency of the service instance is gradually increasing, and corresponding measures need to be taken to solve the problem. If the error change trend shows a downward trend, it means that the error frequency of the service instance is gradually decreasing.

[0060] Adjust the traffic distribution rules and retry policy parameters of each service instance based on the error change trend. It can be understood that the traffic distribution rules determine how requests are distributed among different service instances, and the retry policy parameters determine how to retry when a service failure occurs. If the error change trend of a service instance shows an upward trend, you can consider reducing the traffic distribution to the service instance, or increasing the number of retries and the retry interval to improve the fault tolerance of the system. If the error change trend of a service instance shows a downward trend, you can consider increasing the traffic distribution to the service instance, or reducing the number of retries and the retry interval to improve the performance of the system.

[0061] In summary, the present invention obtains the interface call log of each service instance in the microservice architecture, calculates the service fuse threshold according to the interface call log; sends the service fuse threshold to each service instance so that the service instance performs service fuse according to the service fuse threshold; records all error calls of each service instance within a preset time period, and generates an error call time series of each service instance; based on the error call time series, a linear regression algorithm is used to calculate the error change trend; wherein, the error change trend is the dynamic trend of the error occurrence frequency of each service instance over time; according to the error change trend, the traffic distribution rules and retry strategy parameters of each service instance are adjusted. The number is adjusted to obtain the service adjustment strategy of the microservice architecture; wherein, the retry strategy parameters include but are not limited to the number of retries, the retry interval time and the retry timeout time; the present invention obtains the interface call log and calculates the service fuse threshold, which can trigger the fuse mechanism in time when an abnormal situation occurs in the service to avoid the spread of the fault, thereby ensuring the stability of the entire microservice architecture system, and calculating the error change trend according to the error call time series, and adjusting the traffic distribution rules and retry strategy parameters accordingly, which can dynamically optimize the system's resource allocation and avoid the system crash due to the failure of a certain service. The present invention can improve the efficiency and reliability of the service fuse mechanism, thereby improving the stability of the microservice architecture system.

[0062] In an optional implementation, calculating the service disconnection threshold according to the interface call log includes:

[0063] Filtering out abnormal calls and the call time of each abnormal call from the interface call log; wherein the abnormal calls include timeout calls and error response calls;

[0064] Calculate the proportion of the timed calls and the error response calls to the total calls respectively to obtain the timeout rate and the error response ratio;

[0065] The timeout rate and the error response ratio are weightedly fused to obtain a fusion result, and a service fuse threshold is calculated based on the fusion result.

[0066] Specifically, the interface call log usually includes information such as timestamp, interface name, call duration and return status. For example, one of the interface call logs is "2025-04-0110:00:00 Service A Interface X took 200ms status 200". The log parsing tool can be used to split the log according to service name and time period. Abnormal calls mainly include timed out calls and error response calls. Timed out calls refer to calls that are not completed within the specified time, that is, the call time exceeds the preset call time threshold, which may be due to network delay, excessive server load or other reasons. Error response calls refer to calls that return an error status code, such as 404 Not Found, 500 Internal Server Error, etc. By analyzing the interface call logs, these abnormal calls can be accurately identified and the call time of each abnormal call can be recorded.

[0067] Furthermore, it is necessary to count the total number of calls, calculate the proportion of timed calls and error response calls in the total calls, and obtain the timeout rate and error response ratio. When counting the timeout rate, the performance of the service can be intuitively understood through the histogram. For example, in the timeout rate data set of a certain service, 90% of the calls are completed within 2 seconds, but the remaining 10% exceed 5 seconds. This distribution feature helps to preliminarily determine the service performance bottleneck. By counting the timeout time, it can be determined which time periods have a longer service response time, so that targeted optimization can be performed. When counting the error response ratio, the stability of the service can be reflected by the proportion of status codes. For example, a service has 50 errors in 1,000 calls, accounting for 5%. This method can quickly understand the frequency of errors in the service during operation.

[0068] Furthermore, by weighted fusion of the timeout rate and the error response ratio, the impact of the two abnormal situations on the system can be comprehensively considered, thereby more accurately calculating the service circuit breaker threshold. Different systems may have different sensitivities to timeouts and error responses, so it is necessary to determine appropriate weights based on actual conditions. For example, for systems with high real-time requirements, timeouts may have a greater impact on the system, so the weight of the timeout rate can be set higher. For systems with high data accuracy requirements, error responses may have a greater impact on the system, so the weight of the error response ratio can be set higher. The determination of weights is usually based on the understanding of business needs and the assessment of the importance of each indicator, and is not specifically limited here. For example, the timeout rate can be given a weight of 0.6 and the error response ratio can be given a weight of 0.4. This weighting method emphasizes that timeouts have a greater impact on the service experience. If the timeout rate is 10% and the error response ratio is 5%, the comprehensive indicator after fusion calculation is 8%. If the indicator exceeds the preset range, for example, the upper limit of the service circuit breaker threshold is 7%, it is trimmed to 7% to ensure that the threshold is within a reasonable range.

[0069] It is understandable that a linear regression algorithm can be used to predict future data. For example, if the comprehensive index rises from 5% to 8% within 7 consecutive days, regression analysis predicts that it may reach 9% on the 8th day, thereby preliminarily setting the service circuit breaker threshold to 9%. By predicting the future comprehensive index through the linear regression algorithm, the service circuit breaker threshold can be set in advance. When the comprehensive index exceeds the service circuit breaker threshold, corresponding measures can be taken to deal with potential risks in advance and avoid sudden failures.

[0070] In an optional embodiment, the method further includes:

[0071] Monitor the traffic fluctuations of each service instance in real time, and dynamically adjust the service fuse threshold according to the traffic fluctuations.

[0072] Specifically, by counting the number of interface calls and changes in response time over a period of time, we can determine whether the traffic is at a peak or trough period, and adjust the service circuit breaker threshold in real time according to the traffic fluctuation characteristics. For example, if it is found that the indicators fluctuate more during the peak traffic period, the threshold can be appropriately increased to enhance adaptability. This adjustment can effectively reduce false triggers, improve system robustness, and better adapt to traffic changes.

[0073] In an optional embodiment, the method further includes:

[0074] The health status of each service instance is determined based on the timeout rate and the error response ratio using a preset judgment rule; wherein the judgment rule is:

[0075] When the timeout rate and error response ratio of the service instance are within the first range, the service instance is in a healthy state;

[0076] When the timeout rate and error response ratio of the service instance are in the second range, the service instance is in a sub-healthy state;

[0077] When the timeout rate and the error response ratio of the service instance are in the third range, the service instance is in an unhealthy state.

[0078] Specifically, according to the pre-set judgment rules, the health status of each service instance is determined. When the timeout rate and error response ratio of the service instance are in the first interval, it indicates that the service has a short response time and high accuracy when processing requests, and it is determined to be in a healthy state. A service in a healthy state can stably provide services to users and meet their needs. When the timeout rate and error response ratio of the service instance are in the second interval, it is determined to be in a sub-healthy state, indicating that the service may have some performance problems or accuracy problems when processing requests, but can still basically meet the needs of users. Services in a sub-healthy state need to be monitored and optimized in a timely manner to prevent them from being out of service. Further deterioration occurs when the timeout rate and error response ratio of a service instance are in the third interval, and the service instance is determined to be in an unhealthy state, indicating that the service may not be able to process requests normally, seriously affecting the user experience. For services in an unhealthy state, immediate troubleshooting and repair are required to restore their normal operation. For example, the first interval can be set to a timeout rate below 5% and an error rate below 1%, the second interval can be set to a timeout rate between 5% and 10% or an error rate between 1% and 3%, and the third interval can be set to a timeout rate above 10% and an error rate above 3%. This classification can intuitively reflect the health status of the service and provide strong support for operation and maintenance decisions.

[0079] In an optional implementation, adjusting the traffic distribution rules and retry policy parameters of each service instance according to the error change trend includes:

[0080] Calculate the error call ratio for each service instance;

[0081] Mark the service instance whose error call ratio is higher than a preset error call ratio threshold and whose error change trend is increasing as a faulty service, and mark the service instance with the same function and whose error call ratio is lower than the error call ratio threshold as a healthy service;

[0082] The traffic allocation ratio of the faulty service is reduced, and the traffic allocation ratio of the healthy service is increased.

[0083] Specifically, by monitoring the call status of service instances over a period of time, the number of successful calls and failed calls can be counted, and then the error call ratio can be calculated. For example, within a period of time, a service instance was called 100 times, of which 10 failed. Then the error call ratio of the service instance is 10%. A threshold value for the error call ratio is set in advance. When the error call ratio of a service instance is higher than the preset threshold and the error change trend is rising, it indicates that there may be serious problems with the service instance and it needs to be adjusted or repaired. It is marked as a faulty service. For example, the error call ratio threshold is set to 5%. The error call ratio of a service instance in the past three cycles was 6%, 7%, and 8% respectively, showing an upward trend. Then the service instance will be marked as a faulty service, and the service instance with the same function and an error call ratio lower than the error call ratio threshold will be marked as a healthy service.

[0084] It is understandable that when judging a continuous rise, a specific slope threshold can be set to provide a quantitative standard. For example, when the error call ratio increases by more than 0.5% for three consecutive cycles, it is judged that the error change trend is rising. The slope threshold can be adjusted according to the specific situation to meet different needs.

[0085] After identifying the faulty service and healthy service, reducing the traffic allocation ratio of the faulty service and increasing the traffic allocation ratio of the healthy service can effectively improve the performance and reliability of the system. For example, if the original traffic allocation ratio of the faulty service is 60% and the traffic allocation ratio of the healthy service is 40%, after discovering the faulty service, the traffic allocation ratio of the faulty service can be reduced to 30%, while the traffic allocation ratio of the healthy service can be increased to 70%. Directing traffic to more reliable service instances can reduce the system performance degradation and failure risk caused by the faulty service. If the error call ratio of the faulty service decreases after the adjustment, it means that the adjustment is effective and the current traffic allocation ratio can be temporarily maintained.

[0086] It is understandable that if the healthy service also experiences an increase in the proportion of erroneous calls after receiving more traffic allocation, other backup services with the same functions can continue to be selected to share part of the traffic and ensure the stability of the service.

[0087] In an optional embodiment, the method further includes:

[0088] When the error change trend of the faulty service becomes downward and the error call ratio is lower than the error call ratio threshold, the faulty service is marked as a healthy service and the traffic distribution ratio of the service is restored.

[0089] Specifically, when the traffic allocation ratio of the faulty service decreases, the error change trend becomes downward and the error call ratio is lower than the error call ratio threshold, it can be re-marked as a healthy service and the traffic allocation ratio of the service can be gradually restored.

[0090] In an optional implementation, adjusting the traffic distribution rules and retry policy parameters of each service instance according to the error change trend further includes:

[0091] Use machine learning algorithms to build trend prediction models based on historical data;

[0092] Inputting the error change trend into the trend prediction model and outputting a trend prediction result;

[0093] Based on the trend prediction results, the traffic distribution rules of each service instance are adjusted.

[0094] Specifically, based on historical data, a machine learning algorithm is used to train a trend prediction model. The error change trend of the recent time period is input, and the model outputs the trend prediction results for the future period. If the prediction results show that the error call ratio of the service instance in the future period will be higher than the error call ratio threshold, part of the traffic of the service instance can be allocated to other healthy instances in advance. This prediction avoids passive response and effectively improves the system's risk resistance.

[0095] In a second aspect, an embodiment of the present invention provides a service fuse device for a power distribution communication network, see Figure 2 , which is a structural diagram of an embodiment of a service fuse device of a distribution communication network provided by the present invention.

[0096] like Figure 2 As shown, the device includes:

[0097] The fuse threshold calculation module 21 is used to obtain the interface call log of each service instance in the microservice architecture and calculate the service fuse threshold based on the interface call log;

[0098] The fuse threshold application module 22 is used to send the service fuse threshold to each service instance so that the service instance performs service fuse according to the service fuse threshold;

[0099] An error call recording module 23 is used to record all error calls of each service instance within a preset time period and generate an error call time series for each service instance;

[0100] An error trend calculation module 24 is configured to calculate an error change trend based on the error call time series using a linear regression algorithm; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time;

[0101] The service strategy adjustment module 25 is used to adjust the traffic distribution rules and retry strategy parameters of each service instance according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry strategy parameters include but are not limited to the number of retries, the retry interval time and the retry timeout time.

[0102] In an optional implementation, the fuse threshold calculation module 21 is further configured to:

[0103] Filtering out abnormal calls and the call time of each abnormal call from the interface call log; wherein the abnormal calls include timeout calls and error response calls;

[0104] Calculate the proportion of the timed calls and the error response calls to the total calls respectively to obtain the timeout rate and the error response ratio;

[0105] The timeout rate and the error response ratio are weightedly fused to obtain a fusion result, and a service fuse threshold is calculated based on the fusion result.

[0106] In an optional embodiment, the device further includes a threshold dynamic adjustment module, configured to:

[0107] Monitor the traffic fluctuations of each service instance in real time, and dynamically adjust the service fuse threshold according to the traffic fluctuations.

[0108] In an optional embodiment, the apparatus further includes a service health status determination module, configured to:

[0109] The health status of each service instance is determined based on the timeout rate and the error response ratio using a preset judgment rule; wherein the judgment rule is:

[0110] When the timeout rate and error response ratio of the service instance are within the first range, the service instance is in a healthy state;

[0111] When the timeout rate and error response ratio of the service instance are in the second range, the service instance is in a sub-healthy state;

[0112] When the timeout rate and the error response ratio of the service instance are in the third range, the service instance is in an unhealthy state.

[0113] In an optional implementation, the service policy adjustment module 25 is further configured to:

[0114] Calculate the error call ratio for each service instance;

[0115] Mark the service instance whose error call ratio is higher than a preset error call ratio threshold and whose error change trend is increasing as a faulty service, and mark the service instance with the same function and whose error call ratio is lower than the error call ratio threshold as a healthy service;

[0116] The traffic allocation ratio of the faulty service is reduced, and the traffic allocation ratio of the healthy service is increased.

[0117] In an optional implementation, the service policy adjustment module 25 is further configured to:

[0118] When the error change trend of the faulty service becomes downward and the error call ratio is lower than the error call ratio threshold, the faulty service is marked as a healthy service and the traffic distribution ratio of the service is restored.

[0119] In an optional implementation, the service policy adjustment module 25 is further configured to:

[0120] Use machine learning algorithms to build trend prediction models based on historical data;

[0121] Inputting the error change trend into the trend prediction model and outputting a trend prediction result;

[0122] Based on the trend prediction results, the traffic distribution rules of each service instance are adjusted.

[0123] In a third aspect, an embodiment of the present invention provides an electronic device, see Figure 3 , which is a structural diagram of an electronic device provided by an embodiment of the present invention.

[0124] like Figure 3 As shown, the device includes:

[0125] Memory 31, for storing computer programs;

[0126] a processor 32, configured to execute the computer program;

[0127] Wherein, when the processor 32 executes the computer program, the service fusing method of the power distribution communication network as described in any of the above embodiments is implemented.

[0128] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 32 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0129] The processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0130] The memory 31 can be used to store the computer programs and / or modules. The processor 32 implements the various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory 31 and accessing the data stored in the memory 31. The memory 31 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback); the data storage area may store data generated based on the use of the mobile phone (such as audio data and a phone book). Furthermore, the memory 31 may include high-speed random access memory (RAM) and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0131] It should be noted that the above electronic devices include, but are not limited to, processors and memories. Those skilled in the art will understand that Figure 3 The structural diagram is merely an example of the electronic device described above and does not limit the electronic device. The electronic device may include more components than shown in the figure, or may combine certain components, or may include different components.

[0132] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the service fuse method of the power distribution communication network described in any of the above embodiments is implemented.

[0133] It should be understood that the present invention can implement all or part of the process of the above-mentioned service disconnection method for a power distribution communication network by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned service disconnection method for a power distribution communication network. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. Computer-readable media can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc.

[0134] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. It should be pointed out that for those skilled in the art, several equivalent obvious variations and / or equivalent replacements can be made without departing from the technical principles of the present invention. These obvious variations and / or equivalent replacements should also be regarded as the scope of protection of the present invention.

Claims

1. A service fusing method for a power distribution communication network, characterized in that: include: Obtain the interface call logs of each service instance in the microservice architecture, and calculate the service circuit breaker threshold based on the interface call logs; Send the service disconnect threshold to each service instance so that the service instance disconnects the service according to the service disconnect threshold; Record all error calls of each service instance within a preset time period and generate a time series of error calls for each service instance; Based on the error call time series, a linear regression algorithm is used to calculate the error change trend; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time; Adjust the traffic distribution rules and retry policy parameters of each service instance according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry policy parameters include but are not limited to the number of retries, the retry interval and the retry timeout; The calculating of the service fuse threshold according to the interface call log includes: Filtering out abnormal calls and the call time of each abnormal call from the interface call log; wherein the abnormal calls include timeout calls and error response calls; Calculate the proportion of the timed calls and the error response calls to the total calls respectively to obtain the timeout rate and the error response ratio; The timeout rate and the error response ratio are weightedly fused to obtain a fusion result, and a service fuse threshold is calculated based on the fusion result.

2. The service fusing method of the power distribution communication network according to claim 1, characterized in that: The method further comprises: Monitor the traffic fluctuations of each service instance in real time, and dynamically adjust the service fuse threshold according to the traffic fluctuations.

3. The service fusing method of the power distribution communication network according to claim 1, characterized in that: The method further comprises: The health status of each service instance is determined based on the timeout rate and the error response ratio using a preset judgment rule; wherein the judgment rule is: When the timeout rate and error response ratio of the service instance are within a first interval, the service instance is in a healthy state; the first interval is a preset first value interval of the timeout rate and the error response ratio, including a first timeout rate value interval and a first error response ratio value interval; When the timeout rate and error response ratio of the service instance are in a second interval, the service instance is in a sub-healthy state; the second interval is a preset second value interval of the timeout rate and the error response ratio, including a second timeout rate value interval and a second error response ratio value interval; When the timeout rate and error response ratio of the service instance are in the third interval, the service instance is in an unhealthy state; the third interval is a preset third value interval of the timeout rate and the error response ratio, including a third timeout rate value interval and a third error response ratio value interval.

4. The service fusing method of the power distribution communication network according to claim 1, characterized in that: The adjusting of the traffic distribution rules and retry policy parameters of each service instance according to the error change trend includes: Calculate the error call ratio for each service instance; Mark the service instance whose error call ratio is higher than a preset error call ratio threshold and whose error change trend is increasing as a faulty service, and mark the service instance with the same function and whose error call ratio is lower than the error call ratio threshold as a healthy service; The traffic allocation ratio of the faulty service is reduced, and the traffic allocation ratio of the healthy service is increased.

5. The service fusing method of the power distribution communication network according to claim 4, characterized in that: The adjusting of the traffic distribution rules and retry policy parameters of each service instance according to the error change trend further includes: When the error change trend of the faulty service becomes downward and the error call ratio is lower than the error call ratio threshold, the faulty service is marked as a healthy service and the traffic distribution ratio of the service is restored.

6. The service fusing method of the power distribution communication network according to claim 1, characterized in that: The adjusting of the traffic distribution rules and retry policy parameters of each service instance according to the error change trend further includes: Use machine learning algorithms to build trend prediction models based on historical data; Inputting the error change trend into the trend prediction model and outputting a trend prediction result; Based on the trend prediction results, the traffic distribution rules of each service instance are adjusted.

7. A service fuse device for a power distribution communication network, characterized in that: include: The circuit breaker threshold calculation module is used to obtain the interface call log of each service instance in the microservice architecture and calculate the service circuit breaker threshold based on the interface call log; A fuse threshold application module is used to send the service fuse threshold to each service instance so that the service instance performs service fuse according to the service fuse threshold; The error call recording module is used to record all error calls of each service instance within a preset time period and generate an error call time series for each service instance; An error trend calculation module is used to calculate the error change trend based on the error call time series using a linear regression algorithm; wherein the error change trend is a dynamic trend of the error occurrence frequency of each service instance changing over time; A service strategy adjustment module is used to adjust the traffic distribution rules and retry strategy parameters of each service instance according to the error change trend to obtain the service adjustment strategy of the microservice architecture; wherein the retry strategy parameters include but are not limited to the number of retries, the retry interval and the retry timeout; The calculating of the service fuse threshold according to the interface call log includes: Filtering out abnormal calls and the call time of each abnormal call from the interface call log; wherein the abnormal calls include timeout calls and error response calls; Calculate the proportion of the timed calls and the error response calls to the total calls respectively to obtain the timeout rate and the error response ratio; The timeout rate and the error response ratio are weightedly fused to obtain a fusion result, and a service fuse threshold is calculated based on the fusion result.

8. An electronic device, characterized in that: include: memory for storing computer programs; a processor for executing the computer program; Wherein, when the processor executes the computer program, the service fusing method of the power distribution communication network as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the service fusing method of the power distribution communication network according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Service fusing method based on service quality

    CN111770134A

  • Service fusing method and device based on real-time stream processing framework

    CN113760589A