CN112527524A - Dynamic current limiting method and device and electronic equipment - Google Patents

Dynamic current limiting method and device and electronic equipment Download PDF

Info

Publication number
CN112527524A
CN112527524A CN202011447522.8A CN202011447522A CN112527524A CN 112527524 A CN112527524 A CN 112527524A CN 202011447522 A CN202011447522 A CN 202011447522A CN 112527524 A CN112527524 A CN 112527524A
Authority
CN
China
Prior art keywords
request message
forwarding
target
request
messages
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011447522.8A
Other languages
Chinese (zh)
Inventor
李鸿斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011447522.8A priority Critical patent/CN112527524A/en
Publication of CN112527524A publication Critical patent/CN112527524A/en
Pending legal-status Critical Current

Links

Images

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/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a dynamic current limiting method, a dynamic current limiting device and electronic equipment, relates to the technical field of data processing, and can be used in the fields of cloud computing and cloud. The specific implementation scheme is as follows: under the condition that the current limiting mechanism is triggered, forwarding a first target request message in a first request message set received by a request message forwarding service, wherein the first target request message is: the first request message set removes the remaining request messages after the first number of request messages; if the request message forwarding service meets the preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, wherein the second target request message is: the second set of request messages excludes a second number of request messages, the second number being greater than the first number. The method can dynamically adjust the quantity of the request messages which are not forwarded (namely discarded), and improves the flexibility and the adaptability of the discarded value setting of the request messages.

Description

Dynamic current limiting method and device and electronic equipment
Technical Field
The present disclosure relates to the field of micro services in computer technologies, and in particular, to a dynamic current limiting method and apparatus, and an electronic device.
Background
With the rise of micro services, a single service is split into a plurality of micro services, and communication between the micro services is based on basic middleware, such as service mesh (service mesh), which can ensure high reliability and can forward upstream requests to downstream.
Disclosure of Invention
The disclosure provides a dynamic current limiting method and device and electronic equipment.
According to a first aspect of the present disclosure, there is provided a dynamic current limiting method, including:
under the condition that a current limiting mechanism is triggered, forwarding a first target request message in a first request message set received by a request message forwarding service, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages;
if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number.
According to a second aspect of the present disclosure, there is provided a dynamic current limiting device, comprising:
the first forwarding module is used for forwarding a first target request message in a first request message set received by a request message forwarding service under the condition that the current limiting mechanism is triggered;
and the second forwarding module is configured to forward a second target request message in a second request message set received by the request message forwarding service if the request message forwarding service meets a preset condition, where the second number is greater than the first number.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to the first aspect.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flow chart of a dynamic current limiting method provided by an embodiment of the present disclosure;
fig. 2 is another flowchart of a dynamic current limiting method provided by an embodiment of the present disclosure;
FIG. 3 is a block diagram of a dynamic current limiting device provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device for implementing a dynamic current limiting method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a flowchart of a dynamic current limiting method provided in an embodiment of the present disclosure, and as shown in fig. 1, the embodiment provides a dynamic current limiting method applied to an electronic device, including the following steps:
step 101, forwarding a first target request message in a first request message set received by a request message forwarding service under the condition that a current limiting mechanism is triggered, where the first target request message is: the first set of request messages excludes the remaining request messages after the first number of request messages.
The electronic device may be a server or middleware configured to forward the received request message, e.g., forward a message sent by the first device to the second device. The current limiting mechanism may also be referred to as a fuse mechanism, and when the current limiting mechanism is triggered, the electronic device starts a current limiting policy, that is, starts to execute the dynamic current limiting method provided by the present disclosure. The condition that the current limiting mechanism is triggered may be a forwarding success rate according to which the electronic device forwards the request message, or whether the forwarding failure rate is greater than a fusing threshold, or other conditions are adopted, which may be specifically set according to an actual situation, and the disclosure is not limited.
The first set of request messages is a set of request messages that are currently received by the electronic device (i.e., if the current limiting mechanism is triggered) and that are not forwarded. The first number can also be set according to practical situations, for example, 10 or 20, and the disclosure is not limited.
Step 102, if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number.
The second set of request messages is a set of request messages that are currently received by the electronic device (i.e., in a case that the request message forwarding service satisfies a preset condition) and are not forwarded.
The request message forwarding service may be a forwarding success rate of the request message, or a forwarding failure rate or other conditions, and the preset conditions may be preset, for example, the forwarding success rate is greater than a preset threshold or less than a preset threshold, or the forwarding failure rate is greater than a preset threshold or less than a preset threshold, and the like. The preset condition is a target to be reached, and if the request message forwarding service meets the preset condition, it indicates that the number of request messages forwarded to the downstream needs to be continuously reduced, and the number of discarded request messages is increased.
The discarded request message may be understood as a request message that is not forwarded, which is randomly determined. The second number can also be set according to practical situations, for example, 10 or 20, and the disclosure is not limited.
Further, if the request message forwarding service still meets the preset condition, the number of more discarded request messages is increased on the basis of the second number, and so on until the request message forwarding service does not meet the preset condition.
In this embodiment, when the current limiting mechanism is triggered, a first target request message in a first request message set received by a request message forwarding service is forwarded, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages; if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number. The method can dynamically adjust the quantity of the request messages which are not forwarded (namely discarded), and improves the flexibility and the adaptability of the discarded value setting of the request messages.
In the above, in step 101, after forwarding a first target request message in a first request message set received by a request message forwarding service under the condition that a current limiting mechanism is triggered, in step 102, if the request message forwarding service meets a preset condition, before forwarding a second target request message in a second request message set received by the request message forwarding service, the method further includes:
counting the forwarding success rate of the first target request message in the first request message set;
step 102, if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, including:
and if the forwarding success rate is smaller than a first preset threshold value, forwarding the second target request message in the second request message set received by the request message forwarding service.
In this embodiment, the request message forwarding service may use a forwarding success rate of the first target request message as a determination criterion, and the first preset threshold may be set according to an actual situation, for example, the first preset threshold may be 85% or 90%, which is not limited herein. The preset condition is that the forwarding success rate of the first target request message is smaller than a first preset threshold, and under the condition that the request message forwarding service meets the preset condition, the number of discarded request messages is increased, namely the second number is determined, the request messages in the second request message set are forwarded according to the second number, and the second number is larger than the first number. Further, the difference between the second number and the first number may be a preset difference, that is, when the number of discarded request messages is increased, the number is increased the same each time, for example, increased by 10% each time, or increased by 20 pieces each time, which is not limited herein.
In the above, if the forwarding success rate of the first target request message is smaller than the first preset threshold, it indicates that the number of request messages forwarded to the downstream needs to be continuously decreased, that is, the number of discarded request messages is increased, so as to reduce the overload of the downstream.
In the foregoing, the counting the forwarding success rate of the first target request message in the first request message set includes:
receiving a response message of a first request message in the first target request message;
counting the number of the first request messages;
and determining the forwarding success rate according to the number of the first request messages and the number of the first target request messages.
Specifically, the electronic device forwards the first target request message to the downstream, and if the forwarding is successful, the electronic device receives a response message fed back by the downstream, and if the electronic device receives the response message, it indicates that the forwarding of the first target request message is successful. Based on this, the number of request messages successfully forwarded may be determined according to the value of the received response message of the first request message, and then the forwarding success rate may be determined according to the ratio of the number of first request messages to the number of first target request messages. The first request message is a message of the first target request message, which receives the response message.
Further, the number of the first target request messages and the number of the first request messages may be counted within a preset time period, for example, 2 seconds or 5 seconds, to determine the forwarding success rate within the preset time period.
In this embodiment, the forwarding success rate is determined by the number of successfully forwarded request messages (i.e., the first request messages) and the number of the first target request messages, i.e., the forwarding success rate is determined according to the actual forwarding condition, which is convenient for dynamically adjusting the number of discarded request messages, and improves the flexibility and adaptivity of the setting of the discarded number of request messages.
In the above, in step 101, when the current limiting mechanism is triggered, after forwarding the first target request message in the first request message set received by the request message forwarding service, the following steps are further included:
if the request message forwarding service does not meet the preset condition and the first number is greater than a second preset threshold, forwarding a third target request message in a third request message set received by the request message forwarding service, where the third target request message is: the third set of request messages excludes request messages remaining after a third number of request messages, the third number being less than the first number.
The preset condition is that the forwarding success rate is smaller than a first preset threshold, and the first preset threshold may be set according to an actual situation, for example, the first preset threshold may be 85% or 90%, and is not limited herein.
In case that the request message forwarding service does not satisfy the preset condition, for example, in case that the forwarding success rate is greater than or equal to 85%, and the first number is greater than the second preset threshold, the number of the discarded request messages is reduced, that is, a third number of the randomly discarded request messages is determined, where the third number is smaller than the first number. Further, the difference between the third quantity and the first quantity may be a preset difference. That is, when the number of discarded request messages is reduced, the number is reduced the same each time, for example, 10% each time, or 20 pieces each time, which is not limited herein. The second preset threshold may also be set according to the actual situation, for example 0.
If the success rate of forwarding the first target request message is greater than or equal to the first preset threshold, it is indicated that the number of request messages forwarded to the downstream can be increased, that is, the number of discarded request messages is reduced, as many request messages as possible are forwarded, and the forwarding performance of the electronic device is improved.
In the foregoing, when the current limiting mechanism is triggered, after forwarding a first target request message in a first request message set received by a request message forwarding service, the method further includes:
and if the message forwarding service does not meet the preset condition and the first number is less than or equal to a second preset threshold value, canceling the current limiting mechanism.
Specifically, the preset condition is that the forwarding success rate is smaller than a first preset threshold, and the first preset threshold may be set according to an actual situation, for example, the first preset threshold may be 85% or 90%, and is not limited herein.
Under the condition that the request message forwarding service does not meet the preset condition, for example, the forwarding success rate is greater than or equal to 85%, and the first quantity is less than or equal to the second preset threshold, it indicates that the request message forwarding service of the electronic device has been recovered, and the downstream overload condition is good, at this time, the current limiting mechanism is cancelled, and the electronic device resumes normal forwarding of the request message.
In this embodiment, if the message forwarding service does not satisfy the preset condition and the first number is less than or equal to a second preset threshold, the current limiting mechanism is cancelled. Namely, when the request information forwarding service of the electronic equipment is judged to be recovered, the current limiting mechanism is cancelled, and the forwarding performance of the electronic equipment can be improved.
Fig. 2 is another schematic flow chart of a dynamic current limiting method according to an embodiment of the present disclosure, and as shown in fig. 2, the dynamic current limiting method includes:
step 21, triggering a fusing mechanism (namely a current limiting mechanism);
step 22, performing a blown current limiting (i.e. a dynamic current limiting policy), that is, randomly discarding X% of the request messages, which may be understood as selecting (1-X%) of the received request messages to forward, where X is a number greater than 0 and less than 100;
step 23, detecting the forwarding success rate of the request message forwarded for N times (or pieces), and judging whether the request message forwarding service is recovered according to the forwarding success rate;
step 24, determining whether the request message forwarding service is recovered, for example, if the forwarding success rate is greater than or equal to a first preset threshold, the request message forwarding service is recovered, and if the forwarding success rate is less than the first preset threshold, the request message forwarding service is not recovered; if not, go to step 25, if yes, go to step 26;
step 25, increasing the discarding ratio, namely increasing a preset value on the basis of X, and executing the step 22;
step 26, judging whether X is 0, if so, executing step 27; if not, go to step 28;
step 27, canceling fusing;
step 28, reduce the discarding ratio, i.e. reduce the preset value on the basis of X, and go to step 22.
According to the dynamic current limiting method, the proportion of current limiting is dynamically adjusted in a self-adaptive manner, the situation that the downstream cannot be continuously in an overload state is guaranteed, the situation that the downstream is continuously in an overload avalanche state is avoided, and the self-healing capability is achieved.
Referring to fig. 3, fig. 3 is a structural diagram of a dynamic current limiting apparatus according to an embodiment of the present disclosure, and as shown in fig. 3, the embodiment provides a dynamic current limiting apparatus 300, including:
a first forwarding module 301, configured to forward a first target request message in a first request message set received by a request message forwarding service when a current limiting mechanism is triggered, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages;
a second forwarding module 302, configured to forward a second target request message in a second request message set received by the request message forwarding service if the request message forwarding service meets a preset condition, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number.
Further, the dynamic current limiting apparatus 300 further includes:
a counting module, configured to count a forwarding success rate of the first target request message in the first request message set;
the second forwarding module is configured to forward the second target request message in the second request message set received by the request message forwarding service if the forwarding success rate is smaller than a first preset threshold.
Further, the statistic module includes:
the receiving submodule is used for receiving a response message of a first request message in the first target request message;
the statistic submodule is used for counting the number of the first request messages;
and the determining submodule is used for determining the forwarding success rate according to the number of the first request messages and the number of the first target request messages.
Further, the dynamic current limiting apparatus 300 further includes:
a third forwarding module, configured to forward a third target request message in a third request message set received by the request message forwarding service if the request message forwarding service does not meet a preset condition and the first number is greater than a second preset threshold, where the third target request message is: the third set of request messages excludes request messages remaining after a third number of request messages, the third number being less than the first number.
Further, the dynamic current limiting apparatus 300 further includes:
and the canceling module is used for canceling the current limiting mechanism if the message forwarding service does not meet the preset condition and the first quantity is less than or equal to a second preset threshold value.
In the dynamic current limiting apparatus 300 according to the embodiment of the present disclosure, when the current limiting mechanism is triggered, a first target request message in a first request message set received by a request message forwarding service is forwarded, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages; if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number. The method can dynamically adjust the quantity of the request messages which are not forwarded (namely discarded), and improves the flexibility and the adaptability of the discarded value setting of the request messages.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
As shown in fig. 4, a block diagram of an electronic device of a method of dynamic current limiting according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 4, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium provided by the present disclosure. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method of dynamic current limiting provided by the present disclosure. The non-transitory computer readable storage medium of the present disclosure stores computer instructions for causing a computer to perform the method of dynamic throttling provided by the present disclosure.
Memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., first forwarding module 301, second forwarding module 302 shown in fig. 3) corresponding to the method of dynamic throttling in embodiments of the present disclosure. The processor 501 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 502, that is, implements the method of dynamic current limiting in the above method embodiments.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the dynamically limited electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 optionally includes memory located remotely from processor 501, which may be connected to the dynamically throttled electronic device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the method of dynamically limiting current may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 4 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the dynamically current limited electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input device. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network, and a server may be a server of a distributed system or a server that incorporates a blockchain. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
In this disclosure, when the current limiting mechanism is triggered, a first target request message in a first request message set received by a request message forwarding service is forwarded, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages; if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number. The method can dynamically adjust the quantity of the request messages which are not forwarded (namely discarded), and improves the flexibility and the adaptability of the discarded value setting of the request messages.
If the success rate of forwarding the first target request message is less than the first preset threshold, it indicates that the number of request messages forwarded to the downstream needs to be continuously decreased, that is, the number of discarded request messages is increased, so as to reduce the overload of the downstream.
The forwarding success rate is determined according to the number of successfully forwarded request messages (i.e. the first request messages) and the number of the first target request messages, i.e. the forwarding success rate is determined according to the actual forwarding condition, so that the number of discarded request messages is conveniently and dynamically adjusted, and the flexibility and the adaptability of the setting of the discarded number of request messages are improved.
If the success rate of forwarding the first target request message is greater than or equal to the first preset threshold, it is indicated that the number of request messages forwarded to the downstream can be increased, that is, the number of discarded request messages is reduced, as many request messages as possible are forwarded, and the forwarding performance of the electronic device is improved.
And if the message forwarding service does not meet the preset condition and the first number is less than or equal to a second preset threshold value, canceling the current limiting mechanism. Namely, when the request information forwarding service of the electronic equipment is judged to be recovered, the current limiting mechanism is cancelled, and the forwarding performance of the electronic equipment can be improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (13)

1. A method of dynamic current limiting, comprising:
under the condition that a current limiting mechanism is triggered, forwarding a first target request message in a first request message set received by a request message forwarding service, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages;
if the request message forwarding service meets a preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number.
2. The method of claim 1, wherein after forwarding a first target request message in a first request message set received by a request message forwarding service if the current limiting mechanism is triggered, before forwarding a second target request message in a second request message set received by the request message forwarding service if the request message forwarding service satisfies a preset condition, the method further comprises:
counting the forwarding success rate of the first target request message in the first request message set;
if the request message forwarding service meets the preset condition, forwarding a second target request message in a second request message set received by the request message forwarding service, including:
and if the forwarding success rate is smaller than a first preset threshold value, forwarding the second target request message in the second request message set received by the request message forwarding service.
3. The method of claim 2, wherein the counting the forwarding success rate of the first target request message in the first request message set comprises:
receiving a response message of a first request message in the first target request message;
counting the number of the first request messages;
and determining the forwarding success rate according to the number of the first request messages and the number of the first target request messages.
4. The method of claim 1, wherein after forwarding a first target request message of a first set of request messages received by a request message forwarding service if a throttling mechanism is triggered, further comprising:
if the request message forwarding service does not meet the preset condition and the first number is greater than a second preset threshold, forwarding a third target request message in a third request message set received by the request message forwarding service, where the third target request message is: the third set of request messages excludes request messages remaining after a third number of request messages, the third number being less than the first number.
5. The method of claim 4, wherein after forwarding a first target request message of a first set of request messages received by a request message forwarding service if a throttling mechanism is triggered, further comprising:
and if the message forwarding service does not meet the preset condition and the first number is less than or equal to a second preset threshold value, canceling the current limiting mechanism.
6. A dynamic current limiting device, comprising:
a first forwarding module, configured to forward a first target request message in a first request message set received by a request message forwarding service when a current limiting mechanism is triggered, where the first target request message is: the first request message set removes the remaining request messages after the first number of request messages;
a second forwarding module, configured to forward a second target request message in a second request message set received by the request message forwarding service if the request message forwarding service meets a preset condition, where the second target request message is: the second set of request messages excludes a second number of request messages that are left over, the second number being greater than the first number.
7. The apparatus of claim 6, further comprising:
a counting module, configured to count a forwarding success rate of the first target request message in the first request message set;
the second forwarding module is configured to forward the second target request message in the second request message set received by the request message forwarding service if the forwarding success rate is smaller than a first preset threshold.
8. The apparatus of claim 7, wherein the statistics module comprises:
the receiving submodule is used for receiving a response message of a first request message in the first target request message;
the statistic submodule is used for counting the number of the first request messages;
and the determining submodule is used for determining the forwarding success rate according to the number of the first request messages and the number of the first target request messages.
9. The apparatus of claim 6, further comprising:
a third forwarding module, configured to forward a third target request message in a third request message set received by the request message forwarding service if the request message forwarding service does not meet a preset condition and the first number is greater than a second preset threshold, where the third target request message is: the third set of request messages excludes request messages remaining after a third number of request messages, the third number being less than the first number.
10. The apparatus of claim 9, further comprising:
and the canceling module is used for canceling the current limiting mechanism if the message forwarding service does not meet the preset condition and the first quantity is less than or equal to a second preset threshold value.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
CN202011447522.8A 2020-12-09 2020-12-09 Dynamic current limiting method and device and electronic equipment Pending CN112527524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011447522.8A CN112527524A (en) 2020-12-09 2020-12-09 Dynamic current limiting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011447522.8A CN112527524A (en) 2020-12-09 2020-12-09 Dynamic current limiting method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112527524A true CN112527524A (en) 2021-03-19

Family

ID=75000480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011447522.8A Pending CN112527524A (en) 2020-12-09 2020-12-09 Dynamic current limiting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112527524A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937587A (en) * 2006-09-07 2007-03-28 华为技术有限公司 Method and system for realizing business flow control
CN107995127A (en) * 2017-12-13 2018-05-04 深圳乐信软件技术有限公司 A kind of method and device for overload protection
CN110120973A (en) * 2019-04-28 2019-08-13 华为技术有限公司 A kind of request control method, relevant device and computer storage medium
CN110297698A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 A kind of multipriority dynamic current limiting method, apparatus, server and storage medium
CN110351200A (en) * 2019-08-16 2019-10-18 东北大学秦皇岛分校 A kind of opportunistic network jamming control method based on forwarding task immigration
CN111290696A (en) * 2020-02-26 2020-06-16 平安银行股份有限公司 Flow control method and device for application program assembly
CN111324471A (en) * 2020-01-22 2020-06-23 远景智能国际私人投资有限公司 Service adjusting method, device, equipment and storage medium
CN111782259A (en) * 2020-06-24 2020-10-16 北京计算机技术及应用研究所 Micro-service management method based on reverse proxy

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937587A (en) * 2006-09-07 2007-03-28 华为技术有限公司 Method and system for realizing business flow control
CN107995127A (en) * 2017-12-13 2018-05-04 深圳乐信软件技术有限公司 A kind of method and device for overload protection
CN110297698A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 A kind of multipriority dynamic current limiting method, apparatus, server and storage medium
CN110120973A (en) * 2019-04-28 2019-08-13 华为技术有限公司 A kind of request control method, relevant device and computer storage medium
CN110351200A (en) * 2019-08-16 2019-10-18 东北大学秦皇岛分校 A kind of opportunistic network jamming control method based on forwarding task immigration
CN111324471A (en) * 2020-01-22 2020-06-23 远景智能国际私人投资有限公司 Service adjusting method, device, equipment and storage medium
CN111290696A (en) * 2020-02-26 2020-06-16 平安银行股份有限公司 Flow control method and device for application program assembly
CN111782259A (en) * 2020-06-24 2020-10-16 北京计算机技术及应用研究所 Micro-service management method based on reverse proxy

Similar Documents

Publication Publication Date Title
CN112437018B (en) Flow control method, device, equipment and storage medium of distributed cluster
CN111461290B (en) Model parameter updating method and device
CN112181683A (en) Concurrent consumption method and device for message middleware
CN111669438B (en) Live broadcast message transmission method and device, electronic equipment and medium
CN111865720B (en) Method, apparatus, device and storage medium for processing request
CN111880914A (en) Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN112311597B (en) Message pushing method and device
CN110716959A (en) Streaming data processing method and device, electronic equipment and storage medium
WO2023103516A1 (en) Low-priority blocking method and apparatus based on processor virtualization environment
CN110958250B (en) Port monitoring method and device and electronic equipment
CN111881387A (en) Data processing method, device, equipment and medium for small program
CN114217996A (en) Sound mixing method and device
CN113825170A (en) Method and apparatus for determining network channel
CN111858030A (en) Job resource processing method and device, electronic equipment and readable storage medium
CN112527524A (en) Dynamic current limiting method and device and electronic equipment
CN111881339A (en) Resource information pushing and informing method and device, electronic equipment and storage medium
EP3866399A1 (en) Method and apparatus for adjusting network flow
CN113655906A (en) Folding screen control method and device
CN111338937A (en) Method, device, equipment and medium for off-line intervention of applet
CN112202692A (en) Data distribution method, device, equipment and storage medium
CN111405051B (en) Processing method, device and equipment of Application Programming Interface (API) information
CN111698243A (en) Parameter configuration method and device, electronic equipment and storage medium
CN111131935B (en) OTN switching method, device, equipment and storage medium
CN112738567B (en) Platform content processing method and device, electronic equipment and storage medium
CN113127512B (en) Multi-data stream data splicing triggering method and device, electronic equipment and 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