Current limiting method, device, electronic equipment and computer program product
By building forward and reverse transfer functions of the business interface, using frequency domain analysis methods to dynamically adjust the number of interface requests, the problem of poor current limiting algorithms in high concurrency or large traffic requests is solved, and a more accurate and stable current limiting effect is achieved.
Patent Information
- Application Number
- CN202411906611.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
AI Technical Summary
When existing current limiting algorithms face high concurrency or large traffic requests, they are prone to poor current limiting effects, inability to respond in time or excessively, resulting in threatening system stability.
By monitoring the input and output signals of the service interface, forward and reverse transfer functions are constructed, and the frequency domain analysis method of classical control theory is used to dynamically judge the interface performance, and reduce the number of interface service requests when the response frequency is lower than the preset threshold.
It achieves more accurate current limiting effect, improves the current limiting capability of the service interface, and avoids stability problems caused by excessive or underresponse of the system.
Smart Images

Figure CN119788612A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of the Internet, and in particular to a current limiting method, device, electronic equipment and computer program product. Background Art
[0002] When Internet applications are deployed online, due to the limitation of system resources, there is an upper limit on the transaction requests that can be processed at the same time. When faced with some unexpected high-concurrency or high-traffic request business scenarios, the system is often prone to causing the entire service function to crash due to exceeding its business processing capacity. In this scenario, the current limiting basis can limit the access of new requests to the system, reject some requests in time, and ensure the stable operation of the system as the top priority.
[0003] However, common mainstream current limiting algorithms, whether time window algorithm, improved sliding window algorithm, leaky bucket algorithm, token algorithm, etc., all control the ability of the application to process the number of requests based on the time domain response. The above current limiting solutions for time domain response either have the hidden danger of not being able to limit the current in time, or fail to match the application performance in time, resulting in over-response, thus resulting in poor current limiting effect.
[0004] The above-mentioned current limiting scheme for time domain response has the problem of poor current limiting effect, and no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a current limiting method, device, electronic device and computer program product to at least solve the technical problem that the current limiting solution for time domain response has poor current limiting effect.
[0006] According to one aspect of an embodiment of the present invention, a current limiting method is provided, comprising: monitoring the response of a service interface to an interface service request, obtaining an input signal and an output signal of the service interface, wherein the service interface is used to generate a corresponding response result in response to the interface service request, the input signal is at least used to represent the input quantity of the interface service request, the output signal is at least used to represent the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time of generating the response quantity of the response results, and the single response time of generating each of the response results; determining a forward transfer function of the service interface in a forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; performing a Laplace transform on a preset response time function to obtain a reverse transfer function of the service interface in a reverse link, wherein The preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain, in which the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant; using the forward transfer function and the reverse transfer function, a response transfer function is determined, and based on the response transfer function, a response frequency of the service interface is determined, wherein the response transfer function is used to represent the functional relationship between the response frequency and a preset gain, and the preset gain includes: the forward gain and the time gain; when the response frequency is lower than a preset frequency threshold, the number of responses of the service interface to the interface service request is reduced.
[0007] Optionally, determining the forward transfer function of the service interface in the forward link according to the input signal and the output signal includes: determining a ratio of the output signal to the input signal as the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
[0008] Optionally, monitoring the response of the service interface to the interface service request and obtaining the input signal and output signal of the service interface includes: monitoring the input time of each interface service request input into the service interface to obtain a first time domain signal, wherein in the first time domain signal, the number of interface service requests is the input number; monitoring the response time of the service interface generating the response result in response to each interface service request to obtain a second time domain signal, wherein in the first time domain signal, the number of response results is the response number; performing Laplace transform on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal, and a second frequency domain signal corresponding to the second time domain signal; using the first frequency domain signal as the input signal and the second frequency domain signal as the output signal.
[0009] Optionally, performing Laplace transform on the preset response time function to obtain the reverse transfer function of the service interface in the reverse link includes: obtaining the preset response time function, wherein the preset response time function is: t(n) represents the total response time, n represents the input quantity, i represents the interface service request, i(n) represents the single response time, C represents the preset time constant; performing Laplace transform on the preset response time function to obtain the reverse transfer function, wherein the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time lengths, and Cs represents the time gain obtained by Laplace transforming the time constant.
[0010] Optionally, using the forward transfer function and the reverse transfer function to determine a response transfer function, and determining the response frequency of the service interface according to the response transfer function includes: acquiring the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; obtaining the reverse transfer function, wherein the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant; the forward transfer function and the reverse transfer function are combined to obtain the response transfer function, and the response frequency of the service interface is determined according to the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
[0011] Optionally, the method also includes: obtaining pending requests, wherein the pending requests are the interface business requests that have not made the business interface call; starting the filter to respond to the pending requests and detecting the switch state of the current limiting switch; when the switch state is in the closed state, sending the pending request to the business interface; when the switch state is in the open state, reducing the number of interface business requests sent to the business interface.
[0012] Optionally, when the response frequency is lower than a preset frequency threshold, before reducing the number of responses of the service interface to the interface service request, the method includes: configuring the preset frequency threshold according to the preset time constant and the forward gain, wherein the preset frequency threshold is: K is the forward gain, and C is the preset time constant.
[0013] According to another aspect of an embodiment of the present invention, a current limiting device is also provided, comprising: a monitoring module, used to monitor the response of the service interface to the interface service request, and obtain the input signal and output signal of the service interface, wherein the service interface is used to generate a corresponding response result in response to the interface service request, the input signal is at least used to represent the input quantity of the interface service request, and the output signal is at least used to represent the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time of generating the response quantity of the response results, and the single response time of generating each of the response results; a first determination module, used to determine the forward transfer function of the service interface in the forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; a transformation module, used to perform Laplace transformation on the preset response time function to obtain the reverse transfer function of the service interface in the reverse link A number, wherein the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain, in which the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant; a second determination module, used to use the forward transfer function and the reverse transfer function to determine the response transfer function, and determine the response frequency of the service interface based on the response transfer function, wherein the response transfer function is used to represent the functional relationship between the response frequency and a preset gain, and the preset gain includes: the forward gain and the time gain; a current limiting module, used to reduce the number of responses of the service interface to the interface service request when the response frequency is lower than a preset frequency threshold.
[0014] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above current limiting method through the computer program.
[0015] According to another aspect of an embodiment of the present invention, a computer program product is further provided, comprising computer instructions, wherein the computer instructions implement the steps of the above current limiting method when executed by a processor.
[0016] In an embodiment of the present invention, based on the classical control theory in automatic control theory, the forward transfer function of the business interface in the forward link and the reverse transfer function of the reverse link can be constructed according to the response of the business interface to the interface business request, and the response transfer function can be further determined. Then, according to the response transfer function, the frequency domain analysis can be performed using the automatic control principle, thereby achieving the purpose of current limiting according to the response of the business interface and the results of the frequency domain analysis. Since frequency domain analysis can not only study the steady-state performance of the system, but also be used to study the stability and transient performance of the system, current limiting the business interface according to the results of the frequency domain analysis can obtain a more accurate current limiting effect, thereby achieving the technical effect of improving the current limiting effect of the business interface, and solving the technical problem of poor current limiting effect in the current limiting scheme for time domain response. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a flow chart of a current limiting method according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of a current limiting solution based on classical control theory according to an embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of overall system time abstraction according to an embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a current limiting device according to an embodiment of the present invention;
[0022] Figure 5 It is a structural block diagram of a computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0026] Current limiting: refers to flow control, that is, controlling the speed at which a network interface sends and receives requests, thereby ensuring that network applications can safely handle specific scenarios.
[0027] According to an embodiment of the present invention, an embodiment of a current limiting method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of a current limiting method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0029] Step S102, monitoring the response of the service interface to the interface service request, and obtaining an input signal and an output signal of the service interface, wherein the service interface is used to respond to the interface service request and generate a corresponding response result, the input signal is used to at least indicate the input quantity of the interface service request, and the output signal is used to at least indicate the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time for generating the response quantity of the response result, and the single response time for generating each response result;
[0030] Step S103, determining a forward transfer function of the service interface in a forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent a forward gain between the output signal and the input signal;
[0031] Step S104, performing Laplace transform on the preset response time function to obtain a reverse transfer function of the service interface in the reverse link, wherein the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain, in which the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant;
[0032] Step S105, using the forward transfer function and the reverse transfer function, determining a response transfer function, and determining a response frequency of the service interface according to the response transfer function, wherein the response transfer function is used to represent a functional relationship between the response frequency and a preset gain, and the preset gain includes: a forward gain and a time gain;
[0033] Step S106: when the response frequency is lower than the preset frequency threshold, reduce the number of service interface responses to interface service requests.
[0034] In an embodiment of the present invention, based on the classical control theory in automatic control theory, the forward transfer function of the business interface in the forward link and the reverse transfer function of the reverse link can be constructed according to the response of the business interface to the interface business request, and the response transfer function can be further determined. Then, according to the response transfer function, the frequency domain analysis can be performed using the automatic control principle, thereby achieving the purpose of current limiting according to the response of the business interface and the results of the frequency domain analysis. Since frequency domain analysis can not only study the steady-state performance of the system, but also be used to study the stability and transient performance of the system, current limiting the business interface according to the results of the frequency domain analysis can obtain a more accurate current limiting effect, thereby achieving the technical effect of improving the current limiting effect of the business interface, and solving the technical problem of poor current limiting effect in the current limiting scheme for time domain response.
[0035] In the above step S102, there may be one or more business interfaces, each of which is an external interface of a computing device with business processing capability, and the computing device may be a computer or a server.
[0036] In the above step S102, the interface business request can request to call the business interface to process the business data carried in the interface business request, wherein the process of calling the business interface is to send an interface business request to the business interface, and then the computing device providing the business interface can obtain the business data carried in the interface business request and perform calculation processing.
[0037] In the above step S102, the response result is the content returned by the business interface after the interface business request is sent to the business interface.
[0038] In the above step S102, the response status represents the input number of interface business requests input into the business interface, the input time of each interface business request input into the business interface, the response result generated by the business interface in response to each interface business request, the response number of the response results generated by the business interface, and the response time for generating each response result. Then, based on the time difference between the input time of the interface business request and the response time of generating the response result corresponding to the interface business request, the single response duration of each interface business request can be determined; based on the time difference between the input time of the interface business request that is first input into the business interface and the response time when the business interface finally outputs the response result, the total response duration can be determined.
[0039] In the above step S102, the input signal represents the situation of the interface service request input to the service interface; the output signal represents the situation of the service interface generating a response result in response to the interface service request.
[0040] In the above step S103, the forward link is the direct path from the input signal to the system output in the control system. In this link, the input signal undergoes a series of processing and transformations to finally generate the system output.
[0041] In the above step S103, the forward transfer function of the forward link describes the dynamic relationship between the system input and output. Mathematically, the transfer function of the forward link can usually be expressed as the ratio of the Laplace transform of the system output to the Laplace transform of the system input.
[0042] In the above step S104, the reverse link is the part of the control system that feeds back the system output to the input end. The function of this link is to obtain the output information of the system and send it back to the input end as a feedback signal to adjust and control the output of the system.
[0043] In the above step S104, the reverse transfer function of the reverse link also describes the dynamic relationship between the input and output of the system, but it focuses on the dynamic characteristics on the feedback path.
[0044] In the above embodiments of the present application, the forward link and the reverse link are important parts of the closed-loop control system, and the transfer function is a mathematical model that describes the dynamic characteristics of these links and the system as a whole. By analyzing and designing these links and transfer functions, precise control and optimization of the control system can be achieved.
[0045] In the above step S104, the total response time is the response result of the business interface to the input number of interface business requests. The total response time can be determined by the difference between the input time of the earliest interface business request input into the business interface and the response time of the last response result output by the business interface. It can be determined by accumulating the single response times of multiple interface business requests that meet the input number. The total response time can use a preset response time function and be expressed by the integral of multiple single response times. Then, the difference between the total response time and the integral of multiple single response times can be corrected by a preset time constant.
[0046] In the above step S104, Laplace transform is an integral transform tool for converting a time domain function into a frequency domain function, wherein in the time domain, a signal is a function that varies with time, and in the frequency domain, a signal is decomposed into different frequency components.
[0047] In the above step S104, the total response time in the preset response time function is subjected to Laplace transformation to obtain the output signal in the reverse transfer function; the integral of multiple single response time in the preset response time function is subjected to Laplace transformation to obtain the input signal in the reverse transfer function; the preset time constant in the preset response time function is subjected to Laplace transformation to obtain the time gain, thereby achieving the purpose of determining the reverse transfer function according to the preset response time function.
[0048] In the above step S106, when the response frequency is lower than the preset frequency threshold, it can be instructed to turn on the current limiting switch. After the current limiting switch is turned on, the number of service interface responses to interface service requests can be reduced, that is, the number of interface service requests input to the service interface is reduced.
[0049] As an optional embodiment, determining the forward transfer function of the service interface in the forward link according to the input signal and the output signal includes: determining the ratio of the output signal to the input signal as the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
[0050] In the above-mentioned embodiment of the present application, the forward transfer function of the forward link is the ratio of the output signal of the business interface to the output signal of the business interface, and this ratio is the forward gain determined by the forward link, thereby realizing the determination of the forward transfer function and the forward gain.
[0051] As an optional embodiment, monitoring the response of the service interface to the interface service request and obtaining the input signal and output signal of the service interface includes: monitoring the input time of each interface service request of the input service interface to obtain a first time domain signal, wherein, in the first time domain signal, the number of interface service requests is the input number; monitoring the response time of the service interface to generate a response result in response to each interface service request to obtain a second time domain signal, wherein, in the first time domain signal, the number of response results is the response number; performing Laplace transform on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal, and a second frequency domain signal corresponding to the second time domain signal; using the first frequency domain signal as the input signal and the second frequency domain signal as the output signal.
[0052] In the above-mentioned embodiment of the present application, by monitoring the response of the service interface to the interface service request, an input signal and an output signal represented based on time domain characteristics, i.e., a first time domain signal and a second time domain signal, can be obtained. Then, by performing Laplace transform on the first time domain signal and the second time domain signal, an input signal and an output signal represented based on frequency domain characteristics, i.e., a first frequency domain signal and a second frequency domain signal, can be obtained. Then, the forward transfer function is the ratio of the second frequency domain signal to the first frequency domain signal.
[0053] As an optional embodiment, performing Laplace transform on the preset response time function to obtain the reverse transfer function of the service interface in the reverse link includes: obtaining the preset response time function, wherein the preset response time function is: t(n) Indicates the total response time, n indicates the number of inputs, i indicates the interface service request, i(n) represents the single response time, C represents the preset time constant; the preset response time function is Laplace transformed to obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant.
[0054] In the above-mentioned embodiment of the present application, the preset response time function uses the inverse of the preset time constant to correct the integral of the single response time of multiple interface service requests to express the relationship between the single response time and the total response time of multiple interface service requests. By performing Laplace transform on the preset response time function, the reverse transfer function of the reverse link can be obtained to realize the determination of the reverse transfer function.
[0055] As an optional embodiment, using the forward transfer function and the reverse transfer function to determine the response transfer function, and determining the response frequency of the service interface according to the response transfer function includes: obtaining the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant; the forward transfer function and the reverse transfer function are combined to obtain the response transfer function, and the response frequency of the business interface is determined based on the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
[0056] In the above-mentioned embodiment of the present application, the forward transfer function and the reverse transfer function are combined to obtain a response transfer function, and then based on the response transfer function, a response frequency that can represent the service interface to the interface service request can be obtained, thereby realizing the determination of the response frequency.
[0057] As an optional embodiment, the method also includes: obtaining pending requests, wherein the pending requests are interface business requests that have not made business interface calls; starting a filter to respond to the pending requests and detecting the switch state of a current limiting switch; when the switch state is off, sending the pending requests to the business interface; and when the switch state is on, reducing the number of interface business requests sent to the business interface.
[0058] In the above-mentioned embodiments of the present application, the current limiting of the business interface can be controlled by a filter. When the pending request needs to call the business interface, the pending request input into the business interface can be filtered by the filter, and the switch state of the current limiting switch can be detected. Then, when the current limiting switch is in the closed state, any pending request can be input into the business interface through the filter for calling; when the current limiting switch is in the open state, the filter can be used to filter the pending request input into the business interface to reduce the number of interface business requests sent to the business interface.
[0059] Optionally, using the filter to filter the pending requests input to the business interface includes: allowing pending requests of a specific type to be input to the business interface through the filter; and returning pending requests that do not belong to the specific type to the initiator of the pending requests.
[0060] As an optional embodiment, when the response frequency is lower than a preset frequency threshold, before reducing the number of service interface responses to interface service requests, the method includes: configuring a preset frequency threshold according to a preset time constant and a forward gain, wherein the preset frequency threshold is: K is the forward gain and C is the preset time constant.
[0061] The above-mentioned embodiments of the present application can configure the preset frequency threshold according to the preset time constant and forward gain.
[0062] The present invention also provides a preferred embodiment, which provides a current limiting solution based on classical control theory. By real-time sampling of the response time of the interface request and analyzing it using the frequency domain analysis method of the automatic control principle, it is dynamically determined whether the interface performance meets expectations. When the interface performance is lower than expected, the current limiting function is triggered in time, thereby realizing application current limiting from the frequency domain response aspect, solving the problems of over-response and under-response in the mainstream current limiting scheme, maximizing the performance of the system, eliminating the waste of machine resources caused by unnecessary expansion, and ensuring the normal operation of business functions.
[0063] It should be noted that the technical solution provided by this application supports multiple deployment schemes. It can be used as a flow-limiting function for a single system or a single application node, which can be implemented by designing filters or interceptors in the application code; it can also be implemented by deploying a single or multiple computing nodes with relevant algorithms on various virtual containers or physical machines as a unified flow-limiting function platform, and the main function implementation does not rely on data persistence capabilities. The above usage schemes can effectively support flow-limiting functions in different scenarios such as network gateway entrances, public resource middleware, and high-concurrency middle-end applications.
[0064] Figure 2 is a schematic diagram of a current limiting solution based on classical control theory according to an embodiment of the present invention, such as Figure 2 As shown, the steps include:
[0065] Step S201 uses the filter mode design to count the start time of each request processed by the interface based on the system request log without intruding the business.
[0066] Step S202, check whether the current limiting switch of the interface is triggered to be turned on, and if it is turned on, directly execute the rejection strategy to reject the requested service processing requirement.
[0067] Step S203: normal business processing. In this process, there is no need to consider the flow-limiting business, and there is no impact on normal business.
[0068] Step S204 is the core step of current limiting control. After normal business processing, the filter counts the business processing time of the business interface in an asynchronous manner, and returns the business processing result to the caller normally.
[0069] Figure 3 is a schematic diagram of a system overall time abstraction according to an embodiment of the present invention, such as Figure 3 As shown in the figure, given that the total response time of a general application system is proportional to the number of calls, its open-loop response function is a proportional function of a forward link: Considering that the total response time T of the interface is the sum of the time consumed for each call, the reverse link can be designed as a The first differential function of can be obtained on the feedback link after Laplace transformation: The integral link, where C is a configurable time constant, is used to control the damping of the trigger response of the current limit. Therefore, its forward link and reverse link control closed loop form a first-order inertial joint, and its transfer function G(s) after Laplace transformation is:
[0070] Optionally, the transfer function cutoff frequency is the response frequency controlled by the current limiting scheme. When the response frequency is reached, the current limiting scheme is triggered; the response frequency is The interface can reach the desired response frequency by dynamically configuring the value of C. Thus, when the interface concurrency is too high and reaches the performance limit, the current limiting solution can automatically trigger the current limiting function.
[0071] Optionally, when r(t) = 1(t) (unit pulse, simulating a traffic surge scenario), but (Lassen inverse transform), from which we can see that h(0)=0,h(∞)=1, It can be seen that the first-order inertia link can track the step signal without static difference, and when the time period reaches 3T, the engineering requirement is close to the steady state to reach 95% of the target value. Because the time constant T = 1 / KC, the response sensitivity of the current limiting strategy and the time required to reach the steady state can still be controlled by adjusting the values of K and C.
[0072] Step S205, judging whether to turn on / off the current limiting switch according to the interface frequency response result calculated by the above module, so as to realize the main function of current limiting.
[0073] Optionally, the above algorithm can also add more conditional links (such as differential links and proportional links), use PID method to change the response sensitivity of interface current limiting, etc., and dynamically adjust the current limiting function parameters.
[0074] The above-mentioned embodiments of the present application adopt the frequency domain analysis method of classical control theory, break away from the strategy of current limiting control based on time domain analysis, dynamically realize the interface current limiting function, have good response speed and precise control capability, and can filter out scenarios where occasional data appears, thereby achieving more precise current limiting control capability.
[0075] According to an embodiment of the present invention, a current limiting device embodiment is also provided. It should be noted that the current limiting device can be used to execute the current limiting method in the embodiment of the present invention, and the current limiting method in the embodiment of the present invention can be executed in the current limiting device.
[0076] Figure 4 is a schematic diagram of a current limiting device according to an embodiment of the present invention. Figure 4 As shown, the device may include: a monitoring module 42, which is used to monitor the response of the business interface to the interface business request, and obtain the input signal and output signal of the business interface, wherein the business interface is used to respond to the interface business request and generate a corresponding response result, the input signal is at least used to represent the input quantity of the interface business request, and the output signal is at least used to represent the response quantity of the business interface in response to the input quantity of the interface business request to generate the response result, the total response time of the response result of the response quantity, and the single response time of each response result; a first determination module 43, which is used to determine the forward transfer function of the business interface in the forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; a transformation module 44, which is used to perform Laplace transformation on the preset response time function to obtain the reverse transfer function of the business interface in the reverse link, wherein In the embodiment, the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain. In the reverse transfer function, the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant; the second determination module 45 is used to use the forward transfer function and the reverse transfer function to determine the response transfer function, and determine the response frequency of the service interface based on the response transfer function, wherein the response transfer function is used to represent the functional relationship between the response frequency and the preset gain, and the preset gain includes: forward gain and time gain; the current limiting module 46 is used to reduce the number of service interface responses to interface service requests when the response frequency is lower than the preset frequency threshold.
[0077] It should be noted that the monitoring module 42 in this embodiment can be used to execute step S102 in the embodiment of the present application, the first determination module 43 in this embodiment can be used to execute step S103 in the embodiment of the present application, the transformation module 44 in this embodiment can be used to execute step S104 in the embodiment of the present application, the second determination module 45 in this embodiment can be used to execute step S105 in the embodiment of the present application, and the current limiting module 46 in this embodiment can be used to execute step S106 in the embodiment of the present application. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.
[0078] In an embodiment of the present invention, based on the classical control theory in automatic control theory, the forward transfer function of the business interface in the forward link and the reverse transfer function of the reverse link can be constructed according to the response of the business interface to the interface business request, and the response transfer function can be further determined. Then, according to the response transfer function, the frequency domain analysis can be performed using the automatic control principle, thereby achieving the purpose of current limiting according to the response of the business interface and the results of the frequency domain analysis. Since frequency domain analysis can not only study the steady-state performance of the system, but also be used to study the stability and transient performance of the system, current limiting the business interface according to the results of the frequency domain analysis can obtain a more accurate current limiting effect, thereby achieving the technical effect of improving the current limiting effect of the business interface, and solving the technical problem of poor current limiting effect in the current limiting scheme for time domain response.
[0079] As an optional embodiment, the first determination module includes: a first determination unit, configured to determine a ratio of an output signal to an input signal as a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
[0080] As an optional embodiment, the monitoring module includes: a first monitoring unit, used to monitor the input time of each interface service request of the input service interface to obtain a first time domain signal, wherein, in the first time domain signal, the number of interface service requests is the input number; a second monitoring unit, used to monitor the response time of the service interface to generate a response result in response to each interface service request to obtain a second time domain signal, wherein, in the first time domain signal, the number of response results is the response number; a first transformation unit, used to perform Laplace transformation on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal, and a second frequency domain signal corresponding to the second time domain signal; a second determination unit, used to use the first frequency domain signal as an input signal and the second frequency domain signal as an output signal.
[0081] As an optional embodiment, the transformation module includes: a first acquisition unit, configured to acquire a preset response time function, wherein the preset response time function is: t(n) Indicates the total response time, n indicates the number of inputs, i indicates the interface service request, i(n) represents a single response time, C represents a preset time constant; a second transformation unit is used to perform Laplace transformation on the preset response time function to obtain a reverse transfer function, wherein the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant.
[0082] As an optional embodiment, the determination module includes: a second acquisition unit, configured to acquire a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; a third acquisition unit is used to acquire the reverse transfer function, wherein the reverse transfer function is: T(s) represents an output signal obtained by Laplace transforming the total response time, I(s) represents an input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents a time gain obtained by Laplace transforming the time constant; a third determination unit is used to combine the forward transfer function and the reverse transfer function to obtain a response transfer function, and determine the response frequency of the service interface according to the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
[0083] As an optional embodiment, the device also includes: an acquisition submodule, used to acquire pending requests, wherein the pending requests are interface business requests that have not made business interface calls; a start submodule, used to start the filter to respond to the pending requests and detect the switch state of the current limiting switch; a first sending submodule, used to send the pending requests to the business interface when the switch state is in the closed state; and a second sending submodule, used to reduce the number of interface business requests sent to the business interface when the switch state is in the open state.
[0084] As an optional embodiment, the device includes: a configuration submodule, which is used to configure a preset frequency threshold according to a preset time constant and a forward gain before reducing the number of service interface responses to interface service requests when the response frequency is lower than a preset frequency threshold, wherein the preset frequency threshold is: K is the forward gain and C is the preset time constant.
[0085] An embodiment of the present invention may provide an electronic device, the electronic device being a computer terminal, and the computer terminal may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0086] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0087] In this embodiment, the computer terminal can execute the following program codes of the current limiting method: monitor the response of the service interface to the interface service request, and obtain the input signal and output signal of the service interface, wherein the service interface is used to respond to the interface service request and generate a corresponding response result, the input signal is at least used to represent the input quantity of the interface service request, and the output signal is at least used to represent the response quantity of the service interface in response to the input quantity of the interface service request to generate the response result, the total response time for generating the response quantity of the response result, and the single response time for generating each response result; determine the forward transfer function of the service interface in the forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; perform Laplace transform on the preset response time function to obtain the reverse gain of the service interface in the reverse link; A forward transfer function is used, wherein the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and a reverse transfer function is used to represent the functional relationship between an input signal and an output signal based on a time gain, wherein in the reverse transfer function, the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of a preset time constant; using the forward transfer function and the reverse transfer function, a response transfer function is determined, and based on the response transfer function, a response frequency of a service interface is determined, wherein the response transfer function is used to represent the functional relationship between the response frequency and a preset gain, and the preset gain includes: a forward gain and a time gain; when the response frequency is lower than a preset frequency threshold, the number of service interface responses to service requests is reduced.
[0088] Figure 5 is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 5 As shown, the computer terminal 50 may include: one or more (only one is shown in the figure) processors 52 , and a memory 54 .
[0089] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the current limiting method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the above-mentioned current limiting method is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal 50 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0090] The processor can call the information and application program stored in the memory through the transmission device to perform the following steps: monitor the response of the service interface to the interface service request, and obtain the input signal and output signal of the service interface, wherein the service interface is used to respond to the interface service request and generate a corresponding response result, the input signal is at least used to represent the input quantity of the interface service request, and the output signal is at least used to represent the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time for generating the response quantity of the response result, and the single response time for generating each response result; determine the forward transfer function of the service interface in the forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; perform Laplace transform on the preset response time function to obtain the service interface in the reverse link A reverse transfer function, wherein a preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between an input signal and an output signal based on a time gain, wherein the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of a preset time constant; using a forward transfer function and a reverse transfer function, a response transfer function is determined, and based on the response transfer function, a response frequency of a service interface is determined, wherein the response transfer function is used to represent the functional relationship between the response frequency and a preset gain, and the preset gain includes: a forward gain and a time gain; when the response frequency is lower than a preset frequency threshold, the number of service interface responses to service requests is reduced.
[0091] Optionally, the processor may further execute a program code of the following steps: determining the ratio of the output signal to the input signal as a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
[0092] Optionally, the processor may also execute the program code of the following steps: monitoring the input time of each interface service request of the input service interface to obtain a first time domain signal, wherein, in the first time domain signal, the number of interface service requests is the input number; monitoring the response time of the service interface to generate a response result in response to each interface service request to obtain a second time domain signal, wherein, in the first time domain signal, the number of response results is the response number; performing Laplace transform on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal, and a second frequency domain signal corresponding to the second time domain signal; using the first frequency domain signal as the input signal and the second frequency domain signal as the output signal.
[0093] Optionally, the processor may further execute a program code of the following steps: obtaining a preset response time function, wherein the preset response time function is: t(n) Indicates the total response time, n indicates the number of inputs, i indicates the interface service request, i(n) represents the single response time, C represents the preset time constant; the preset response time function is Laplace transformed to obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant.
[0094] Optionally, the processor may further execute a program code of the following steps: obtaining a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant; the forward transfer function and the reverse transfer function are combined to obtain the response transfer function, and the response frequency of the business interface is determined based on the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
[0095] Optionally, the processor may also execute the program code of the following steps: obtaining pending requests, wherein the pending requests are interface business requests that have not made business interface calls; starting the filter to respond to the pending requests and detecting the switch state of the current limiting switch; when the switch state is closed, sending the pending requests to the business interface; and when the switch state is open, reducing the number of interface business requests sent to the business interface.
[0096] Optionally, the processor may further execute a program code of the following steps: configuring a preset frequency threshold according to a preset time constant and a forward gain, wherein the preset frequency threshold is: K is the forward gain and C is the preset time constant.
[0097] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 5 The structure of the electronic device is not limited. For example, the computer terminal 50 may also include Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations are shown.
[0098] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a computer program. The computer program can be stored in a non-volatile medium. The non-volatile storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0099] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the current limiting method provided in the above embodiment.
[0100] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0101] Optionally, in this embodiment, the non-volatile storage medium is configured to store program codes for executing the following steps: monitoring the response of the service interface to the interface service request, obtaining the input signal and the output signal of the service interface, wherein the service interface is used to respond to the interface service request and generate a corresponding response result, the input signal is at least used to represent the input quantity of the interface service request, the output signal is at least used to represent the response quantity of the service interface in response to the input quantity of the interface service request to generate the response result, the total response time for generating the response quantity of the response result, and the single response time for generating each response result; determining the forward transfer function of the service interface in the forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent the forward gain between the output signal and the input signal; performing a Laplace transform on the preset response time function to obtain the service interface in the reverse loop The reverse transfer function of the section, wherein the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain. In the reverse transfer function, the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant; using the forward transfer function and the reverse transfer function, determine the response transfer function, and based on the response transfer function, determine the response frequency of the service interface, wherein the response transfer function is used to represent the functional relationship between the response frequency and the preset gain, and the preset gain includes: forward gain and time gain; when the response frequency is lower than the preset frequency threshold, reduce the number of service interface response interface service requests.
[0102] Optionally, in this embodiment, the non-volatile storage medium is configured to store a program code for executing the following steps: determining a ratio of the output signal to the input signal as a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
[0103] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: monitoring the input time of each interface service request of the input service interface to obtain a first time domain signal, wherein, in the first time domain signal, the number of interface service requests is the input number; monitoring the response time of the service interface to generate a response result in response to each interface service request to obtain a second time domain signal, wherein, in the first time domain signal, the number of response results is the response number; performing Laplace transform on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal, and a second frequency domain signal corresponding to the second time domain signal; using the first frequency domain signal as the input signal and the second frequency domain signal as the output signal.
[0104] Optionally, in this embodiment, the non-volatile storage medium is configured to store a program code for executing the following steps: obtaining a preset response time function, wherein the preset response time function is: t(n) Indicates the total response time, n indicates the number of inputs, i indicates the interface service request, i(n) represents the single response time, C represents the preset time constant; the preset response time function is Laplace transformed to obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant.
[0105] Optionally, in this embodiment, the non-volatile storage medium is configured to store a program code for executing the following steps: obtaining a forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; obtain the reverse transfer function, where the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time, and Cs represents the time gain obtained by Laplace transforming the time constant; the forward transfer function and the reverse transfer function are combined to obtain the response transfer function, and the response frequency of the business interface is determined based on the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
[0106] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining pending requests, wherein the pending requests are interface business requests that have not made business interface calls; starting a filter to respond to the pending requests and detecting the switch state of the current limiting switch; when the switch state is in the closed state, sending the pending request to the business interface; and when the switch state is in the open state, reducing the number of interface business requests sent to the business interface.
[0107] Optionally, in this embodiment, the non-volatile storage medium is configured to store a program code for executing the following steps: configuring a preset frequency threshold according to a preset time constant and a forward gain, wherein the preset frequency threshold is: K is the forward gain and C is the preset time constant.
[0108] The embodiment of the present invention further provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the steps of the current limiting method provided in the above embodiment are implemented.
[0109] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0110] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0113] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a non-volatile storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned non-volatile storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0115] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A current limiting method, characterized in that: include: Monitor the response of the service interface to the interface service request, and obtain the input signal and output signal of the service interface, wherein the service interface is used to generate a corresponding response result in response to the interface service request, the input signal is at least used to indicate the input quantity of the interface service request, and the output signal is at least used to indicate the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time for generating the response quantity of the response results, and the single response time for generating each of the response results; Determine a forward transfer function of the service interface in a forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent a forward gain between the output signal and the input signal; Performing Laplace transform on the preset response time function to obtain the reverse transfer function of the service interface in the reverse link, wherein the preset response time function uses the product of the integral of multiple single response time lengths and the inverse of a preset time constant to represent the total response time length, and the reverse transfer function is used to represent the functional relationship between the input signal and the output signal based on the time gain, in which the input signal is the Laplace transform result of the integral of multiple single response time lengths, the output signal is the Laplace transform result of the total response time length, and the time gain is the Laplace transform result of the preset time constant; Using the forward transfer function and the reverse transfer function, a response transfer function is determined, and according to the response transfer function, a response frequency of the service interface is determined, wherein the response transfer function is used to represent a functional relationship between the response frequency and a preset gain, and the preset gain includes: the forward gain and the time gain; When the response frequency is lower than a preset frequency threshold, the number of responses of the service interface to the interface service request is reduced.
2. The method according to claim 1, characterized in that Determining the forward transfer function of the service interface in the forward link according to the input signal and the output signal includes: The ratio of the output signal to the input signal is determined as the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal.
3. The method according to claim 1, characterized in that Monitoring the response of the service interface to the interface service request, and obtaining the input signal and output signal of the service interface includes: Monitoring the input time of each interface service request input into the service interface to obtain a first time domain signal, wherein in the first time domain signal, the number of the interface service requests is the input number; Monitoring the response time of the service interface generating the response result in response to each of the interface service requests, and obtaining a second time domain signal, wherein in the first time domain signal, the number of the response results is the number of responses; Performing Laplace transform on the first time domain signal and the second time domain signal to obtain a first frequency domain signal corresponding to the first time domain signal and a second frequency domain signal corresponding to the second time domain signal; The first frequency domain signal is used as the input signal, and the second frequency domain signal is used as the output signal.
4. The method according to claim 1, characterized in that: Performing Laplace transform on the preset response time function to obtain the reverse transfer function of the service interface in the reverse link includes: Obtain the preset response time function, wherein the preset response time function is: t(n) represents the total response time, n represents the input quantity, i represents the interface service request, i(n) represents the single response time, and C represents the preset time constant; Performing Laplace transform on the preset response time function to obtain the reverse transfer function, wherein the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of multiple single response time lengths, and Cs represents the time gain obtained by Laplace transforming the time constant.
5. The method according to claim 1, characterized in that Using the forward transfer function and the reverse transfer function to determine a response transfer function, and determining the response frequency of the service interface according to the response transfer function includes: Obtain the forward transfer function, wherein the forward transfer function is: K represents the forward gain, G k (s) represents the forward transfer function, C(s) represents the output signal, and R(s) represents the input signal; Obtain the reverse transfer function, wherein the reverse transfer function is: T(s) represents the output signal obtained by Laplace transforming the total response time, I(s) represents the input signal obtained by Laplace transforming the integral of a plurality of single response time periods, and Cs represents the time gain obtained by Laplace transforming the time constant; The forward transfer function and the reverse transfer function are combined to obtain the response transfer function, and the response frequency of the service interface is determined according to the response transfer function, wherein the response transfer function is: G(s) represents the response transfer function, is the response frequency.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining a pending request, wherein the pending request is the interface service request that has not performed the service interface call; The start filter detects the switch state of the current limiting switch in response to the pending request; When the switch state is in the off state, sending the pending request to the service interface; When the switch state is on, the number of the interface service requests sent to the service interface is reduced.
7. The method according to claim 1, characterized in that When the response frequency is lower than a preset frequency threshold, before reducing the number of responses of the service interface to the interface service request, the method includes: The preset frequency threshold is configured according to the preset time constant and the forward gain, wherein the preset frequency threshold is: K is the forward gain, and C is the preset time constant.
8. A current limiting device, characterized in that: include: A monitoring module, used to monitor the response of the service interface to the interface service request, and obtain the input signal and output signal of the service interface, wherein the service interface is used to generate a corresponding response result in response to the interface service request, the input signal is used to at least represent the input quantity of the interface service request, and the output signal is used to at least represent the response quantity of the response result generated by the service interface in response to the input quantity of the interface service request, the total response time for generating the response quantity of the response results, and the single response time for generating each of the response results; A first determination module, configured to determine a forward transfer function of the service interface in a forward link according to the input signal and the output signal, wherein the forward transfer function is used to represent a forward gain between the output signal and the input signal; a transformation module, configured to perform Laplace transformation on a preset response time function to obtain a reverse transfer function of the service interface in a reverse link, wherein the preset response time function uses the product of an integral of a plurality of the single response time lengths and a reciprocal of a preset time constant to represent the total response time length, and the reverse transfer function is configured to represent a functional relationship between the input signal and the output signal based on a time gain, and in the reverse transfer function, the input signal is a Laplace transformation result of an integral of a plurality of the single response time lengths, the output signal is a Laplace transformation result of the total response time length, and the time gain is a Laplace transformation result of the preset time constant; a second determination module, configured to determine a response transfer function using the forward transfer function and the reverse transfer function, and determine a response frequency of the service interface according to the response transfer function, wherein the response transfer function is used to represent a functional relationship between the response frequency and a preset gain, and the preset gain includes: the forward gain and the time gain; The current limiting module is used to reduce the number of responses of the service interface to the interface service request when the response frequency is lower than a preset frequency threshold.
9. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the current limiting method according to any one of claims 1 to 7 through the computer program.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the current limiting method described in any one of claims 1 to 7 are implemented.