CN109684105B - Method, apparatus and storage medium for controlling requests under micro-service architecture - Google Patents

Method, apparatus and storage medium for controlling requests under micro-service architecture Download PDF

Info

Publication number
CN109684105B
CN109684105B CN201811554548.5A CN201811554548A CN109684105B CN 109684105 B CN109684105 B CN 109684105B CN 201811554548 A CN201811554548 A CN 201811554548A CN 109684105 B CN109684105 B CN 109684105B
Authority
CN
China
Prior art keywords
micro
service application
service
exceeds
application
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.)
Active
Application number
CN201811554548.5A
Other languages
Chinese (zh)
Other versions
CN109684105A (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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811554548.5A priority Critical patent/CN109684105B/en
Publication of CN109684105A publication Critical patent/CN109684105A/en
Application granted granted Critical
Publication of CN109684105B publication Critical patent/CN109684105B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure relates to a method, apparatus, and storage medium for controlling requests under a micro-service architecture. The method comprises the following steps: judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value; for a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not; and degrading the preset micro-service application of the application platform without fusing the call request of the micro-service application for the case that the current request number does not exceed the first preset number. Through the embodiments of the present disclosure, the problem of response delay of the micro service application can be more rapidly solved, load balancing is realized, and system efficiency and performance are improved.

Description

Method, apparatus and storage medium for controlling requests under micro-service architecture
Technical Field
The present invention relates to the technical field of micro-service architecture, and in particular, to a method, an apparatus, a computing device, and a computer readable storage medium for controlling a request under a micro-service architecture.
Background
Micro-service architecture is a new technology used to deploy applications and services. Applications and services can be more easily upgraded and expanded by breaking them up into smaller, loosely coupled components.
To handle high concurrency service requests under a micro-service architecture, a fusing mechanism is introduced. Typically, when a call for a micro-service fails to reach a certain threshold (e.g., 20 failures in 5 seconds), a fusing mechanism is activated. The fusing strategy under the micro-service architecture is a key for processing high concurrency service and ensuring normal operation of the micro-service. To accommodate a variety of different needs, fusing strategies are continually being adjusted and improved.
Disclosure of Invention
It is an aim of embodiments of the present invention to provide a new fusing strategy for micro-service architecture.
According to a first aspect of the present application, there is provided a method of controlling requests in an application platform of a micro-service architecture, wherein the application platform invokes one or more micro-service applications to process service requests from users, the method comprising:
Judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value;
For a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not;
and degrading the preset micro-service application of the application platform without fusing the call request of the micro-service application for the case that the current request number does not exceed the first preset number.
According to an exemplary embodiment, the method further comprises:
determining if the response time of the micro-service application whose response time exceeds a first predetermined threshold still exceeds a first predetermined threshold, if the predetermined micro-service application is downgraded for a predetermined period of time;
a request to restart the micro-service application is sent if the response time still exceeds a first predetermined threshold.
According to an exemplary embodiment, the method further comprises:
And fusing the call request for the micro-service application in the case that the current request number exceeds the first preset number.
According to an exemplary embodiment, the method further comprises:
Judging whether the fused request number of the micro-service application exceeds a second preset number;
and degrading the predetermined micro-service application of the application platform in the case that the number of fused requests exceeds a second predetermined number.
According to an exemplary embodiment, the method further comprises:
responding to a call request from a first micro-service application to a second micro-service application, judging whether the call request number of the first micro-service application to the second micro-service application exceeds a third preset number in unit time, wherein the first micro-service application and the second micro-service application are any two micro-service applications contained in the application platform;
And returning a preset default value to the first micro-service application without calling the second micro-service application to process the calling request under the condition that the calling request number in the unit time exceeds a third preset number.
According to an exemplary embodiment, the method further comprises:
In the event that the number of times the predetermined micro-service application that was downgraded is invoked exceeds a fourth predetermined number, a request to restart the predetermined micro-service application that was downgraded is sent.
According to a second aspect of the present application, there is provided an apparatus for controlling requests in an application platform of a micro-service architecture, wherein the application platform invokes one or more micro-service applications to process service requests from users, the apparatus comprising:
A first determination module configured to: judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value;
A second determination module configured to: for a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not;
A downgrade module configured to: and degrading the preset micro-service application of the application platform without fusing the call request of the micro-service application for the case that the current request number does not exceed the first preset number.
According to an exemplary embodiment, the first determination module is further configured to:
determining if the response time of the micro-service application whose response time exceeds a first predetermined threshold still exceeds a first predetermined threshold, if the predetermined micro-service application is downgraded for a predetermined period of time;
Wherein the apparatus further comprises a restart request module configured to: a request to restart the micro-service application is sent if the response time still exceeds a first predetermined threshold.
According to an exemplary embodiment, the apparatus further comprises:
A fuse module configured to: and fusing the call request for the micro-service application in the case that the current request number exceeds the first preset number.
According to an exemplary embodiment, the apparatus further comprises:
a third determination module configured to: judging whether the fused request number of the micro-service application exceeds a second preset number;
wherein the downgrade module is further configured to: and degrading the predetermined micro-service application of the application platform in the case that the number of fused requests exceeds a second predetermined number.
According to an exemplary embodiment, the apparatus further comprises a current limiting module comprising:
A fourth judgment unit configured to: responding to a call request from a first micro-service application to a second micro-service application, judging whether the call request number of the first micro-service application to the second micro-service application exceeds a third preset number in unit time, wherein the first micro-service application and the second micro-service application are any two micro-service applications contained in the application platform;
a current limiting unit configured to: and returning a preset default value to the first micro-service application without calling the second micro-service application to process the calling request under the condition that the calling request number in the unit time exceeds a third preset number.
According to an exemplary embodiment, the restart request module is further configured to:
In the event that the number of times the predetermined micro-service application that was downgraded is invoked exceeds a fourth predetermined number, a request to restart the predetermined micro-service application that was downgraded is sent.
According to a third aspect of the present application there is provided a computing device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the computing device to perform any one of the method embodiments described above.
According to a fourth aspect of the present application there is provided a computer readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements any of the method embodiments described above.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
by the embodiments of the application, the efficiency of the fusing mechanism can be improved, and the performance of processing high concurrent service under a micro-service architecture can be better ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Fig. 1 is a schematic diagram illustrating an implementation environment in which the present application may be practiced, according to an exemplary embodiment.
Fig. 2 is a schematic flow chart illustrating a method of controlling requests under an application platform of a micro-service architecture according to an exemplary embodiment of the application.
FIG. 3 is a schematic flow chart of an exemplary embodiment of a process for restarting a micro-service application that may also be included in the method embodiment shown in FIG. 2.
FIG. 4 is a schematic flow chart of an exemplary embodiment of a post-fuse degradation process that may also be included with the method embodiment shown in FIG. 2.
Fig. 5 is a schematic flow chart of an exemplary embodiment of a current limiting process that may also be included with the method embodiment shown in fig. 2.
Fig. 6 is a schematic block diagram illustrating an apparatus for controlling requests under an application platform of a micro-service architecture according to an exemplary embodiment of the present application.
FIG. 7 is a schematic block diagram of a computing device, according to an example embodiment of the application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, exemplary embodiments of the present application will be described in further detail below with reference to the accompanying drawings and embodiments. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Fig. 1 is a schematic diagram illustrating an implementation environment in which the present application may be practiced, according to an exemplary embodiment. As shown in fig. 1, the application platform 110 is a micro-service architecture that includes one or more micro-service applications (four micro-service applications are shown in fig. 1 as an example) 111, 112, 113, 114. The application platform 110 further comprises a throttling and fusing means 115 for executing a throttling and/or fusing policy for cross-invocation requests between micro-service applications, in order to avoid that high concurrent invocation requests cause the application platform 110 to crash due to processing capabilities not being affordable. For a service request from a user, the application platform 110 invokes one or more of the micro-service applications 111, 112, 113, 114 to process the service request, and the flow restricting and blowing device 115 employs a blowing policy (including a service degradation policy) to control and manage call requests between the micro-service applications.
In a system of a micro-service architecture, a situation that a called micro-service is not available and the whole system is not available often occurs, which is called a service avalanche effect. In one example, the current limiting and fusing device 115 employs a fusing strategy of: when the application platform 110 invokes one or more micro-service applications to process a service request from a user, the current limiting and blowing device 115 monitors the response time of each micro-service application to the invoke request and determines whether the response time exceeds a predetermined threshold, if the response time does not exceed the predetermined threshold, no action is taken, and if the response time exceeds the predetermined threshold, the invoke request is blown, i.e., the micro-service application does not operate or process for the invoke request, but returns a predetermined default value directly to the initiator of the invoke request. Thus, the whole response time of the service request of the user is not influenced by the slow response time of the micro service application, and the avalanche effect is avoided. In this example, the current limiting and fusing device 115 may also downgrade one or more predetermined micro-services of the application platform 110 if the number of fused call requests exceeds a predetermined number, reducing the overall system processing pressure in anticipation of responding to a timeout micro-service application thereby recovering the response time as soon as possible.
However, sometimes the above-mentioned fusing strategy cannot avoid the avalanche effect in time, because the response timeout of the micro-service application is not always caused by too much processing pressure due to too many call requests to it, and may be caused by other reasons, such as that the overall processing pressure of the system is too great. In such a case, blowing a call request thereto does not fundamentally solve the problem, but may instead delay the time to solve the problem. The inventors of the present application realized that the micro-service application that responded to the timeout can be effectively restored to normal by degrading the predetermined micro-service to relieve the overall processing pressure of the system in such a case.
Thus, in one example, the current limiting and fusing device 115 may employ the following fusing strategy: when a micro-service application is found to have a response time to a call request exceeding a predetermined threshold, instead of directly blowing the call request as in the example described above, the current number of call requests for the micro-service application is further determined, and if the current number of call requests for the micro-service application is not excessive (e.g., does not exceed a predetermined number), the call request for the micro-service application is not blown, but the predetermined micro-service is downgraded to relieve the overall system pressure, thereby allowing the micro-service application with a response time timeout to return to normal as soon as possible.
Fig. 1 and the above description are only exemplary embodiments of an implementation environment in which the present application may be implemented, and it should be understood that many variations exist in the implementation environment suitable for the present application.
The above-mentioned fusing strategy will be specifically described by a description of the method embodiments of the present application with reference to fig. 2-5.
Fig. 2 is a schematic flow chart illustrating a method of controlling requests under an application platform of a micro-service architecture according to an exemplary embodiment of the application. The performer of this example method may be a current limiting and fusing device 115 as shown in fig. 1. As shown in the exemplary embodiment of fig. 2, the method may include the steps of:
S210, judging whether the response time of one or more micro-service applications to the call request exceeds a first preset threshold.
The response time of each micro-service application contained by the application platform to the call request can be monitored and calculated to determine if its response times out. In one example, a first predetermined threshold (e.g., 200 ms) may be set and the monitored and calculated response time is compared to the first predetermined threshold to determine if the response has timed out.
S220, for the micro service application with the response time exceeding the first preset threshold value, judging whether the current request number of the micro service application exceeds the first preset number.
In the embodiment shown in fig. 2, when it is determined in step S210 that a response of a certain micro service application is timed out, instead of directly fusing a call request to the micro service application, the current request number to the micro service application is further determined. This is because if the reason for the response timeout of the micro service application is not due to an excessive number of requests thereto, the response timeout problem of the micro service application cannot be fundamentally solved even if a call request thereto is blown. Accordingly, the current request number of the micro service application is further determined in step S220.
In one example, the first predetermined number may be set as a reference for the determination, for example, the first predetermined number may be set to 60, and if the current request number of the micro service application does not exceed the first predetermined number, it is indicated that the reason for the response timeout is not that the request number is excessive. If the current number of requests exceeds the first predetermined number, it is likely that the cause of the micro-service application response timeout is due to an excessive number of requests.
It will be appreciated that the first predetermined number may be set to a value other than 60, and whatever the value it is set to, should be able to indicate as accurately as possible whether the current number of requests exceeds the value representing whether the reason for the response timeout is an excessive number of requests.
S230, degrading the preset micro-service application of the application platform under the condition that the call request of the micro-service application is not fused for the condition that the current request number does not exceed the first preset number.
As previously described, if the current number of requests does not exceed the first predetermined number, it is indicated that the reason for the response timeout of the micro-service application is not excessive, and then blowing the call request to the micro-service application does not fundamentally solve the problem of the response timeout of the micro-service application. Since another highly likely cause of the micro-service application response timeout is that the overall processing pressure of the application platform is excessive, it is possible to restore the response-delayed micro-service by degrading some micro-services to relieve the overall pressure. Thus, in the embodiment shown in fig. 2, in step S230, for the case where the current number of requests does not exceed the first predetermined number, a service degradation measure is taken without blowing the call request to the micro-service application.
By "service degradation" is meant that the service is actually suspended, i.e. the returned content is empty or old or a preset default value. The micro-service application to which the service degradation is performed is preset, and may be a micro-service application with a relatively peripheral, less important or a plurality of micro-service applications with less importance. In one example, the plurality of micro-service applications have respective degradation priorities, with higher priority execution being performed first when service degradation is performed.
With the embodiment shown in fig. 2, in the case that the reason for the response delay is not judged to be too many, the service degradation is directly performed without waiting until the blown request exceeds a certain number, so that the problem of the response delay of the micro-service application is more rapidly and effectively solved, and the system efficiency and performance are improved.
FIG. 3 is a schematic flow chart of an exemplary embodiment of a process for restarting a micro-service application that may also be included in the method embodiment shown in FIG. 2. As shown in fig. 3, the method of this embodiment may further include the steps of, after step S230 of fig. 2:
S310, judging whether the response time of the micro-service application with the response time exceeding a first preset threshold still exceeds the first preset threshold or not under the condition that the preset micro-service application is degraded for a preset time period.
After degrading the service of the predetermined micro service application, if the reason for the response delay of the micro service application is that the system overall pressure is too high, the response time of the micro service application should be recovered when the system overall pressure is gradually reduced due to the service degradation at a certain time after the service degradation. If not, it indicates that the reason judgment is likely to be wrong, and other measures are needed. Thus, in step S310, after the service is degraded for a predetermined period of time (e.g., 80 ms), the originally response-delayed micro-service application is checked to see if its response time is restored.
S320, sending a request for restarting the micro-service application if the response time still exceeds a first predetermined threshold.
If the response time is not restored, then other measures may be taken to attempt to restore the micro-service application. For example, in step S320, a request to restart the micro service application may be sent. In one example, sending the restart request may include: the micro service application is restarted directly after a predetermined time (e.g., 10 s) after the request is sent. In another example, sending the restart request may include: and sending a restarting request to the operation and maintenance message queue, and restarting the micro-service application after confirmation of an administrator.
If the result of the determination in step S310 is that the response time of the micro service application has been recovered, it indicates that the reason for the response delay is correctly determined, and after the response time of the micro service application is recovered (for example, after a predetermined period of time is recovered), the degraded micro service application may be restarted, that is, provision of the service is started.
FIG. 4 is a schematic flow chart of an exemplary embodiment of a post-fuse degradation process that may also be included with the method embodiment shown in FIG. 2. In the embodiment shown in fig. 2, if it is determined in step S220 that the current number of requests for the micro-service application exceeds the first predetermined number, a post-fusing and post-degrading policy is performed after step S220, and as shown in fig. 4, the post-fusing and post-degrading process may include the steps of:
s410, fusing the call request of the micro-service application under the condition that the current request number exceeds the first preset number.
If a micro-service application responds with a timeout and it is determined that the current number of requests for it exceeds a first predetermined number, it is likely that the cause of the response timeout is that the number of requests is too large to handle it. Thus, in step S410, a call request to the micro service application may be blown to relieve its processing pressure, allowing its response time to recover as soon as possible.
S420, judging whether the fused request number of the micro-service application exceeds a second preset number.
And S430, degrading the preset micro-service application of the application platform in the case that the number of the fused requests exceeds a second preset number.
If the number of requests that the micro-service application has blown has reached a certain number (e.g., exceeded a second predetermined number), but the micro-service application still has not recovered the response time, then this means of blowing the request is not yet sufficient and other means may be required. Thus, in step S430, in the event that it is determined that the number of blown requests of the micro service application exceeds the second predetermined number, a service degradation measure may be taken, that is, degrading the predetermined micro service application or applications, to relieve the overall processing pressure of the system so that the micro service application with the response delay returns to normal as soon as possible.
Thereafter, if the response-delayed micro-service application returns to normal, a request to restart the degraded micro-service application may be sent (e.g., after the micro-service application returns to normal for a predetermined time). Or sending a request to restart the degraded micro-service application if the number of times the degraded micro-service application fails to be invoked exceeds a predetermined number, although the response-delayed micro-service application does not return to normal.
In addition to the fusing (including demoting) policies described above, a throttling policy may be employed that limits the number of cross-call requests between micro-service applications. Fig. 5 is a schematic flow chart of an exemplary embodiment of a current limiting process that may also be included with the method embodiment shown in fig. 2. As shown in fig. 5, the current limiting process may include the steps of:
s510, in response to the request from the first micro service application for the second micro service application, judging whether the number of call requests from the first micro service application to the second micro service application in unit time exceeds a third preset number.
The first micro-service application and the second micro-service application are any two micro-service applications contained in the application platform. In one example, the third predetermined number is set to 2000 per second.
And S520, returning a preset default value to the first micro service application without calling the second micro service application to process the calling request when the service request number exceeds a third preset number.
Through the current limiting measure, burst massive call from a certain micro service application can be effectively prevented, and normal operation of the micro service application is ensured.
According to another aspect of the application, an apparatus for controlling requests in an application platform of a micro-service architecture is also disclosed. Fig. 6 is a schematic block diagram illustrating an apparatus for controlling requests under an application platform of a micro-service architecture according to an exemplary embodiment of the present application, which apparatus 601 may be the current limiting and fusing apparatus 115 as shown in fig. 1. The apparatus 601 is operative to perform the method embodiments described above. As shown in fig. 6, an example apparatus 601 may include:
a first determination module 610 configured to: judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value;
A second determination module 620 configured to: for a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not;
A demotion module 630 configured to: and degrading the preset micro-service application of the application platform without fusing the call request of the micro-service application for the case that the current request number does not exceed the first preset number.
According to the embodiment shown in fig. 6, the first determining module 610 may be further configured to:
determining if the response time of the micro-service application whose response time exceeds a first predetermined threshold still exceeds a first predetermined threshold, if the predetermined micro-service application is downgraded for a predetermined period of time;
Wherein the apparatus 601 may further comprise a restart request module 640 configured to: a request to restart the micro-service application is sent if the response time still exceeds a first predetermined threshold.
According to the embodiment shown in fig. 6, the apparatus 601 may further comprise:
A fusing module 650 configured to: and fusing the call request for the micro-service application in the case that the current request number exceeds the first preset number.
According to the embodiment shown in fig. 6, the apparatus 601 may further comprise:
a third determination module 660 configured to: judging whether the fused request number of the micro-service application exceeds a second preset number;
Wherein the demotion module 630 is further configured to: and degrading the predetermined micro-service application of the application platform in the case that the number of fused requests exceeds a second predetermined number.
According to the embodiment shown in fig. 6, the apparatus 601 may further comprise a current limiting module 670, and the current limiting module 670 may comprise:
a fourth judgment unit 671 configured to: responding to a call request from a first micro-service application to a second micro-service application, judging whether the call request number of the first micro-service application to the second micro-service application exceeds a third preset number in unit time, wherein the first micro-service application and the second micro-service application are any two micro-service applications contained in the application platform;
A current limiting unit 672 configured to: and returning a preset default value to the first micro-service application without calling the second micro-service application to process the calling request under the condition that the calling request number in the unit time exceeds a third preset number.
According to the embodiment shown in fig. 6, the restart request module 640 is further configured to:
In the event that the number of times the predetermined micro-service application that was downgraded is invoked exceeds a fourth predetermined number, a request to restart the predetermined micro-service application that was downgraded is sent.
The implementation process of the functions and roles of each unit/module in the above apparatus and the relevant details are specifically detailed in the implementation process of the corresponding steps in the above method embodiment, which are not repeated herein.
The apparatus embodiments in the above embodiments may be implemented by hardware, software, firmware, or a combination thereof, and may be implemented as a single apparatus, or as a logic integrated system where constituent units/modules are dispersed in one or more computing devices and perform corresponding functions, respectively.
The units/modules constituting the apparatus in the above embodiments are divided according to logic functions, they may be re-divided according to logic functions, and the apparatus may be implemented by more or fewer units/modules, for example. These constituent units/modules may be implemented by hardware, software, firmware or a combination thereof, and they may be separate independent components or may be integrated units/modules where a plurality of components are combined to perform corresponding logic functions. The means for hardware, software, firmware, or a combination thereof may include: separate hardware components, functional modules implemented by programming, functional modules implemented by programmable logic devices, or the like, or a combination thereof.
According to an exemplary embodiment, the apparatus may be implemented as a computing device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the computing device to perform any one of the method embodiments described above, or which, when executed by the processor, causes the computing device to perform the functions performed by the constituent elements/modules of the apparatus embodiments described above.
The processors described in the above embodiments may refer to a single processing unit, such as a central processing unit CPU, or may be distributed processor systems including a plurality of discrete processing units/processors.
The memory described in the above embodiments may include one or more memories, which may be internal memory of the computing device, such as various memories, transient or non-transient, or external storage connected to the computing device through a memory interface.
Fig. 7 illustrates a schematic block diagram of one exemplary embodiment of such a computing device 701. As shown in fig. 7, a computing device 701 may include: processor 710, communication interface 720, memory 730, and bus 740. Memory 730 stores computer programs executable by processor 710. The functions of the methods and apparatuses in the above-described embodiments are implemented by the processor 710 when executing the computer program. The number of memories 730 and processors 710 may each be one or more. Communication interface 720 is used for communication between processor 710 and external devices.
The processor 710 may be a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various exemplary flow steps, functional units/modules and/or circuits described in connection with this disclosure. The processor may also be a combination that implements computing functionality, such as a combination comprising one or more microprocessors, digital signal processors, or the like.
Memory 730 may include volatile memory and/or nonvolatile memory such as nonvolatile dynamic random access memory, phase change random access memory, magnetoresistive random access memory, magnetic disk memory, electrically erasable programmable read only memory, flash memory devices, semiconductor devices (e.g., solid state disks), and the like. Memory 730 may also optionally be an external remote storage device.
The bus 740 may be an industry standard architecture (ISA, industry Standard Architecture) bus, a peripheral component interconnect (PCI, PERIPHERAL COMPONENT) bus, or an extended industry standard architecture (EISA, extended Industry Standard Component) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus. Alternatively, if the memory 730, the processor 710, and the communication interface 720 are integrated on a single chip, the memory 730, the processor 710, and the communication interface 720 may communicate with each other through internal interfaces.
The above method and apparatus embodiments may also be implemented in the form of a computer program, stored on a storage medium, and distributed. Thus, according to another aspect of the present disclosure, there is also provided a computer program product stored on a computer readable storage medium and which when executed by a processor implements any of the method and apparatus embodiments described above. According to yet another aspect of the present disclosure, there is also provided a computer readable storage medium having stored thereon a computer program executable by a processor, which when executed by the processor, implements any of the method and apparatus embodiments described above.
The computer readable storage medium may be any tangible device that can hold and store instructions that can be used by an instruction execution device. For example, it may be, but is not limited to being, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the storage medium include: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing.
The computer program/computer instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
The computer program instructions described in this disclosure may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as SMALLTALK, C ++ or the like and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. It will be apparent to those skilled in the art that the above embodiments may be used alone or in combination with one another as desired. In addition, for the device embodiment, since it corresponds to the method embodiment, description is relatively simple, and reference should be made to the description of the corresponding part of the method embodiment for relevant points.
The foregoing examples illustrate only a few embodiments of the invention and are described in detail herein without thereby limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.

Claims (10)

1. A method of controlling requests in an application platform of a micro-service architecture, the application platform invoking one or more micro-service applications to process business requests from users, the method comprising:
Judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value;
For a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not;
Degrading a predetermined micro-service application of the application platform without blowing a call request to the micro-service application for the case that the current number of requests does not exceed a first predetermined number; the predefined micro-service application downgrade means that this service is actually suspended, i.e. the returned content is empty or old or a preset default value.
2. The method as recited in claim 1, further comprising:
determining if the response time of the micro-service application whose response time exceeds a first predetermined threshold still exceeds a first predetermined threshold, if the predetermined micro-service application is downgraded for a predetermined period of time;
a request to restart the micro-service application is sent if the response time still exceeds a first predetermined threshold.
3. The method as recited in claim 1, further comprising:
And fusing the call request for the micro-service application in the case that the current request number exceeds the first preset number.
4. A method as recited in claim 3, further comprising:
Judging whether the fused request number of the micro-service application exceeds a second preset number;
and degrading the predetermined micro-service application of the application platform in the case that the number of fused requests exceeds a second predetermined number.
5. The method of any one of claims 1-4, further comprising:
responding to a call request from a first micro-service application to a second micro-service application, judging whether the call request number of the first micro-service application to the second micro-service application exceeds a third preset number in unit time, wherein the first micro-service application and the second micro-service application are any two micro-service applications contained in the application platform;
And returning a preset default value to the first micro-service application without calling the second micro-service application to process the calling request under the condition that the calling request number in the unit time exceeds a third preset number.
6. The method of claim 1 or 4, further comprising:
In the event that the number of times the predetermined micro-service application that was downgraded is invoked exceeds a fourth predetermined number, a request to restart the predetermined micro-service application that was downgraded is sent.
7. An apparatus for controlling requests in an application platform of a micro-service architecture, the application platform invoking one or more micro-service applications to process business requests from users, the apparatus comprising:
A first determination module configured to: judging whether the response time of the one or more micro-service applications to the call request exceeds a first preset threshold value;
A second determination module configured to: for a micro-service application of which the response time exceeds a first preset threshold value in the one or more micro-service applications, judging whether the current request number of the micro-service application exceeds a first preset number or not;
A downgrade module configured to: degrading a predetermined micro-service application of the application platform without blowing a call request to the micro-service application for the case that the current number of requests does not exceed a first predetermined number; the predefined micro-service application downgrade means that this service is actually suspended, i.e. the returned content is empty or old or a preset default value.
8. The apparatus of claim 7, wherein the first determination module is further configured to:
determining if the response time of the micro-service application whose response time exceeds a first predetermined threshold still exceeds a first predetermined threshold, if the predetermined micro-service application is downgraded for a predetermined period of time;
Wherein the apparatus further comprises a restart request module configured to: a request to restart the micro-service application is sent if the response time still exceeds a first predetermined threshold.
9. A computing device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the computing device to perform the method of any of claims 1-6.
10. A computer readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements the method of any of claims 1 to 6.
CN201811554548.5A 2018-12-18 2018-12-18 Method, apparatus and storage medium for controlling requests under micro-service architecture Active CN109684105B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811554548.5A CN109684105B (en) 2018-12-18 2018-12-18 Method, apparatus and storage medium for controlling requests under micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811554548.5A CN109684105B (en) 2018-12-18 2018-12-18 Method, apparatus and storage medium for controlling requests under micro-service architecture

Publications (2)

Publication Number Publication Date
CN109684105A CN109684105A (en) 2019-04-26
CN109684105B true CN109684105B (en) 2024-08-02

Family

ID=66186207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811554548.5A Active CN109684105B (en) 2018-12-18 2018-12-18 Method, apparatus and storage medium for controlling requests under micro-service architecture

Country Status (1)

Country Link
CN (1) CN109684105B (en)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535901A (en) * 2019-07-05 2019-12-03 中国平安财产保险股份有限公司 Service degradation method, apparatus, computer equipment and storage medium
CN110505155B (en) * 2019-08-13 2023-12-08 北京达佳互联信息技术有限公司 Request degradation processing method and device, electronic equipment and storage medium
CN110673962B (en) * 2019-08-27 2024-06-14 腾讯科技(深圳)有限公司 Content stream processing method, device, equipment and medium
CN112448987B (en) * 2019-08-29 2024-06-21 北京京东尚科信息技术有限公司 Fuse degradation triggering method, system and storage medium
CN110661815A (en) * 2019-10-22 2020-01-07 中国林业科学研究院热带林业研究所 Request processing method, device, system and medium based on frequency limitation microservice
CN110837431A (en) * 2019-11-13 2020-02-25 深圳前海环融联易信息科技服务有限公司 Service control method, service control device, computer equipment and computer-readable storage medium
CN110995472A (en) * 2019-11-15 2020-04-10 苏州浪潮智能科技有限公司 Method and system for fusing micro-service
CN111078468A (en) * 2019-11-21 2020-04-28 贝壳技术有限公司 Service rollback method and device under micro-service architecture
CN111130939B (en) * 2019-12-26 2021-09-10 深圳前海环融联易信息科技服务有限公司 Flow control method and device, computer equipment and storage medium
CN111324471B (en) * 2020-01-22 2023-07-21 远景智能国际私人投资有限公司 Service adjustment method, device, equipment and storage medium
CN111381951B (en) * 2020-03-06 2023-06-30 北京思特奇信息技术股份有限公司 Dirty data processing method, device and storage medium in system architecture
CN111510480B (en) * 2020-04-08 2022-09-13 北京百度网讯科技有限公司 Request sending method and device and first server
CN113783822B (en) * 2020-06-03 2023-05-30 北京沃东天骏信息技术有限公司 Service timeout management method and device, electronic equipment and readable medium
CN111787073B (en) * 2020-06-18 2023-08-22 庞茂林 Current limiting fusing platform for unified service and method thereof
CN112367268B (en) * 2020-11-24 2022-07-05 苏宁云计算有限公司 Current limiting method and device for micro-service
CN112449017B (en) * 2020-11-25 2023-08-18 深圳市欢太科技有限公司 Service end and control method thereof
CN112636971B (en) * 2020-12-21 2023-01-10 北京字跳网络技术有限公司 Service degradation 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
CN113159845B (en) * 2021-04-21 2022-09-27 杭州网易云音乐科技有限公司 Data processing method, device, equipment and medium
CN113485917B (en) * 2021-06-25 2024-06-11 上海豹云网络信息服务有限公司 Interface management method and device, electronic equipment and storage medium
CN114006871A (en) * 2021-10-25 2022-02-01 北京有竹居网络技术有限公司 Flow control method, flow control device, container and storage medium
CN114710406B (en) * 2022-04-24 2023-09-26 中国工商银行股份有限公司 Method, device, electronic equipment and medium for dynamically determining timeout threshold
CN115118769B (en) * 2022-06-28 2024-02-02 深圳前海微众银行股份有限公司 Method and device for configuring parameters of service system and executing micro-service
CN115129490A (en) * 2022-06-30 2022-09-30 中电金信软件有限公司 Micro-service calling method and device and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592219A (en) * 2017-09-04 2018-01-16 北京潘达互娱科技有限公司 Service degradation processing method and processing device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device

Also Published As

Publication number Publication date
CN109684105A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN109684105B (en) Method, apparatus and storage medium for controlling requests under micro-service architecture
US8499202B2 (en) Method and system for recovery of a computing environment during pre-boot and runtime phases
CN105426271A (en) Lock management method and device for distributed storage system
KR20100110823A (en) Isolation of content by processes in an application
CN111338628B (en) Component rendering method and device
CN111538585A (en) Js-based server process scheduling method, system and device
US11354107B2 (en) Communicating a data image for installing an operating system
CN107465756B (en) Service request processing method and device
CN115514767B (en) Switching method of data transmission, terminal equipment and computer readable storage medium
CN115061962B (en) Method, system, storage medium and equipment for managing peripheral transmission rate
CN113946376B (en) Load adjustment method and device, electronic equipment and storage medium
CN115658368A (en) Fault processing method and device, storage medium and electronic equipment
CN116931814A (en) Cloud hard disk capacity expansion method and device, electronic equipment and storage medium
CN114374657A (en) Data processing method and device
US11089123B2 (en) Service worker push violation enforcement
CN109510867B (en) Data request processing method and device, storage medium and electronic equipment
US10489239B2 (en) Multiplexing system, multiplexing method, and computer program product
CN112994949A (en) Private network connection method, device, equipment and storage medium
US9009546B2 (en) Heuristic failure prevention in software as a service (SAAS) systems
KR102567541B1 (en) Edge service instance distribution apparatus and control method thereof
CN107783855B (en) Fault self-healing control device and method for virtual network element
CN114338357B (en) Method and device for transmitting data message in network
WO2022185626A1 (en) Monitoring system
CN115484162B (en) Component adaptation method, device, server side and storage medium of software system
CN114650283A (en) Method and device for dynamically switching cloud storage service, electronic 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