CN110380987A - The method and device of the request serviced is called in a kind of processing - Google Patents

The method and device of the request serviced is called in a kind of processing Download PDF

Info

Publication number
CN110380987A
CN110380987A CN201910733441.5A CN201910733441A CN110380987A CN 110380987 A CN110380987 A CN 110380987A CN 201910733441 A CN201910733441 A CN 201910733441A CN 110380987 A CN110380987 A CN 110380987A
Authority
CN
China
Prior art keywords
destination
request
circuit
breaker
service
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.)
Pending
Application number
CN201910733441.5A
Other languages
Chinese (zh)
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology 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 Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN201910733441.5A priority Critical patent/CN110380987A/en
Publication of CN110380987A publication Critical patent/CN110380987A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The present invention provides the method and device that the request of service is called in a kind of processing, this method, comprising: breaker real-time blocking destination request;Breaker obtains newest circuit-breaker status in real time, when circuit-breaker status is to open, forbids destination request invocation target service, and the response of malloc failure malloc is returned to each destination request;When circuit-breaker status is to close, allow the service of destination request invocation target;When circuit-breaker status is semi-open, newest target proportion is obtained, allows the destination request invocation target service of target proportion, and the response to each destination request return malloc failure malloc for forbidding invocation target service;Compensating module real-time detection is each allowed to the destination request of invocation target service, and whether malloc failure malloc adjusts circuit-breaker status and target proportion according to the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service.The present invention can reduce the case where request obstruction.

Description

The method and device of the request serviced is called in a kind of processing
Technical field
The present invention relates to field of computer technology, in particular to the method and device of the request of service is called in a kind of processing.
Background technique
As the technology of cloud computing and micro services field is constantly mature, what more and more conventional monomer applications were split into A large amount of micro services simultaneously start upper cloud, and the local method call of script becomes the service call of across a network.
In the prior art, after needing to call the sender of service to issue request, if the request is not called successfully Service, then, which will be suspended, until the request timed out.Sender is constantly in request call service in the meantime State send after request timed out and obtain the feedback of malloc failure malloc just now.
As can be seen from the above description, the mode based on existing processing request can be a large amount of if many requests are all suspended There is the case where request obstruction.
Summary of the invention
The embodiment of the invention provides the method and devices that the request of service is called in a kind of processing, can reduce request obstruction The case where.
On the one hand, the method for the request of service is called the embodiment of the invention provides a kind of processing, comprising:
Breaker real-time blocking is used at least one destination request of invocation target service;
The breaker obtains newest circuit-breaker status from compensating module in real time, is to open in the circuit-breaker status When, forbid at least one described destination request to call the destination service, and return to malloc failure malloc to each destination request Response;When the circuit-breaker status is to close, at least one described destination request is allowed to call the destination service;Institute When to state circuit-breaker status be semi-open, obtain newest target proportion from the compensating module, allow at least one described mesh The destination request of target proportion described in mark request calls the destination service, and at least one described destination request Forbid the response for calling each of described destination service destination request to return to malloc failure malloc;
The compensating module real-time detection is each allowed to call whether the destination request of the destination service calls Failure, according to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, Adjust the circuit-breaker status and the target proportion.
Optionally,
The compensating module, comprising: fail counter and timer;
The compensating module real-time detection is each allowed to call whether the destination request of the destination service calls Failure, according to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, Adjust the circuit-breaker status, comprising:
The fail counter real-time detection is each allowed to call whether the destination request of the destination service is adjusted With failure, it is allowed to call the destination request of the destination service as cycle geo-statistic using the preset counting period The quantity of middle malloc failure malloc judges that the target of malloc failure malloc in the current count period is asked for each counting period Whether the quantity asked is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, it is described fixed to trigger When device restart timing;
The timer carries out periodically timing according to preset time-count cycle, after first time-count cycle, The fail counter is reset, the circuit-breaker status is adjusted to semi-open state, for first time-count cycle The fail counter is reset in present timing end cycle the time-count cycle each of afterwards, and adjust the target ratio Example, judges whether the target proportion adjusted reaches 100%, if it is, resetting the fail counter, and will be described Circuit-breaker status is adjusted to the state closed, and the target proportion is reverted to initial proportion.
Optionally,
The compensating module, comprising: state saves submodule;
The adjustment circuit-breaker status, comprising:
The compensating module determines the circuit-breaker status adjusted, and the circuit-breaker status adjusted is replaced The state saves the circuit-breaker status in submodule;
The breaker obtains compensating module circuit-breaker status adjusted in real time, comprising:
The breaker obtains the circuit-breaker status in the state preservation submodule in real time.
Optionally,
The adjustment target proportion, comprising:
Increase fixed proportion in the current target proportion, generates the target proportion adjusted.
Optionally,
After the response for returning to malloc failure malloc to each destination request, further comprise:
The breaker is by this between the server of the destination service and the sender of each destination request Connection disconnects;
Forbid calling each of described destination service destination request at least one described destination request described After the response for returning to malloc failure malloc, further comprise:
The breaker will be forbidden described in calling in the server of the destination service and at least one described destination request This connection between the sender of each of destination service destination request disconnects.
On the other hand, the device of the request of service is called the embodiment of the invention provides a kind of processing, comprising:
Breaker and compensating module;
The breaker is used at least one destination request of invocation target service for real-time blocking, in real time from described Newest circuit-breaker status is obtained in compensating module, when the circuit-breaker status is to open, forbids at least one described target Destination service described in request call, and the response to each destination request return malloc failure malloc;In the circuit-breaker status When to close, at least one described destination request is allowed to call the destination service;When the circuit-breaker status is semi-open, Newest target proportion is obtained from the compensating module, allows the mesh of target proportion at least one described destination request Destination service described in request call is marked, and forbids calling each institute of the destination service at least one described destination request State the response that destination request returns to malloc failure malloc;
The compensating module, be each allowed to call for real-time detection the destination service the destination request whether Malloc failure malloc, according to the number for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service Amount, adjusts the circuit-breaker status and the target proportion.
Optionally,
The compensating module, comprising: fail counter and timer;
The fail counter is each allowed to call for real-time detection the destination request of the destination service to be No malloc failure malloc is allowed to call the target of the destination service as cycle geo-statistic using the preset counting period The quantity of malloc failure malloc in request judges the mesh of malloc failure malloc in the current count period for each counting period Whether the quantity of mark request is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, triggers institute It states timer and restarts timing;
The timer is used to carry out periodically timing according to preset time-count cycle, first timing week After phase, the fail counter is reset, the circuit-breaker status is adjusted to semi-open state, for first timing The time-count cycle each of after period resets the fail counter in present timing end cycle, and adjusts the target Ratio, judges whether the target proportion adjusted reaches 100%, if it is, reset the fail counter, and by institute It states circuit-breaker status and is adjusted to the state closed, the target proportion is reverted into initial proportion.
Optionally,
The compensating module, comprising: state saves submodule;
The compensating module, when executing the adjustment circuit-breaker status, specifically for determining institute adjusted Circuit-breaker status is stated, the circuit-breaker status adjusted is replaced into the circuit-breaker status in the state preservation submodule;
The breaker is specifically used for reality when executing real-time acquisitions compensating module circuit-breaker status adjusted When obtain the state and save circuit-breaker status in submodule.
Optionally,
The timer, when executing the adjustment target proportion, specifically in the current target proportion Upper increase fixed proportion generates the target proportion adjusted.
Optionally,
The breaker is further used for after the response for returning to malloc failure malloc to each destination request, The breaker disconnects this connection between the server of the destination service and the sender of each destination request;
The breaker is further used for forbidding calling the target to take at least one described destination request described After each of the business destination request returns to the response of malloc failure malloc, by the server of the destination service and described at least one Forbid calling this connection between the sender of each of described destination service destination request to disconnect in a destination request.
In embodiments of the present invention, when there is destination request that invocation target is gone to service, it can be first switched off device interception, compensate mould Block can be according to the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service come to circuit-breaker status It is adjusted with target proportion, handles these intercepted destination requests, whole process according to circuit-breaker status by breaker It is the process of a dynamic adjustment, the adjustment of circuit-breaker status and target proportion will affect the target for being allowed to invocation target service The quantity of request, and then will affect the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service, This again can impact circuit-breaker status and target proportion, form the loop of a feedback regulation, by breaker shape The adjustment of state, it may be possible to which so that partial target request is switched off device and forbids invocation target service, also, these are prohibited to call The sender of the destination request of destination service can quickly receive the response of malloc failure malloc, will not be in time-out without being suspended It can just be responded afterwards, in such manner, it is possible to the case where reducing request obstruction.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is the flow chart of the method for the request that service is called in a kind of processing that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of the device for the request that service is called in a kind of processing that one embodiment of the invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, the embodiment of the invention provides a kind of method that the request of service is called in processing, this method be can wrap Include following steps:
Step 101: breaker real-time blocking is used at least one destination request of invocation target service;
Step 102: the breaker obtains newest circuit-breaker status from compensating module in real time, in the breaker shape State is to forbid at least one described destination request to call the destination service, and return to each destination request when opening The response of malloc failure malloc;When the circuit-breaker status is to close, at least one described destination request is allowed to call the target Service;When the circuit-breaker status is semi-open, newest target proportion is obtained from the compensating module, permission is described extremely The destination request of target proportion described in a few destination request calls the destination service, and at least one described mesh Forbid the response for calling each of described destination service destination request to return to malloc failure malloc in mark request;
Step 103: the compensating module real-time detection is each allowed to call the destination request of the destination service Whether malloc failure malloc, according to the destination request for being allowed to call malloc failure malloc in the destination request of the destination service Quantity, adjust the circuit-breaker status and the target proportion.
In embodiments of the present invention, when there is destination request that invocation target is gone to service, it can be first switched off device interception, compensate mould Block can be according to the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service come to circuit-breaker status It is adjusted with target proportion, handles these intercepted destination requests, whole process according to circuit-breaker status by breaker It is the process of a dynamic adjustment, the adjustment of circuit-breaker status and target proportion will affect the target for being allowed to invocation target service The quantity of request, and then will affect the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service, This again can impact circuit-breaker status and target proportion, form the loop of a feedback regulation, by breaker shape The adjustment of state, it may be possible to which so that partial target request is switched off device and forbids invocation target service, also, these are prohibited to call The sender of the destination request of destination service can quickly receive the response of malloc failure malloc, will not be in time-out without being suspended It can just be responded afterwards, in such manner, it is possible to the case where reducing request obstruction.
When circuit-breaker status is semi-open state, breaker can be realized described in permission according to newest target proportion The destination request of target proportion calls the destination service at least one destination request.
In embodiments of the present invention, breaker can intercept all destination requests for invocation target service, then, base These destination requests are handled in circuit-breaker status.
In an embodiment of the present invention, the compensating module, comprising: fail counter and timer;
The compensating module real-time detection is each allowed to call whether the destination request of the destination service calls Failure, according to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, Adjust the circuit-breaker status, comprising:
The fail counter real-time detection is each allowed to call whether the destination request of the destination service is adjusted With failure, it is allowed to call the destination request of the destination service as cycle geo-statistic using the preset counting period The quantity of middle malloc failure malloc judges that the target of malloc failure malloc in the current count period is asked for each counting period Whether the quantity asked is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, it is described fixed to trigger When device restart timing;
The timer carries out periodically timing according to preset time-count cycle, after first time-count cycle, The fail counter is reset, the circuit-breaker status is adjusted to semi-open state, for first time-count cycle The fail counter is reset in present timing end cycle the time-count cycle each of afterwards, and adjust the target ratio Example, judges whether the target proportion adjusted reaches 100%, if it is, resetting the fail counter, and will be described Circuit-breaker status is adjusted to the state closed, and the target proportion is reverted to initial proportion.
In embodiments of the present invention, breaker can allow some destination requests to go invocation target service, still, these targets Also there can be the case where malloc failure malloc in request, if what is occurred the case where malloc failure malloc is more, illustrate there are many requests The case where being suspended, blocking in order to avoid request adjusts circuit-breaker status, so that breaker forbids some destination requests to call mesh Mark service after the case where malloc failure malloc is reduced, then adjusts circuit-breaker status and makes breaker that more destination requests be allowed Invocation target service enables to the request being suspended in fewer situation by the adjustment of this dynamic, and then can be big Big the case where mitigating request obstruction.
Wherein, statistics be allowed to the quantity of malloc failure malloc in the destination request of invocation target service by fail counter come It realizes.Fail counter periodically counts, if the quantity of malloc failure malloc is greater than preset threshold within a counting period, Then explanation is within the counting period, and the speedup of the quantity of the destination request of malloc failure malloc is very fast, therefore, it is desirable to by circuit-breaker status It is adjusted to open state, forbids all destination request invocation target services, in such manner, it is possible to avoid more destination request tune With failure.In addition, fail counter triggers timer while adjusting circuit-breaker status restarts timing, the of timing After one time-count cycle, circuit-breaker status is adjusted to semi-open state, a certain proportion of destination request is allowed to call mesh Mark service.For in each time-count cycle later, if fail counter is judged currently to count in current time-count cycle The quantity of the destination request of malloc failure malloc is greater than preset threshold in one number time, then, fail counter can trigger timer again Start timing, and the timing since first time-count cycle, is lost if fail counter is judged to call in the current count period The quantity of the destination request lost is not more than preset threshold, then, timer can adjust target proportion, then proceed by next Time-count cycle allows the quantity of the destination request of invocation target service that can also change, works as mesh with the adjustment of target proportion When mark ratio reaches 100%, it is equivalent to, circuit-breaker status is the state closed, then, directly circuit-breaker status is adjusted to close The state closed, and target proportion is reverted into initial proportion, restart timing convenient for subsequent fail counter triggering timer Afterwards, target proportion is adjusted.
In an embodiment of the present invention, the adjustment target proportion, comprising:
Increase fixed proportion in the current target proportion, generates the target proportion adjusted.
In embodiments of the present invention, adjusting in such a way that each adjustment all increases fixed proportion come real to target proportion It is existing.For example, the initial proportion of target proportion is 10%.Fixed proportion is 5%, then, adjustment all can be current every time Increase fixed proportion (namely 5%) on the basis of target proportion, such as: after the first adjustment, target proportion is adjusted to by 10% 15%, after second adjusts, target proportion is adjusted to 20% by 15%, and so on, with the progress of time-count cycle, finally may be used It can reach 100%.Certainly, initial proportion may be set to be other values, such as: 5%, 15%, 20%, 25%, 30% etc., Fixed proportion may be set to be other values, such as: 10%, 15%, 20%, 25%, 30% etc..
In an embodiment of the present invention, the compensating module, comprising: state saves submodule;
The adjustment circuit-breaker status, comprising:
The compensating module determines the circuit-breaker status adjusted, and the circuit-breaker status adjusted is replaced The state saves the circuit-breaker status in submodule;
The breaker obtains compensating module circuit-breaker status adjusted in real time, comprising:
The breaker obtains the circuit-breaker status in the state preservation submodule in real time.
In embodiments of the present invention, circuit-breaker status is saved in state and guarantees in submodule that breaker can be arrived independently State guarantees that submodule obtains newest circuit-breaker status.
When compensating module includes: fail counter and timer,
Fail counter execute it is described the circuit-breaker status is adjusted to open state when, comprising:
State is saved the circuit-breaker status in submodule and is revised as open state by fail counter;
Timer execute it is described the circuit-breaker status is adjusted to semi-open state when, comprising:
State is saved the circuit-breaker status in submodule and modifies semi-open state by timer;
Timer is when executing the state that the circuit-breaker status is adjusted to closing, comprising:
State is saved the state that the circuit-breaker status modification in submodule is closed by timer.
In an embodiment of the present invention, after the response for returning to malloc failure malloc to each destination request, into One step includes:
The breaker is by this between the server of the destination service and the sender of each destination request Connection disconnects;
Forbid calling each of described destination service destination request at least one described destination request described After the response for returning to malloc failure malloc, further comprise:
The breaker will be forbidden described in calling in the server of the destination service and at least one described destination request This connection between the sender of each of destination service destination request disconnects.
In embodiments of the present invention, by by between the server of destination service and the sender of destination request this company Disconnection is connect, the resource of continuous server can be discharged, other senders is enabled to send destination request to server to adjust Use destination service.
In general, each destination service is provided with corresponding connection pool, and the server of sending direction destination service is sent It when destination request, needs to establish the connection with server using the resource in connection pool, if too many sender occupies connection The resource in pond may exhaust the resource of connection pool, so that other equipment can not establish connection with server, and then can not adjust Use destination service.
If destination request is suspended, the sender of the destination request can keep connecting with server always, always The resource for occupying connection pool, so that other need the equipment of invocation target service can not invocation target service.
In embodiments of the present invention, the destination request for invocation target service can be controlled by breaker, A part of destination request invocation target service can directly be forbidden by breaker, then, quickly returned to the request of this partial target The response for returning malloc failure malloc, avoids these requests from being suspended, and then can reduce can between a large amount of complicated service calls Can occur extensive cascading failure caused by service avalanche effect, and then can ensure end-to-end service rely on performance and Availability.
In embodiments of the present invention, when the service call of across a network fails and accumulates to a threshold value, breaker is opened, As a kind of compensation policy, service no longer carries out distal end calling, but quickly returns to the response of malloc failure malloc, then starting timing Device, in the circulation timing of timer period, breaker enters semi-open state, and a part of destination request is allowed to pass through, and According to calling, whether successful result constantly adjusts the opening degree of breaker (namely according to calling whether successfully as a result, not Disconnected adjustment target proportion), until breaker closing or be again turned on, thus over time by it is a kind of it is graceful in a manner of realize pair The dynamically adapting of the service availability variation of upstream.
In embodiments of the present invention, breaker and compensating module can control invocation target clothes as a kind of compensation policy The quantity of the destination request of business, and can timely be responded to the destination request return for being prohibited invocation target service, so that this The destination request for being prohibited invocation target service a bit will not be suspended, and then can be minimized unsuccessfully caused between service dependence Adverse effect stops cascading failure, with the failure being likely to occur in service call chain of certain elasticity to cope with complexity, significantly Failure response ability is improved, ensure that the availability of system entirety.
In embodiments of the present invention, breaker and compensating module, can be for each using pluggable embedded design Corresponding breaker and compensating module is arranged in service, and equipment of the service with needing to call service is arranged in breaker and compensating module Between, breaker and compensating module will not influence the normal processing of service, can satisfy the service call control institute of different stage It needs, guarantees that complicated service call can stablize progress.
In embodiments of the present invention, when circuit-breaker status is semi-open, can be controlled based on target proportion allows to adjust With the quantity of the destination request of destination service, fine-grained control can be carried out to traffic behavior, it is ensured that upstream service has centainly Redundancy, to make system that still there is certain service ability when failure occurs, by it is a kind of it is graceful in a manner of realize at any time Adapt dynamically to the variation of service availability.
In embodiments of the present invention, based on pluggable Embedded breaker and compensating module, in conjunction with compensating module In canary mode, can be applied to the communication link defined by any end point set and carry out customized control.
In embodiments of the present invention, the target proportion in compensating module can be set on demand, adjust circuit-breaker status in real time And target proportion, it realizes and the access control of each request is optimized.
In embodiments of the present invention, fail counter, timer and breaker influence each other, in conjunction with being single with the period The dynamic of the target proportion of position updates, and realizes and controls the fine granularity of upstream service request.
As shown in Fig. 2, the embodiment of the invention provides the devices that the request of service is called in a kind of processing, comprising:
Breaker 201 and compensating module 202;
The breaker 201 is used at least one destination request of invocation target service for real-time blocking, in real time from institute State and obtain newest circuit-breaker status in compensating module 202, when the circuit-breaker status is to open, forbid it is described at least one Destination request calls the destination service, and the response of malloc failure malloc is returned to each destination request;In the breaker State is to allow at least one described destination request to call the destination service when closing;It is half-dozen in the circuit-breaker status When opening, newest target proportion is obtained from the compensating module 202, allows target proportion at least one described destination request The destination request call the destination service, and forbid calling the destination service at least one described destination request Each of the destination request return to the response of malloc failure malloc;
The compensating module 202 is each allowed to call the destination request of the destination service for real-time detection Whether malloc failure malloc, according to the destination request for being allowed to call malloc failure malloc in the destination request of the destination service Quantity, adjust the circuit-breaker status and the target proportion.
In an embodiment of the present invention, the compensating module, comprising: fail counter and timer;
The fail counter is each allowed to call for real-time detection the destination request of the destination service to be No malloc failure malloc is allowed to call the target of the destination service as cycle geo-statistic using the preset counting period The quantity of malloc failure malloc in request judges the mesh of malloc failure malloc in the current count period for each counting period Whether the quantity of mark request is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, triggers institute It states timer and restarts timing;
The timer is used to carry out periodically timing according to preset time-count cycle, first timing week After phase, the fail counter is reset, the circuit-breaker status is adjusted to semi-open state, for first timing The time-count cycle each of after period resets the fail counter in present timing end cycle, and adjusts the target Ratio, judges whether the target proportion adjusted reaches 100%, if it is, reset the fail counter, and by institute It states circuit-breaker status and is adjusted to the state closed, the target proportion is reverted into initial proportion.
In an embodiment of the present invention, the compensating module, comprising: state saves submodule;
The compensating module, when executing the adjustment circuit-breaker status, specifically for determining institute adjusted Circuit-breaker status is stated, the circuit-breaker status adjusted is replaced into the circuit-breaker status in the state preservation submodule;
The breaker is specifically used for reality when executing real-time acquisitions compensating module circuit-breaker status adjusted When obtain the state and save circuit-breaker status in submodule.
In an embodiment of the present invention, the timer is specifically used for when executing the adjustment target proportion Increase fixed proportion in the current target proportion, generates the target proportion adjusted.
In an embodiment of the present invention, the breaker is further used for returning described to each destination request After the response of malloc failure malloc, the breaker is by the sender of the server of the destination service and each destination request Between this connection disconnect;
The breaker is further used for forbidding calling the target to take at least one described destination request described After each of the business destination request returns to the response of malloc failure malloc, by the server of the destination service and described at least one Forbid calling this connection between the sender of each of described destination service destination request to disconnect in a destination request.
The contents such as the information exchange between each unit, implementation procedure in above-mentioned apparatus, due to implementing with the method for the present invention Example is based on same design, and for details, please refer to the description in the embodiment of the method for the present invention, and details are not described herein again.
The embodiment of the invention provides a kind of readable mediums, including execute instruction, when the processor of storage control executes Described when executing instruction, the storage control executes the request that service is called in any one processing provided in an embodiment of the present invention Method.
The embodiment of the invention provides a kind of storage controls, comprising: processor, memory and bus;
The memory is executed instruction for storing, and the processor is connect with the memory by the bus, when When the storage control is run, the processor executes executing instruction for the memory storage, so that the storage controls Device executes the method that the request of service is called in any one processing provided in an embodiment of the present invention.
The each embodiment of the present invention at least has the following beneficial effects:
1, in embodiments of the present invention, when there is destination request that invocation target is gone to service, device interception, compensation can be first switched off Module can be according to the quantity of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service come to breaker shape State and target proportion are adjusted, these intercepted destination requests, entire mistake are handled according to circuit-breaker status by breaker Journey is the process of a dynamic adjustment, and the adjustment of circuit-breaker status and target proportion will affect the mesh for being allowed to invocation target service The quantity of request is marked, and then will affect the number of the destination request of malloc failure malloc in the destination request for being allowed to invocation target service Amount, this again can impact circuit-breaker status and target proportion, the loop of a feedback regulation be formd, by breaker The adjustment of state, it may be possible to which so that partial target request is switched off device and forbids invocation target service, also, these are prohibited to adjust The response that malloc failure malloc can be quickly received with the sender of the destination request of destination service will not be super without being suspended When after can just be responded, in such manner, it is possible to reduce request obstruction the case where.
2, in embodiments of the present invention, the destination request for invocation target service can be controlled by breaker System, can directly forbid a part of destination request invocation target service by breaker, then, quickly request to this partial target The response for returning to malloc failure malloc, avoids these requests from being suspended, and then can reduce between a large amount of complicated service calls Avalanche effect is serviced caused by the extensive cascading failure being likely to occur, and then can ensure the performance that end-to-end service relies on And availability.
3, in embodiments of the present invention, when the service call of across a network fails and accumulates to a threshold value, breaker is beaten It opens, as a kind of compensation policy, service no longer carries out distal end calling, but quickly returns to the response of malloc failure malloc, then starts Timer, in the circulation timing of timer period, breaker enters semi-open state, allows a part of destination request logical Cross, and according to call whether successful result constantly adjust breaker opening degree (namely according to call whether successfully knot Fruit, constantly adjustment target proportion), it until breaker closing or is again turned on, thus over time in a manner of a kind of gracefulness Realize the dynamically adapting of the service availability variation to upstream.
4, in embodiments of the present invention, breaker and compensating module can control invocation target as a kind of compensation policy The quantity of the destination request of service, and can timely be responded to the destination request return for being prohibited invocation target service, so that These destination requests for being prohibited invocation target service will not be suspended, and then can be minimized to fail between service dependence and be made At adverse effect, stop cascading failure, with the failure being likely to occur in service call chain of certain elasticity to cope with complexity, shows It writes and improves failure response ability, ensure that the availability of system entirety.
5, in embodiments of the present invention, breaker and compensating module, can be for every using pluggable embedded design Corresponding breaker and compensating module is arranged in a service, and breaker and compensating module are arranged in service and need to call setting for service Between standby, breaker and compensating module will not influence the normal processing of service, can satisfy the service call control of different stage It is required, guarantee that complicated service call can stablize progress.
It should be noted that, in this document, such as first and second etc relational terms are used merely to an entity Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non- It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements, It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or equipment Some elements.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including There is also other identical factors in the process, method, article or equipment of the element.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, the program When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: ROM, RAM, magnetic disk or light In the various media that can store program code such as disk.
Finally, it should be noted that the foregoing is merely presently preferred embodiments of the present invention, it is merely to illustrate skill of the invention Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention, Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.

Claims (10)

1. a kind of method that the request of service is called in processing characterized by comprising
Breaker real-time blocking is used at least one destination request of invocation target service;
The breaker obtains newest circuit-breaker status from compensating module in real time, when the circuit-breaker status is to open, Forbid at least one described destination request to call the destination service, and returns to the sound of malloc failure malloc to each destination request It answers;When the circuit-breaker status is to close, at least one described destination request is allowed to call the destination service;Described disconnected When road device state is semi-open, newest target proportion is obtained from the compensating module, at least one described target is allowed to ask The destination request of target proportion described in asking calls the destination service, and forbids at least one described destination request Each of described destination service destination request is called to return to the response of malloc failure malloc;
The compensating module real-time detection be each allowed to call the destination service the destination request whether malloc failure malloc, According to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, institute is adjusted State circuit-breaker status and the target proportion.
2. the method according to claim 1, wherein
The compensating module, comprising: fail counter and timer;
The compensating module real-time detection be each allowed to call the destination service the destination request whether malloc failure malloc, According to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, institute is adjusted State circuit-breaker status, comprising:
The fail counter real-time detection is each allowed to call whether the destination request of the destination service calls mistake It loses, is allowed to adjust in the destination request for calling the destination service using the preset counting period as cycle geo-statistic The destination request of malloc failure malloc in the current count period is judged for each counting period with the quantity of failure Whether quantity is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, triggers the timer Restart timing;
The timer carries out periodically timing according to preset time-count cycle, after first time-count cycle, resetting The circuit-breaker status is adjusted to semi-open state by the fail counter, after first time-count cycle Each time-count cycle resets the fail counter in present timing end cycle, and adjusts the target proportion, sentences Whether the target proportion adjusted of breaking reaches 100%, if it is, reset the fail counter, and by the open circuit Device state is adjusted to the state closed, and the target proportion is reverted to initial proportion.
3. the method according to claim 1, wherein
The compensating module, comprising: state saves submodule;
The adjustment circuit-breaker status, comprising:
The compensating module determines the circuit-breaker status adjusted, will be described in the circuit-breaker status replacement adjusted State saves the circuit-breaker status in submodule;
The breaker obtains compensating module circuit-breaker status adjusted in real time, comprising:
The breaker obtains the circuit-breaker status in the state preservation submodule in real time.
4. according to the method described in claim 2, it is characterized in that,
The adjustment target proportion, comprising:
Increase fixed proportion in the current target proportion, generates the target proportion adjusted.
5. method according to any one of claims 1-4, which is characterized in that
After the response for returning to malloc failure malloc to each destination request, further comprise:
The breaker by between the server of the destination service and the sender of each destination request this connection It disconnects;
Described forbid that each of described destination service destination request is called to return at least one described destination request After the response of malloc failure malloc, further comprise:
The breaker will be forbidden calling the target in the server of the destination service and at least one described destination request This connection between each of the service sender of the destination request disconnects.
6. the device that the request of service is called in a kind of processing characterized by comprising
Breaker and compensating module;
The breaker is used at least one destination request of invocation target service for real-time blocking, in real time from the compensation Newest circuit-breaker status is obtained in module, when the circuit-breaker status is to open, forbids at least one described destination request The destination service is called, and returns to the response of malloc failure malloc to each destination request;It is to close in the circuit-breaker status When closing, at least one described destination request is allowed to call the destination service;When the circuit-breaker status is semi-open, from institute It states and obtains newest target proportion in compensating module, the target of target proportion at least one described destination request is allowed to ask It asks and calls the destination service, and forbid calling each of described destination service mesh at least one described destination request Mark request returns to the response of malloc failure malloc;
The compensating module is each allowed to call whether the destination request of the destination service calls for real-time detection Failure, according to the quantity for being allowed to call the destination request of malloc failure malloc in the destination request of the destination service, Adjust the circuit-breaker status and the target proportion.
7. device according to claim 6, which is characterized in that
The compensating module, comprising: fail counter and timer;
The fail counter is each allowed to call whether the destination request of the destination service is adjusted for real-time detection With failure, it is allowed to call the destination request of the destination service as cycle geo-statistic using the preset counting period The quantity of middle malloc failure malloc judges that the target of malloc failure malloc in the current count period is asked for each counting period Whether the quantity asked is greater than preset threshold, if it is, the circuit-breaker status is adjusted to open state, it is described fixed to trigger When device restart timing;
The timer is used to carry out periodically timing according to preset time-count cycle, after first time-count cycle, The fail counter is reset, the circuit-breaker status is adjusted to semi-open state, for first time-count cycle The fail counter is reset in present timing end cycle the time-count cycle each of afterwards, and adjust the target ratio Example, judges whether the target proportion adjusted reaches 100%, if it is, resetting the fail counter, and will be described Circuit-breaker status is adjusted to the state closed, and the target proportion is reverted to initial proportion.
8. device according to claim 6, which is characterized in that
The compensating module, comprising: state saves submodule;
The compensating module, it is adjusted described disconnected specifically for determining when executing the adjustment circuit-breaker status The circuit-breaker status adjusted is replaced the circuit-breaker status in the state preservation submodule by road device state;
The breaker, when executing real-time acquisition compensating module circuit-breaker status adjusted, specifically for obtaining in real time The state is taken to save the circuit-breaker status in submodule.
9. device according to claim 7, which is characterized in that
The timer, when executing the adjustment target proportion, specifically for increasing in the current target proportion Certainty ratio is reinforced, the target proportion adjusted is generated.
10. according to the device any in claim 6-9, which is characterized in that
The breaker is further used for after the response for returning to malloc failure malloc to each destination request, described Breaker disconnects this connection between the server of the destination service and the sender of each destination request;
The breaker is further used for forbidding calling the destination service at least one described destination request described After each destination request returns to the response of malloc failure malloc, by the server of the destination service and at least one described mesh Forbid calling this connection between the sender of each of described destination service destination request to disconnect in mark request.
CN201910733441.5A 2019-09-10 2019-09-10 The method and device of the request serviced is called in a kind of processing Pending CN110380987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910733441.5A CN110380987A (en) 2019-09-10 2019-09-10 The method and device of the request serviced is called in a kind of processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910733441.5A CN110380987A (en) 2019-09-10 2019-09-10 The method and device of the request serviced is called in a kind of processing

Publications (1)

Publication Number Publication Date
CN110380987A true CN110380987A (en) 2019-10-25

Family

ID=68258742

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910733441.5A Pending CN110380987A (en) 2019-09-10 2019-09-10 The method and device of the request serviced is called in a kind of processing

Country Status (1)

Country Link
CN (1) CN110380987A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756601A (en) * 2020-06-24 2020-10-09 中国平安财产保险股份有限公司 Microservice architecture monitoring method and device, computer equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092532A (en) * 2017-03-22 2017-08-25 武汉斗鱼网络科技有限公司 A kind of remote invocation method and far call device
CN108062256A (en) * 2017-11-10 2018-05-22 中国民生银行股份有限公司 The access method and device of a kind of application program
CN108712489A (en) * 2018-05-11 2018-10-26 中国平安人寿保险股份有限公司 A kind of breaking control method, device and its readable storage medium storing program for executing of network linking

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092532A (en) * 2017-03-22 2017-08-25 武汉斗鱼网络科技有限公司 A kind of remote invocation method and far call device
CN108062256A (en) * 2017-11-10 2018-05-22 中国民生银行股份有限公司 The access method and device of a kind of application program
CN108712489A (en) * 2018-05-11 2018-10-26 中国平安人寿保险股份有限公司 A kind of breaking control method, device and its readable storage medium storing program for executing of network linking

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756601A (en) * 2020-06-24 2020-10-09 中国平安财产保险股份有限公司 Microservice architecture monitoring method and device, computer equipment and readable storage medium
CN111756601B (en) * 2020-06-24 2023-02-03 中国平安财产保险股份有限公司 Microservice architecture monitoring method and device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US10432533B2 (en) Automatic detection and prevention of network overload conditions using SDN
US6988156B2 (en) System and method for dynamically tuning interrupt coalescing parameters
EP2458768B1 (en) Method for switching node main-standby controllers based on content delivery network (cdn) and cdn thereof
US9423864B2 (en) PCI express device and link energy management method and device
EP3337097A1 (en) Network element upgrading method and device
US6889277B2 (en) System and method for dynamically tuning interrupt coalescing parameters
US7873733B2 (en) Load distribution method, load distribution device, and system including load distribution device
EP3607507A1 (en) Training a software agent to control a communication network
CN110505155A (en) Request degradation processing method, device, electronic equipment and storage medium
US7916695B2 (en) Smart buffering for policy enforcement
US20230224722A1 (en) Dynamic Adjustment of Deployment Location of Software Within a Network
CN106576260B (en) Strategy coordination method and device in NFV system
CN113300975A (en) Control method of network equipment, network transmission method, device and equipment
US20060282831A1 (en) Method and hardware node for customized upgrade control
CN110380987A (en) The method and device of the request serviced is called in a kind of processing
CN106936926A (en) Access the method and system of back end
CN109815204A (en) A kind of metadata request distribution method and equipment based on congestion aware
CN112965823A (en) Call request control method and device, electronic equipment and storage medium
EP2874353A1 (en) Service protection method and system for composite link
US7471630B2 (en) Systems and methods for performing selective flow control
MXPA00000525A (en) System and method of detecting overload in a service control point of a telecommunication network.
CN113315718B (en) System, method and device for self-adaptive current limiting
KR102317728B1 (en) Method for controlling replication of session and upf node performing method
WO2021197278A1 (en) Method and system for processing user service, and related device
US20210273885A1 (en) Operation of a broadband access network of a telecommunications network

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191025

RJ01 Rejection of invention patent application after publication