CN111130939A - Flow control method and device, computer equipment and storage medium - Google Patents

Flow control method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111130939A
CN111130939A CN201911366835.8A CN201911366835A CN111130939A CN 111130939 A CN111130939 A CN 111130939A CN 201911366835 A CN201911366835 A CN 201911366835A CN 111130939 A CN111130939 A CN 111130939A
Authority
CN
China
Prior art keywords
service
micro
flow
console
monitoring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911366835.8A
Other languages
Chinese (zh)
Other versions
CN111130939B (en
Inventor
谢滨泽
李如先
孙朝和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority to CN201911366835.8A priority Critical patent/CN111130939B/en
Publication of CN111130939A publication Critical patent/CN111130939A/en
Application granted granted Critical
Publication of CN111130939B publication Critical patent/CN111130939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • H04L41/5019Ensuring fulfilment of SLA
    • H04L41/5025Ensuring fulfilment of SLA by proactively reacting to service quality change, e.g. by reconfiguration after service quality degradation or upgrade
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • H04L43/045Processing captured monitoring data, e.g. for logfile generation for graphical visualisation of monitoring data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Environmental & Geological Engineering (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a flow control method, a flow control device, computer equipment and a storage medium. The method comprises the following steps: registering each micro service to a configuration center of a distributed service-oriented lightweight flow control framework, and accessing each micro service to a console of the distributed service-oriented lightweight flow control framework; pushing configuration information to the configuration center through the console, and pushing the configuration information to each micro-service by the configuration center; monitoring and displaying the flow of each micro-service in real time through a control console, and controlling the flow of each micro-service according to the monitored flow; and monitoring and displaying the state of each micro service in real time through the console, and performing fusing degradation processing on each micro service according to the monitored state. The method can perform visual flow monitoring on the micro-service, effectively solves the abnormal phenomenon in the micro-service calling process, and ensures the stability of the micro-service system.

Description

Flow control method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a flow control method and apparatus, a computer device, and a storage medium.
Background
With the gradual increase of the amount of traffic and users, the development of software architecture goes through the process from monolithic architecture, vertical architecture, SOA architecture to micro-service architecture. At present, many enterprises select the road of the micro service, because the splitting granularity of the micro service is thinner, the resource recycling is facilitated, the development efficiency is improved, the optimization scheme of each service can be more accurately formulated, and the system maintainability is improved.
For micro services, if the request volume suddenly increases, a situation of abnormal service due to too large service pressure may occur, which may cause great pressure on service maintenance, and an important reason for such a situation is that visual flow monitoring is not performed on each micro service, so that non-visual data for daily maintenance and service upgrade is used as a basis, and real-time monitoring and control cannot be performed on an unexpected large flow request.
Disclosure of Invention
The embodiment of the invention provides a flow control method, a flow control device, computer equipment and a storage medium, aiming at carrying out visual flow monitoring on micro-services, effectively solving the abnormal phenomenon in the process of calling the micro-services and ensuring the stability of a micro-service system.
In a first aspect, an embodiment of the present invention provides a method for controlling a flow of a distributed service, where the method includes:
registering each micro service to a configuration center of a distributed service-oriented lightweight flow control framework, and accessing each micro service to a console of the distributed service-oriented lightweight flow control framework;
pushing configuration information to the configuration center through the console, and pushing the configuration information to each micro-service by the configuration center;
monitoring and displaying the flow of each micro-service in real time through a control console, and controlling the flow of each micro-service according to the monitored flow;
and monitoring and displaying the state of each micro service in real time through the console, and performing fusing degradation processing on each micro service according to the monitored state.
In a second aspect, an embodiment of the present invention provides a flow control apparatus for distributed services, including:
the setting unit is used for registering each micro-service to a configuration center of a lightweight flow control frame facing the distributed service and accessing each micro-service to a console of the lightweight flow control frame facing the distributed service;
the pushing unit is used for pushing the configuration information to the configuration center through the console and pushing the configuration information to each microservice through the configuration center;
the first monitoring unit is used for monitoring and displaying the flow of each micro-service in real time through a control console and controlling the flow of each micro-service according to the monitored flow;
and the second monitoring unit is used for monitoring and displaying the state of each micro-service in real time through the console and performing fusing degradation processing on each micro-service according to the monitored state.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the computer program, implements the flow control method for distributed services according to the first aspect.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for controlling flow of a distributed service according to the first aspect.
The embodiment of the invention provides a flow control method and device of distributed services, computer equipment and a storage medium. The method comprises the following steps: registering each micro service to a configuration center of a distributed service-oriented lightweight flow control framework, and accessing each micro service to a console of the distributed service-oriented lightweight flow control framework; pushing configuration information to the configuration center through the console, and pushing the configuration information to each micro-service by the configuration center; monitoring and displaying the flow of each micro-service in real time through a control console, and controlling the flow of each micro-service according to the monitored flow; and monitoring and displaying the state of each micro service in real time through the console, and performing fusing degradation processing on each micro service according to the monitored state. The embodiment of the invention uses the flow control method of the distributed service to visually monitor the flow of the micro-service, effectively solves the abnormal phenomenon in the process of calling the micro-service and ensures the stability of the micro-service system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a flow control method for a distributed service according to an embodiment of the present invention;
fig. 2 is a block diagram of a flow control device for distributed services according to an embodiment of the present invention;
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a flowchart of a flow control method for a distributed service according to an embodiment of the present invention.
The specific steps may include S110 to S140:
s110: registering each micro service to a configuration center of a distributed service-oriented lightweight flow control framework, and accessing each micro service to a console of the distributed service-oriented lightweight flow control framework;
in one embodiment, in order to ensure stability between microservices, each microservice (a client of the distributed service-oriented lightweight traffic control framework) needs to be registered to a configuration center of the distributed service-oriented lightweight traffic control framework, and then each microservice needs to be accessed to a console of the distributed service-oriented lightweight traffic control framework, and the console monitors data (such as query rate per second, number of concurrent threads, and the like) generated by all microservices and request data (such as number of requests, response time of requests, and the like).
S120: pushing configuration information to the configuration center through the console, and pushing the configuration information to each micro-service by the configuration center;
because the currently adopted method performs data processing on the pushing of the configuration information in the form of an http interface, when the configuration rule needs to be issued, all micro services are traversed, and then data pushing is performed in the form of http.
In this embodiment, the configuration information is pushed to the configuration center through the console, and the configuration center pushes the configuration information to each corresponding microservice. In this embodiment, nacos (a dynamic service discovery, configuration management and service management platform that is easy to construct cloud native applications and supports discovery, configuration and management of services of most mainstream types) may be used as the configuration center, and zookeeper (a distributed application program coordination service that is a distributed and open source code software that provides a consistent service for distributed applications and provides functions including configuration maintenance, domain name service, distributed synchronization, group service, and the like) may also be used as the configuration center.
In an embodiment, the pushing, by the configuration center, the configuration information to each microservice includes:
and when receiving new configuration information, pushing the configuration information to each micro service in real time, or pushing the configuration information to each micro service at regular time.
When the configuration center receives new configuration information, the configuration center can select to push the configuration information to each micro service in real time, or can preset a timing task and push the configuration information to each micro service in timing. By pushing the configuration information in real time, the subsequent operation can be ensured to be performed in time. It should be noted that the new configuration information may be configuration information obtained by modifying the original configuration information.
The method comprises the steps that a timing task is preset, configuration information is pushed to each micro service at regular time, namely a fixed waiting time is preset, when a configuration center receives new configuration information, the configuration information is not directly pushed to each micro service, the waiting step is carried out firstly, and when the fixed waiting time is reached, the configuration information is pushed to each micro service. The fixed waiting time is the time consumed from the time when the configuration center receives the configuration information until the configuration information is pushed. By regularly pushing the configuration information, the configuration information can be orderly pushed to each service, and the processing efficiency is further improved.
S130: monitoring and displaying the flow of each micro-service in real time through a control console, and controlling the flow of each micro-service according to the monitored flow;
in this embodiment, the console may perform real-time monitoring on the traffic (i.e., traffic data) of each accessed micro service, and display the monitored traffic data in the form of a graph, where the graph may be a table, or a line graph or a bar graph according to specific requirements. When the flow of the micro-service is overlarge or an abnormal condition (an attack is encountered), the control console can directly perform control such as flow limitation, cold start, queuing and the like on the flow of each micro-service according to the monitored flow data so as to avoid server breakdown caused by an instantaneous flow peak and further guarantee the stability of each micro-service.
In an embodiment, the monitoring and displaying, by a console, the traffic of each microservice in real time, and controlling the traffic of each microservice according to the monitored traffic includes:
acquiring a field value of a flow index field in configuration information;
and determining an index of flow needing to be monitored according to the field value, if the field value is 0, determining that the index is the query rate per second of the micro service, and if the field value is 1, determining that the index is the number of concurrent threads of the micro service.
In this embodiment, the console may monitor two flow indexes, and then perform flow control on each micro-service according to the monitored flow indexes; one is to monitor and count the query rate per second of each micro service, and then control the flow of each micro service according to the monitored and counted query rate per second, and the other is to monitor and count the number of concurrent threads of each micro service, and then control the flow of each micro service according to the monitored and counted number of concurrent threads. In order to determine which flow index is used to perform flow control on each micro service, a field value of a flow index field in configuration information may be obtained first, and then an index of a flow to be monitored is determined according to the field value, if the field value is 0, the index of the flow to be monitored is determined to be a query rate per second of the micro service, and if the field value is 1, the index of the flow to be monitored is determined to be a number of concurrent threads of the micro service. When the flow of the micro-service is too large or an abnormal condition (attack) is encountered, and then the index of the corresponding flow reaches a preset corresponding index threshold, the console controls the flow of each micro-service.
For example, the flow rate of each microservice can be defined by a numeric field of FlowRule (full rule list) as an index of which flow rate is to be controlled. The method comprises the steps that a 0 represents that flow control is carried out through a query rate per second, a 1 represents that flow control is carried out through a concurrent thread number, if a field value is set to be 0, flow control is carried out through the query rate per second, at the moment, a query rate per second threshold value can be set in advance through a console, after the setting is finished, the console queries the query rate per second of each micro service at the current moment and displays the corresponding moment and the query rate per second at each moment, meanwhile, the response time of each moment can also be displayed, and if the query result is that the query rate per second of the current moment is larger than the query rate per second threshold value, the console controls flow of the micro services; if the field value is set to 1, the flow control is performed through the number of concurrent threads, at this time, a threshold value of the number of concurrent threads can be set in advance through the console, after the setting is completed, the console can query the number of concurrent threads of each micro service at regular intervals, and the query result is displayed through a line graph.
In the line graph, a plurality of micro services can be included, different micro services can be distinguished by fold lines with different colors or different thicknesses, and the abscissa can be the draggable current time period; the line graph can also only display a plurality of variables of a single microservice, and preferably, the indexes of the currently monitored flow can be simultaneously and visually displayed through a table below the line graph.
If the inquiry result is that the number of concurrent threads of one micro service is larger than the threshold value of the number of concurrent threads, the console controls the flow of the micro service. The number of concurrent threads and the query rate per second can be obtained by statistics of the StatisticSlot (for counting various data) in real time.
In this embodiment, the console may monitor each micro service in the lightweight traffic control framework facing the distributed service framework through a remote configuration center. The method includes configuring monitored related data through a centralized configuration center console (Sentinel Dashboard), selecting an index (query rate per second, number of concurrent threads) of flow specifically monitored by each micro service and a corresponding threshold value through the centralized configuration center console, and configuring a flow control mode (direct control, association control, link control, and the like) and a flow control effect (fast failure, queue waiting, cold start, and the like) of each micro service, for example: the flow index of monitoring a micro-service can be set as the query rate per second, the corresponding threshold value is set as 12, the flow control mode of the micro-service is set as direct control, and the flow control effect is set as fast failure.
S140: and monitoring and displaying the state of each micro service in real time through the console, and performing fusing degradation processing on each micro service according to the monitored state.
The calling relationship between the current micro services is complex, that is, if a request is not successfully processed if a certain request is unstable due to calling overtime or abnormal proportion increase in the process of calling the micro services, the subsequent request cannot be processed, and then a request accumulation phenomenon occurs. In this embodiment, the states of the services may be monitored and displayed in real time through the console, and then corresponding fusing degradation processing is performed on the services according to the monitored states, where the fusing degradation processing is to limit the invocation of the corresponding micro service when a certain request of the micro service is unstable, so that the request is rapidly failed to avoid a request accumulation phenomenon, and normal processing of subsequent requests is ensured.
In an embodiment, the monitoring and displaying the state of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored state includes:
acquiring response time of the micro service to all requests in a first time window;
if the response time of the micro service to all the requests in the first time window exceeds a response time threshold, judging that the state of the micro service is an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
In this embodiment, in order to determine whether the state of the micro service is an unstable state, response time of the micro service to all requests in a first time window may be obtained, and the response time is compared with a response time threshold, if the response time exceeds the response time threshold, it may be determined that the state of the micro service is an unstable state, and then, the fusing degradation processing may be performed on the micro service in the unstable state.
For example, the first time window may be set to 1s, if a micro service continuously enters 5 requests within the first time window 1s, the console may respectively obtain response times of the micro service to the 5 requests within the first time window 1s, compare the obtained response times with a response time threshold, determine that the state of the micro service is an unstable state if the comparison result shows that all of the 5 requests exceed the response time threshold, and automatically fuse the call to the micro service in a subsequent first time window.
It should be noted that, in this embodiment, the response time threshold may be preset. For example, the response time threshold may be set to 4000ms, and when the console respectively compares all the obtained response times of the micro-services with the response time threshold, and the obtained comparison result indicates that the response times are all greater than or equal to the response time threshold, it may be determined that the state of the micro-service is an unstable state, and then the fusing degradation processing is performed on the micro-service. In this embodiment of the present invention, the upper limit of the response time is set to 4900ms by default, that is, the response time that can be counted up at most is 4900ms, that is, if the response time exceeds the upper limit, the value obtained by obtaining the response time is still 4900 ms. If the response time threshold needs to be reconfigured, it can be configured by starting the configuration item-dcsp.
In another embodiment, the monitoring and displaying the state of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored state includes:
acquiring the number of the requests processed by the micro-service in a second time window and the number of abnormal processing results;
if the number of the requests processed by the micro service in the second time window is larger than a number threshold value, and the processing result is that the ratio of the number of the exceptions to the number of the processed requests exceeds a ratio threshold value, determining that the state of the micro service is an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
In this embodiment, in order to determine whether the state of the micro service is an unstable state, the number of requests processed by the micro service in the second time window and the number of abnormal processing results may be obtained, and the number of the processed requests is compared with a number threshold, if the number of the processed requests is greater than the number threshold and a ratio of the number of abnormal processing results to the number of the processed requests exceeds a ratio threshold, the state of the micro service is determined to be an unstable state, and then the micro service in the unstable state is subjected to fusing degradation processing. The second time window may be the same as or different from the first time window.
For example, the number threshold may be set to 5 in advance, the ratio threshold may be set to 0.1, and the second time window is set to 1s, if it is obtained that the number of requests processed by the micro service in the second time window 1s is 10 and the number of processing results is 5, then by comparing the number of processed requests with the number threshold, it may be obtained that the comparison result is that the number of processed requests is greater than the number threshold; meanwhile, the ratio of the number of the exceptions to the number of the processed requests is calculated as a processing result, and then the ratio is compared with a ratio threshold value, so that the ratio is larger than the ratio threshold value, the micro-service state is determined to be an unstable state at the moment, and then the control console performs fusing degradation processing on the micro-service according to the determination result, namely, the micro-service is automatically fused in a subsequent second time window.
In another embodiment, the monitoring and displaying the state of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored state includes:
acquiring the quantity of abnormal processing results of the micro-service to the requests in a third time window;
if the number of the requests processed by the micro service in the third time window is that the number of the exceptions exceeds the exception number threshold, the state of the micro service is judged to be an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
In order to perform the fusing degradation processing on the micro service in the unstable state more quickly, the step S140 may be adjusted, the step of calculating is omitted, and the object to be compared is changed, and in this embodiment, it is no longer necessary to satisfy two conditions at the same time to perform the fusing degradation processing. That is to say, in this embodiment, in order to determine whether the state of the micro service is an unstable state, the number of abnormal processing results of the micro service to the request in the third time window may be obtained, the number of abnormal processing results of the micro service to the request is compared with the abnormal number threshold, if the number of abnormal processing results of the micro service to the request is greater than the abnormal number threshold, the state of the micro service is determined to be an unstable state, and then the fusing degradation processing is performed on the micro service in the unstable state.
Preferably, a third time window may be preset, and an anomaly number threshold may be set according to the third time window, for example, the third time window may be set to 60s, and the anomaly number threshold may be set to 100 according to the third time window, then in the third time window 60s, if it is obtained that the number of processing results of the micro-service pair request which are obtained is 150, and then the number of processing results of the pair request which are obtained is the anomaly is compared with the anomaly number threshold, and the comparison result is that the number of processing results of the pair request which are obtained is the anomaly is greater than the anomaly number threshold, the console may perform the fusing degradation processing on the micro-service according to the comparison result. The third time window may be the same as or different from the first time window and/or the second time window. Of course, since the determination is performed based on the number of the processing results being abnormal, a larger number of bases are required to make the determination more accurate, and therefore, the third time window is preferably larger than the second time window, for example, the third time window is set to be 60 times of the second time window. For example, the second time window is 1s, then the third time window may be 1 min.
The fusing degradation processing of the micro service in the unstable state comprises the following steps:
for microservices in an unstable state, control is given to direct return processing of requests within a next predetermined number of corresponding time windows.
In this embodiment, for a micro-service in an unstable state, the console will perform a fuse downgrade process, i.e. automatically fuse calls to the micro-service, and control the requests within the next predetermined number of corresponding time windows to be processed directly back. After the fusing degradation processing is performed on the micro service, the micro service does not have data of the corresponding processing request in the corresponding time window for the fusing degradation processing, so that the fusing degradation processing is not performed on the micro service again in the next time window after the fusing degradation processing is finished. In the embodiment of the invention, the time window is the same as the time window for judging whether to perform the fusing degradation processing or not. For example, the condition of the first time window is adopted for judgment, and then the time window is the first time window; judging by adopting the condition of a second time window, wherein the time window is the second time window; and judging by adopting the condition of the third time window, wherein the time window is the third time window.
In an embodiment, please refer to fig. 2, fig. 2 is a block diagram illustrating a flow control apparatus 200 for distributed services according to an embodiment of the present invention;
the apparatus 200 may include:
a setting unit 201, configured to register each micro service to a configuration center of a lightweight traffic control framework facing the distributed service, and access each micro service to a console of the lightweight traffic control framework facing the distributed service;
a pushing unit 202, configured to push configuration information to the configuration center through the console, and the configuration center pushes the configuration information to each microservice;
the first monitoring unit 203 is used for monitoring and displaying the flow of each micro-service in real time through a console, and controlling the flow of each micro-service according to the monitored flow;
the second monitoring unit 204 is configured to monitor and display the state of each micro service in real time through the console, and perform fusing degradation processing on each micro service according to the monitored state.
In one embodiment, the first monitoring unit 203 includes:
the first acquisition unit is used for acquiring the field value of the flow index field in the configuration information;
and the first judgment unit is used for determining an index of the flow needing to be monitored according to the field value, confirming that the index is the query rate per second of the micro service if the field value is 0, and confirming that the index is the number of concurrent threads of the micro service if the field value is 1.
In one embodiment, the second monitoring unit 204 includes:
the second acquisition unit is used for acquiring the response time of the micro service to all the requests in the first time window;
a second determining unit, configured to determine that the state of the micro service is an unstable state if response times of the micro service to all requests in the first time window exceed a response time threshold;
and the first processing unit is used for performing fusing degradation processing on the micro-service in the unstable state.
In one embodiment, the second monitoring unit 204 includes:
the third acquisition unit is used for acquiring the number of the requests processed by the micro-service in the second time window and the number of the abnormal processing results;
a third judging unit, configured to determine that the state of the micro service is an unstable state if the number of the requests processed by the micro service in the second time window is greater than a number threshold and a ratio of the number of the exceptions to the number of the processed requests exceeds a ratio threshold;
and the second processing unit is used for performing fusing degradation processing on the micro-service in the unstable state.
In one embodiment, the second monitoring unit 204 includes:
the fourth obtaining unit is used for obtaining the number of abnormal processing results of the micro-service to the requests in the third time window;
a fourth judging unit, configured to judge that the state of the microservice is an unstable state if the number of exceptions, which is a processing result of the microservice on the request within the third time window, exceeds an exception number threshold;
and the third processing unit is used for performing fusing degradation processing on the micro-service in the unstable state.
In one embodiment, the pushing unit 202 includes:
and the first pushing unit is used for pushing the configuration information to each micro service in real time or pushing the configuration information to each micro service at regular time when receiving the new configuration information.
In one embodiment, the second monitoring unit 204 includes:
and the fourth processing unit is used for controlling the requests in the next corresponding time windows of the preset number to carry out direct return processing on the microservice in the unstable state.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, can implement the method provided by the above-described embodiments.
The invention also provides a computer device, which may include a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method provided by the above embodiments when executing the computer program.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method for controlling flow of a distributed service, comprising:
registering each micro service to a configuration center of a distributed service-oriented lightweight flow control framework, and accessing each micro service to a console of the distributed service-oriented lightweight flow control framework;
pushing configuration information to the configuration center through the console, and pushing the configuration information to each micro-service by the configuration center;
monitoring and displaying the flow of each micro-service in real time through a control console, and controlling the flow of each micro-service according to the monitored flow;
and monitoring and displaying the state of each micro service in real time through the console, and performing fusing degradation processing on each micro service according to the monitored state.
2. The method for controlling flow of distributed services according to claim 1, wherein the monitoring and displaying the flow of each microservice in real time by the console, and controlling the flow of each microservice according to the monitored flow, comprises:
acquiring a field value of a flow index field in configuration information;
and determining an index of flow needing to be monitored according to the field value, if the field value is 0, determining that the index is the query rate per second of the micro service, and if the field value is 1, determining that the index is the number of concurrent threads of the micro service.
3. The method for controlling flow of distributed services according to claim 1, wherein the monitoring and displaying the status of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored status comprises:
acquiring response time of the micro service to all requests in a first time window;
if the response time of the micro service to all the requests in the first time window exceeds a response time threshold, judging that the state of the micro service is an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
4. The method for controlling flow of distributed services according to claim 1, wherein the monitoring and displaying the status of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored status comprises:
acquiring the number of the requests processed by the micro-service in a second time window and the number of abnormal processing results;
if the number of the requests processed by the micro service in the second time window is larger than a number threshold value, and the processing result is that the ratio of the number of the exceptions to the number of the processed requests exceeds a ratio threshold value, determining that the state of the micro service is an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
5. The method for controlling flow of distributed services according to claim 1, wherein the monitoring and displaying the status of each micro-service in real time by the console, and performing fusing degradation processing on each micro-service according to the monitored status comprises:
acquiring the quantity of abnormal processing results of the micro-service to the requests in a third time window;
if the number of the requests processed by the micro service in the third time window is that the number of the exceptions exceeds the exception number threshold, the state of the micro service is judged to be an unstable state;
and performing fusing degradation processing on the micro service in the unstable state.
6. The method for controlling flow of distributed services according to claim 1, wherein said pushing, by said configuration center, configuration information to each microservice comprises:
and when receiving new configuration information, pushing the configuration information to each micro service in real time, or pushing the configuration information to each micro service at regular time.
7. The method for controlling flow of distributed services according to claim 3, 4 or 5, wherein the performing of the fusing degradation processing on the micro-service in the unstable state includes:
for microservices in an unstable state, control is given to direct return processing of requests within a next predetermined number of corresponding time windows.
8. A flow control apparatus for a distributed service, comprising:
the setting unit is used for registering each micro-service to a configuration center of a lightweight flow control frame facing the distributed service and accessing each micro-service to a console of the lightweight flow control frame facing the distributed service;
the pushing unit is used for pushing the configuration information to the configuration center through the console and pushing the configuration information to each microservice through the configuration center;
the first monitoring unit is used for monitoring and displaying the flow of each micro-service in real time through a control console and controlling the flow of each micro-service according to the monitored flow;
and the second monitoring unit is used for monitoring and displaying the state of each micro-service in real time through the console and performing fusing degradation processing on each micro-service according to the monitored state.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of traffic control for a distributed service according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements a method of flow control for a distributed service according to any one of claims 1 to 7.
CN201911366835.8A 2019-12-26 2019-12-26 Flow control method and device, computer equipment and storage medium Active CN111130939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911366835.8A CN111130939B (en) 2019-12-26 2019-12-26 Flow control method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911366835.8A CN111130939B (en) 2019-12-26 2019-12-26 Flow control method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111130939A true CN111130939A (en) 2020-05-08
CN111130939B CN111130939B (en) 2021-09-10

Family

ID=70503110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911366835.8A Active CN111130939B (en) 2019-12-26 2019-12-26 Flow control method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111130939B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787073A (en) * 2020-06-18 2020-10-16 多加网络科技(北京)有限公司 Current-limiting fusing platform and method for unified service
CN111984310A (en) * 2020-09-16 2020-11-24 深圳市火星人互动娱乐有限公司 Method for persisting Sentinel based on Nacos push mode
CN112181541A (en) * 2020-09-29 2021-01-05 京东数字科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN112187511A (en) * 2020-08-28 2021-01-05 苏州浪潮智能科技有限公司 Method, system, equipment and medium for positioning micro-service fusing abnormity
CN112965848A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Fusing degradation method, device, equipment and medium for micro service
CN112965823A (en) * 2021-03-24 2021-06-15 百度在线网络技术(北京)有限公司 Call request control method and device, electronic equipment and storage medium
CN113676434A (en) * 2020-05-13 2021-11-19 华为技术有限公司 Network resource fusing method and device, electronic equipment and storage medium
CN114363153A (en) * 2020-09-27 2022-04-15 中国电信股份有限公司 Adaptive fusing method for fuses and services
US12034820B2 (en) 2021-03-05 2024-07-09 Beijing Baidu Netcom Science Technology Co., Ltd. Fusing and degradation method and apparatus for micro-service, device, and medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515978A (en) * 2016-01-08 2016-04-20 盛科网络(苏州)有限公司 Method and device for realizing distributed routing and physical host access
CN106774220A (en) * 2017-01-20 2017-05-31 上海电力学院 A kind of thermal power plant's dcs on-line operation status monitoring platform
CN107454004A (en) * 2016-05-30 2017-12-08 阿里巴巴集团控股有限公司 A kind of flow control methods and device
CN107894874A (en) * 2017-11-17 2018-04-10 北京联想超融合科技有限公司 Data read-write control method, terminal and system based on super fusion storage system
CN108540468A (en) * 2018-04-02 2018-09-14 携程旅游信息技术(上海)有限公司 The control of request and method for routing and its system, storage medium, electronic equipment
CN108600005A (en) * 2018-04-23 2018-09-28 国云科技股份有限公司 A method of defence micro services avalanche effect
CN109412853A (en) * 2018-10-31 2019-03-01 中国建设银行股份有限公司 Distributed Services register storage method, system, device and storage medium
CN109684105A (en) * 2018-12-18 2019-04-26 中国平安人寿保险股份有限公司 Method, equipment and the storage medium that request is controlled under micro services framework
CN110149364A (en) * 2019-04-15 2019-08-20 厦门市美亚柏科信息股份有限公司 Method, apparatus, the storage medium of micro services are provided based on data service platform
CN110535902A (en) * 2019-07-16 2019-12-03 平安普惠企业管理有限公司 The processing method and electronic device of monitoring intelligent are realized based on micro services

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515978A (en) * 2016-01-08 2016-04-20 盛科网络(苏州)有限公司 Method and device for realizing distributed routing and physical host access
CN107454004A (en) * 2016-05-30 2017-12-08 阿里巴巴集团控股有限公司 A kind of flow control methods and device
CN106774220A (en) * 2017-01-20 2017-05-31 上海电力学院 A kind of thermal power plant's dcs on-line operation status monitoring platform
CN107894874A (en) * 2017-11-17 2018-04-10 北京联想超融合科技有限公司 Data read-write control method, terminal and system based on super fusion storage system
CN108540468A (en) * 2018-04-02 2018-09-14 携程旅游信息技术(上海)有限公司 The control of request and method for routing and its system, storage medium, electronic equipment
CN108600005A (en) * 2018-04-23 2018-09-28 国云科技股份有限公司 A method of defence micro services avalanche effect
CN109412853A (en) * 2018-10-31 2019-03-01 中国建设银行股份有限公司 Distributed Services register storage method, system, device and storage medium
CN109684105A (en) * 2018-12-18 2019-04-26 中国平安人寿保险股份有限公司 Method, equipment and the storage medium that request is controlled under micro services framework
CN110149364A (en) * 2019-04-15 2019-08-20 厦门市美亚柏科信息股份有限公司 Method, apparatus, the storage medium of micro services are provided based on data service platform
CN110535902A (en) * 2019-07-16 2019-12-03 平安普惠企业管理有限公司 The processing method and electronic device of monitoring intelligent are realized based on micro services

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113676434A (en) * 2020-05-13 2021-11-19 华为技术有限公司 Network resource fusing method and device, electronic equipment and storage medium
CN113676434B (en) * 2020-05-13 2023-03-24 华为技术有限公司 Network resource fusing method and device, electronic equipment and storage medium
CN111787073B (en) * 2020-06-18 2023-08-22 庞茂林 Current limiting fusing platform for unified service and method thereof
CN111787073A (en) * 2020-06-18 2020-10-16 多加网络科技(北京)有限公司 Current-limiting fusing platform and method for unified service
CN112187511A (en) * 2020-08-28 2021-01-05 苏州浪潮智能科技有限公司 Method, system, equipment and medium for positioning micro-service fusing abnormity
CN111984310A (en) * 2020-09-16 2020-11-24 深圳市火星人互动娱乐有限公司 Method for persisting Sentinel based on Nacos push mode
CN114363153A (en) * 2020-09-27 2022-04-15 中国电信股份有限公司 Adaptive fusing method for fuses and services
CN114363153B (en) * 2020-09-27 2024-01-26 中国电信股份有限公司 Self-adaptive fusing method for fuse and service
CN112181541A (en) * 2020-09-29 2021-01-05 京东数字科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN112965848A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Fusing degradation method, device, equipment and medium for micro service
US12034820B2 (en) 2021-03-05 2024-07-09 Beijing Baidu Netcom Science Technology Co., Ltd. Fusing and degradation method and apparatus for micro-service, device, and medium
CN112965823A (en) * 2021-03-24 2021-06-15 百度在线网络技术(北京)有限公司 Call request control method and device, electronic equipment and storage medium
CN112965823B (en) * 2021-03-24 2023-12-26 百度在线网络技术(北京)有限公司 Control method and device for call request, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111130939B (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN111130939B (en) Flow control method and device, computer equipment and storage medium
CN109660380B (en) Server running state monitoring method, platform, system and readable storage medium
US10956424B2 (en) Application recommending method and system, and server
US8775585B2 (en) Autonomic SLA breach value estimation
CN107465575A (en) The monitoring method and system of a kind of cluster
CN112954311B (en) Performance test method and system for live streaming media
CN110308985B (en) Cloud exclusive server resource management method, device, equipment and storage medium
CN110471749A (en) Task processing method, device, computer readable storage medium and computer equipment
CN108199861B (en) Computer room management method and device
CN113364697A (en) Flow control method, device, equipment and computer readable storage medium
CN111130867B (en) Intelligent household equipment alarm method and device based on Internet of things
US11146447B2 (en) Method and apparatus of establishing computer network monitoring criteria
JP2010152818A (en) Server system
US20050235284A1 (en) Systems and methods for tracking processing unit usage
US7269758B2 (en) Method and system for identifying runaway software agents
WO2019227624A1 (en) Monitoring method for call center, electronic apparatus, computer device and storage medium
CN111581087B (en) Application program testing method and device
CN106059794A (en) Monitoring method and monitoring apparatus
CN111107084B (en) Monitoring method, monitoring device, electronic equipment and storage medium
CN111710403A (en) Medical equipment supervision method, equipment and readable storage medium
CN112380478A (en) Webpage screenshot method and device, computer equipment and computer-readable storage medium
US20090083747A1 (en) Method for managing application programs by utilizing redundancy and load balance
KR102464688B1 (en) Method and apparatus for detrmining event level of monitoring result
US20210240536A1 (en) Allocation and management of computing platform resources
CN114036152A (en) Application use duration statistical method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant