CN110413416B - Current limiting method and device for distributed server - Google Patents
Current limiting method and device for distributed server Download PDFInfo
- Publication number
- CN110413416B CN110413416B CN201910698896.8A CN201910698896A CN110413416B CN 110413416 B CN110413416 B CN 110413416B CN 201910698896 A CN201910698896 A CN 201910698896A CN 110413416 B CN110413416 B CN 110413416B
- Authority
- CN
- China
- Prior art keywords
- transaction
- current
- transaction request
- current limiting
- limiting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5044—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a current limiting method and a device of a distributed server, wherein the method comprises the following steps: receiving at least one transaction request; if the transaction request meeting the current-limiting judgment rule exists in the at least one transaction request, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset; and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule. The device is used for executing the method. The method and the device for limiting the current of the distributed server provided by the embodiment of the invention improve the running stability of the distributed server.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a current limiting method and device of a distributed server.
Background
In recent years, as the internet financial industry is continuously developed and the scale of the internet financial industry is continuously enlarged, the traditional single application architecture and the vertical application architecture cannot cope with the pressure caused by the instantaneous high concurrent traffic, and the distributed service architecture and the mobile computing architecture are more and more widely applied.
At present, the stability of the operation of the distributed service architecture is far from reaching the level of the traditional architecture. In order to ensure that the distributed service system can operate orderly, tools such as service degradation and service flow limitation are often adopted in the application of the distributed server. In the prior art, the current limiting mode of the distributed server is mainly realized based on methods such as server middleware connection number and concurrency thread control, and the methods have single function and poor flexibility, and cannot effectively limit the current of the distributed server, especially when facing a sudden increase of high concurrency and a large number of transaction access requests.
Therefore, how to provide a current limiting method for a distributed server, which can effectively control the number of transaction requests and improve the stability of the operation of the distributed server, becomes an important issue to be solved in the field.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a current limiting method and apparatus for a distributed server.
In one aspect, the present invention provides a current limiting method for a distributed server, including:
receiving at least one transaction request;
if the transaction request meeting the current-limiting judgment rule exists in the at least one transaction request, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset;
and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule.
In another aspect, the present invention provides a current limiting apparatus for a distributed server, including:
a first receiving unit for receiving at least one transaction request;
the judging unit is used for acquiring the transaction request quantity in unit time after judging and knowing that the transaction request meeting the current-limiting judging rule exists in the at least one transaction request; wherein the current limit judgment rule is preset;
and the rejecting unit is used for rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule after judging that the transaction request number in the unit time is larger than the current limiting threshold.
In another aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for limiting current of a distributed server according to any of the above embodiments.
In yet another aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for throttling a distributed server according to any one of the above embodiments.
The method and the device for limiting the flow of the distributed server provided by the embodiment of the invention can receive at least one transaction request, obtain the number of the transaction requests in unit time after judging that the transaction requests meeting the flow limiting judgment rule exist in the at least one transaction request, refuse the transaction requests which exceed the flow limiting threshold and meet the flow limiting judgment rule after judging that the number of the transaction requests in unit time is larger than the flow limiting threshold, limit the number of the transaction requests in unit time through the flow limiting judgment rule and the flow limiting threshold, effectively control the number of the transaction requests, avoid the number of the transaction requests from exceeding the processing capacity of the distributed server, and improve the operation stability of the distributed server.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic structural diagram of a current limiting system of a distributed server according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a method for limiting a flow of a distributed server according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a method for limiting a current of a distributed server according to another embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a current limiting apparatus of a distributed server according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a current limiting apparatus of a distributed server according to another embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a current limiting apparatus of a distributed server according to another embodiment of the present invention.
Fig. 7 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a schematic structural diagram of a current limiting system of a distributed server according to an embodiment of the present invention, and as shown in fig. 1, the current limiting system of the distributed server according to the embodiment of the present invention includes a service invocation end 1, a distributed current limiter 2, and a distributed server 3, where the service invocation end 1 is connected to the distributed current limiter 2 in a communication manner, and the distributed current limiter 2 is connected to the distributed server 3 in a communication manner. The service calling end 1 is an entrance for service calling and can initiate business transaction, and the service calling end 1 is, for example, terminal equipment arranged in channels such as counter, bank-enterprise interconnection, internet bank and the like; the service calling end 1 can assemble each service transaction into a message according to transaction elements to form a transaction request and send the transaction request to the distributed current limiter 2. The distributed current limiter 2 receives the transaction request, carries out current limiting processing on the transaction request, and forwards the transaction request which does not need current limiting to the distributed server 3. The distributed server 3 processes the received transaction request and returns a processing result. The distributed current limiter 2 is used for executing the current limiting method of the distributed server provided by the embodiment of the invention. It should be noted that the current limiting method for the distributed server provided in the embodiment of the present invention implements current limiting for the distributed server by controlling the number of transaction requests.
Fig. 2 is a schematic flow diagram of a current limiting method for a distributed server according to an embodiment of the present invention, and as shown in fig. 2, the current limiting method for a distributed server according to the embodiment of the present invention includes:
s201, receiving at least one transaction request;
specifically, the service invocation end sends at least one transaction request to the distributed current limiter, and the distributed current limiter receives the transaction request. The transaction request includes transaction elements, the transaction elements include but are not limited to a transaction type, a transaction account number, a transaction currency, a transaction amount, a transaction date, and the like, and the transaction elements are set according to an actual situation, which is not limited in the embodiment of the present invention.
S202, if the at least one transaction request is judged to have the transaction request meeting the current limiting judgment rule, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset;
specifically, after receiving the at least one transaction request, the distributed current limiter determines whether each transaction request in the at least one transaction request satisfies a current limiting determination rule, and if there is a transaction request satisfying the current limiting determination rule, obtains the number of transaction requests in a unit time. Wherein the current limit judgment rule is preset. The current-limiting judgment rule is set according to actual needs, and the embodiment of the invention is not limited; the unit time is, for example, 1 second, and is set according to actual needs, which is not limited in the embodiment of the present invention. It will be appreciated that for transaction requests that do not meet the current limit determination rule, the distributed current limiter will be forwarded to a distributed server for processing. The distributed current limiter may be set on a gateway, a proxy server, or a distributed server, and is set according to actual needs, which is not limited in the embodiments of the present invention.
For example, the current limiting judgment rule includes a judgment condition: the transaction currency is Renminbi or USD. The transaction request satisfies the current limit determination rule if the transaction currency used in the transaction request is Renminbi or USD. The current limiting judgment rule comprises the following judgment conditions: the transaction amount is greater than 100 and less than 1000. If the transaction amount of the transaction request is greater than 100 and less than 1000, the transaction request satisfies the current limit determination rule. The current limiting judgment rule comprises the following judgment conditions: the transaction date is 11 months and 11 days. And if the transaction date of the transaction request is 11 months and 11 days, the transaction request meets the current limiting judgment rule. The current limiting judgment rule comprises the following judgment conditions: the transaction currency is U.S. dollars and the transaction amount is greater than 1000. If the transaction currency in the transaction request is U.S. dollars and the transaction amount is greater than 1000, then the transaction request satisfies the current limit determination rule. It is to be understood that the current limit determination rule may include a plurality of determination conditions.
S203, if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold value, rejecting the transaction requests which exceed the current limiting threshold value and meet the current limiting judgment rule.
Specifically, after the transaction request number in the unit time is obtained by the distributed current limiter, the transaction request number in the unit time is compared with a current limiting threshold, and if the transaction request number in the unit time is greater than the current limiting threshold, the transaction request which exceeds the current limiting threshold and satisfies the current limiting judgment rule is rejected, that is, the transaction request which exceeds the current limiting threshold and satisfies the current limiting judgment rule is not forwarded to the distributed server for processing. The current limit threshold is preset, and the current limit threshold is set according to actual experience, which is not limited in the embodiments of the present invention.
For example, if the number of transaction requests of the transaction requests meeting the current limiting judgment rule is 10, and the number of transaction requests in the unit time exceeding the current limiting threshold value is 5, the distributed current limiter rejects 5 transaction requests of the transaction requests meeting the current limiting judgment rule, and the remaining 5 transaction requests are sent to the distributed server for processing. The distributed current limiter may randomly select 5 transaction requests meeting the current limiting judgment rule to reject, or select 5 transaction requests with later sending time to reject according to the sending time of each transaction request, and the setting is performed according to actual needs, which is not limited in the embodiment of the present invention.
The method for limiting the current of the distributed server provided by the embodiment of the invention receives at least one transaction request, acquires the transaction request number in unit time after judging that the transaction request meeting the current limiting judgment rule exists in the at least one transaction request, rejects the transaction request which exceeds the current limiting threshold value and meets the current limiting judgment rule after judging that the transaction request number in unit time is larger than the current limiting threshold value, limits the transaction request number in unit time through the current limiting judgment rule and the current limiting threshold value, can effectively control the transaction request number, avoids the transaction request number from exceeding the processing capacity of the distributed server, and improves the operation stability of the distributed server.
Fig. 3 is a schematic flow chart of a current limiting method for a distributed server according to another embodiment of the present invention, as shown in fig. 3, on the basis of the foregoing embodiments, further, if it is determined that there is a transaction request meeting a current limiting determination rule in the at least one transaction request, the determining includes:
s2021, extracting at least one transaction element from the transaction request; wherein the transaction element is preset;
in particular, since the transaction request comprises transaction elements, the distributed restrictor may extract at least one transaction element from the transaction request. Wherein the transaction element is preset.
For example, the distributed restrictor may extract transaction elements from the transaction request in a keyword search. Alternatively, the transaction request is a formatted message, and the distributed current limiter may extract the transaction elements through a specific field of the message.
S2022, if it is determined that the at least one transaction element satisfies the current limiting determination rule, determining that the transaction request satisfies the current limiting determination rule.
Specifically, after at least one transaction element is extracted from the transaction request, the distributed current limiter determines whether a transaction element meeting the current limiting determination rule exists in the at least one transaction element, and if a transaction element meeting the current limiting determination rule exists, the transaction requirement corresponding to the transaction element meets the current limiting determination rule.
On the basis of the foregoing embodiments, further, the obtaining the transaction request amount per unit time includes:
and calculating the sum of the transaction request quantity which is already forwarded in the unit time and the transaction request quantity which meets the current limiting judgment rule to be used as the transaction request quantity in the unit time.
Specifically, the distributed current limiter counts the transaction request number of the transaction requests that have been forwarded in the unit time, and can obtain the transaction request number that has been forwarded in the unit time; the distributed current limiter counts the transaction request quantity of the transaction requests meeting the current limiting judgment rule in the unit time, and can obtain the transaction request quantity meeting the current limiting judgment rule in the unit time. And the distributed current limiter sums the transaction request quantity which is already forwarded in the unit time and the transaction request quantity which meets the current limiting judgment rule, and takes the sum result as the transaction request quantity in the unit time.
On the basis of the foregoing embodiments, further, the method for limiting a flow of a distributed server provided in an embodiment of the present invention further includes:
receiving a current limit configuration, the current limit configuration including a transaction element, the current limit determination rule, and the current limit threshold.
In particular, the distributed current limiter may receive a current limiting configuration, which may include transaction elements, the current limiting decision rule, and the current limiting threshold, and cache the current limiting configuration locally. The current limiting arrangement may be centrally configured and then transmitted to the distributed current limiters. The current limiting configuration is set according to practical experience, and the embodiment of the invention is not limited.
Fig. 4 is a schematic structural diagram of a current limiting apparatus of a distributed server according to an embodiment of the present invention, and as shown in fig. 4, the current limiting apparatus of the distributed server according to the embodiment of the present invention includes a first receiving unit 401, a determining unit 402, and a rejecting unit 403, where:
the first receiving unit 401 is configured to receive at least one transaction request; the judging unit 402 is configured to obtain the number of transaction requests in unit time after judging and knowing that a transaction request meeting a current limiting judgment rule exists in the at least one transaction request; wherein the current limit judgment rule is preset; the rejecting unit 403 is configured to reject the transaction requests that exceed the current limiting threshold and satisfy the current limiting determination rule after determining that the number of transaction requests in the unit time is greater than the current limiting threshold.
Specifically, the service invocation end may send at least one transaction request to the distributed current limiter, and the first receiving unit 401 may receive the transaction request. The transaction request includes transaction elements, the transaction elements include but are not limited to a transaction type, a transaction account number, a transaction currency, a transaction amount, a transaction date, and the like, and the transaction elements are set according to an actual situation, which is not limited in the embodiment of the present invention.
After receiving the at least one transaction request, the determining unit 402 determines whether each transaction request in the at least one transaction request satisfies a current limiting determination rule, and if there is a transaction request satisfying the current limiting determination rule, acquires the number of transaction requests in unit time. Wherein the current limit judgment rule is preset. The current-limiting judgment rule is set according to actual needs, and the embodiment of the invention is not limited; the unit time is, for example, 1 second, and is set according to actual needs, and the embodiment of the present invention is not limited. It is understood that for transaction requests that do not satisfy the current limiting determination rule, the determining unit 402 forwards the transaction requests to the distributed servers for processing.
The rejecting unit 403 compares the transaction request number in the unit time with a current limiting threshold after obtaining the transaction request number in the unit time, and rejects the transaction request exceeding the current limiting threshold and meeting the current limiting determination rule if the transaction request number in the unit time is greater than the current limiting threshold, that is, the transaction request exceeding the current limiting threshold and meeting the current limiting determination rule will not be forwarded to the distributed server for processing. The current limit threshold is preset, and the current limit threshold is set according to actual experience, which is not limited in the embodiments of the present invention.
The current limiting device of the distributed server provided by the embodiment of the invention receives at least one transaction request, acquires the number of the transaction requests in unit time after judging that the transaction requests meeting the current limiting judgment rule exist in the at least one transaction request, refuses the transaction requests exceeding the current limiting threshold and meeting the current limiting judgment rule after judging that the number of the transaction requests in unit time is larger than the current limiting threshold, limits the number of the transaction requests in unit time through the current limiting judgment rule and the current limiting threshold, can effectively control the number of the transaction requests, avoids the number of the transaction requests from exceeding the processing capacity of the distributed server, and improves the operation stability of the distributed server.
Fig. 5 is a schematic structural diagram of a current limiting apparatus of a distributed server according to another embodiment of the present invention, and as shown in fig. 5, on the basis of the foregoing embodiments, the determining unit 402 further includes an extracting sub-unit 4021 and a determining sub-unit 4022, where:
the extracting subunit 4021 is configured to extract at least one transaction element from the transaction request; wherein the transaction element is preset; the judging subunit 4022 is configured to determine that the transaction request satisfies the current-limiting judgment rule after it is judged and known that the at least one transaction element satisfies the current-limiting judgment rule.
In particular, since the transaction request includes transaction elements, the extraction subunit 4021 may extract at least one transaction element from the transaction request. Wherein the transaction element is preset.
After at least one transaction element is extracted from the transaction request, the determining subunit 4022 determines whether there is a transaction element that satisfies the current-limiting determination rule in the at least one transaction element, and if there is a transaction element that satisfies the current-limiting determination rule, the transaction request corresponding to the transaction element satisfies the current-limiting determination rule.
On the basis of the foregoing embodiments, further, the determining unit 402 is specifically configured to:
and calculating the sum of the transaction request quantity which is already forwarded in the unit time and the transaction request quantity which meets the current limiting judgment rule to be used as the transaction request quantity in the unit time.
Specifically, the judging unit 402 counts the transaction request quantity of the transaction requests that have been forwarded in the unit time, and may obtain the transaction request quantity that has been forwarded in the unit time; the determining unit 402 counts the transaction request quantity of the transaction requests meeting the current limiting determination rule in the unit time, and may obtain the transaction request quantity meeting the current limiting determination rule in the unit time. The judging unit 402 sums the transaction request quantity already forwarded in the unit time and the transaction request quantity meeting the current limiting judgment rule, and takes the summed result as the transaction request quantity in the unit time.
Fig. 6 is a schematic structural diagram of a current limiting apparatus for a distributed server according to another embodiment of the present invention, and as shown in fig. 6, on the basis of the foregoing embodiments, the current limiting apparatus for a distributed server according to the embodiment of the present invention further includes a second receiving unit 404:
the second receiving unit 404 is configured to receive a current limiting configuration, where the current limiting configuration includes a transaction element, the current limiting judgment rule, and the current limiting threshold.
Specifically, the second receiving unit 404 may receive a current limiting configuration, which may include transaction elements, the current limiting determination rule, and the current limiting threshold, and buffer the current limiting configuration locally. The current limiting configuration may be centrally configured and then transmitted to the second receiving unit 404. The current limiting configuration is set according to actual experience, and the embodiment of the present invention is not limited.
The embodiment of the current limiting device for a distributed server provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the embodiment are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 7 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 7, the electronic device may include: a processor (processor)701, a communication Interface (Communications Interface)702, a memory (memory)703 and a communication bus 704, wherein the processor 701, the communication Interface 702 and the memory 703 complete communication with each other through the communication bus 704. The processor 701 may call logic instructions in the memory 703 to perform the following method: receiving at least one transaction request; if the transaction request meeting the current-limiting judgment rule exists in the at least one transaction request, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset; and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule.
In addition, the logic instructions in the memory 703 can be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: receiving at least one transaction request; if the transaction requests meeting the current-limiting judgment rule exist in the at least one transaction request, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset; and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: receiving at least one transaction request; if the transaction request meeting the current-limiting judgment rule exists in the at least one transaction request, acquiring the number of the transaction requests in unit time; wherein, the current-limiting judgment rule is preset; and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method for limiting current of a distributed server, comprising:
receiving a plurality of transaction requests;
if the transaction requests meeting the current-limiting judgment rule exist in the transaction requests, acquiring the number of the transaction requests in unit time; wherein the current limit judgment rule is preset;
and if the transaction request quantity in the unit time is judged and known to be larger than the current limiting threshold, rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule.
2. The method of claim 1, wherein the determining that there is a transaction request satisfying a current limit determination rule among the transaction requests comprises:
extracting at least one transaction element from the transaction request; wherein the transaction element is preset;
and if the at least one transaction element is judged to meet the current-limiting judgment rule, determining that the transaction request meets the current-limiting judgment rule.
3. The method of claim 1, wherein obtaining the number of transaction requests per unit of time comprises:
and calculating the sum of the transaction request quantity which is already forwarded in the unit time and the transaction request quantity which meets the current limiting judgment rule to be used as the transaction request quantity in the unit time.
4. The method of any of claims 1 to 3, further comprising:
receiving a current limit configuration, the current limit configuration including a transaction element, the current limit determination rule, and the current limit threshold.
5. A current limiting apparatus for a distributed server, comprising:
a first receiving unit for receiving a plurality of transaction requests;
the judging unit is used for acquiring the transaction request quantity in unit time after judging and knowing that the transaction requests meeting the current-limiting judging rule exist in the transaction requests; wherein the current limit judgment rule is preset;
and the rejecting unit is used for rejecting the transaction requests which exceed the current limiting threshold and meet the current limiting judgment rule after judging that the transaction request number in the unit time is larger than the current limiting threshold.
6. The apparatus according to claim 5, wherein the judging unit includes:
an extraction subunit, configured to extract at least one transaction element from the transaction request; wherein the transaction element is preset;
and the judging subunit is used for determining that the transaction request meets the current-limiting judgment rule after judging that the at least one transaction element meets the current-limiting judgment rule.
7. The apparatus according to claim 5, wherein the determining unit is specifically configured to:
and calculating the sum of the transaction request quantity which is already forwarded in the unit time and the transaction request quantity which meets the current limiting judgment rule to be used as the transaction request quantity in the unit time.
8. The apparatus of any one of claims 5 to 7, further comprising:
a second receiving unit, configured to receive a current limiting configuration, where the current limiting configuration includes a transaction element, the current limiting determination rule, and the current limiting threshold.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1 to 4 are implemented when the program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910698896.8A CN110413416B (en) | 2019-07-31 | 2019-07-31 | Current limiting method and device for distributed server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910698896.8A CN110413416B (en) | 2019-07-31 | 2019-07-31 | Current limiting method and device for distributed server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110413416A CN110413416A (en) | 2019-11-05 |
CN110413416B true CN110413416B (en) | 2022-05-17 |
Family
ID=68364539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910698896.8A Active CN110413416B (en) | 2019-07-31 | 2019-07-31 | Current limiting method and device for distributed server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110413416B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111367645B (en) * | 2020-03-18 | 2023-12-22 | 中国建设银行股份有限公司 | Real-time task scheduling control method, system, equipment and readable storage medium |
CN111709731B (en) * | 2020-06-18 | 2024-11-19 | 深圳前海微众银行股份有限公司 | Transaction processing method and device |
CN112036852A (en) * | 2020-08-25 | 2020-12-04 | 北京达佳互联信息技术有限公司 | Payment processing method and device, server and electronic equipment |
CN112492036A (en) * | 2020-12-01 | 2021-03-12 | 成都颜创启新信息技术有限公司 | Information processing method and device, electronic equipment and storage medium |
CN112600801A (en) * | 2020-12-03 | 2021-04-02 | 深圳奥哲网络科技有限公司 | Flow access control method, equipment and storage medium |
CN112925639B (en) * | 2021-02-10 | 2024-06-28 | 中国工商银行股份有限公司 | Adaptive transaction flow limiting method, device and system |
CN113434735A (en) * | 2021-06-24 | 2021-09-24 | 未鲲(上海)科技服务有限公司 | Self-adaptive current limiting method, device, server and storage medium |
CN114338811B (en) * | 2021-12-30 | 2024-01-30 | 中国农业银行股份有限公司 | Transaction flow limiting method, device, server, storage medium and product |
CN114615073B (en) * | 2022-03-22 | 2024-07-26 | 广州方硅信息技术有限公司 | Access flow control method and device, equipment and medium thereof |
CN115242723B (en) * | 2022-07-20 | 2024-03-01 | 中国银行股份有限公司 | Cross-system current limiting method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106375472A (en) * | 2016-09-29 | 2017-02-01 | 北京三快在线科技有限公司 | Access request processing method and apparatus, and server |
CN107592300A (en) * | 2017-08-16 | 2018-01-16 | 中国银行股份有限公司 | A kind of method and system of anti-robot attack |
CN107707488A (en) * | 2017-10-25 | 2018-02-16 | 北京数码视讯支付技术有限公司 | Payment online transaction flow control method, flow limiting server and client |
CN108073465A (en) * | 2017-12-29 | 2018-05-25 | 中国平安人寿保险股份有限公司 | Dynamic current limiting method, Nginx servers, storage medium and device |
CN110011977A (en) * | 2019-03-07 | 2019-07-12 | 北京华安普特网络科技有限公司 | A kind of web portal security defence method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2411492B (en) * | 2004-02-25 | 2006-06-07 | Patsystems | Electronic trading system |
-
2019
- 2019-07-31 CN CN201910698896.8A patent/CN110413416B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106375472A (en) * | 2016-09-29 | 2017-02-01 | 北京三快在线科技有限公司 | Access request processing method and apparatus, and server |
CN107592300A (en) * | 2017-08-16 | 2018-01-16 | 中国银行股份有限公司 | A kind of method and system of anti-robot attack |
CN107707488A (en) * | 2017-10-25 | 2018-02-16 | 北京数码视讯支付技术有限公司 | Payment online transaction flow control method, flow limiting server and client |
CN108073465A (en) * | 2017-12-29 | 2018-05-25 | 中国平安人寿保险股份有限公司 | Dynamic current limiting method, Nginx servers, storage medium and device |
CN110011977A (en) * | 2019-03-07 | 2019-07-12 | 北京华安普特网络科技有限公司 | A kind of web portal security defence method |
Also Published As
Publication number | Publication date |
---|---|
CN110413416A (en) | 2019-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110413416B (en) | Current limiting method and device for distributed server | |
CN111404887B (en) | Service processing method and device | |
CN108416665B (en) | Data interaction method and device, computer equipment and storage medium | |
CN111538572B (en) | Task processing method, device, scheduling server and medium | |
CN114223177A (en) | Access control method, apparatus, server and computer readable medium | |
CN112398945A (en) | Service processing method and device based on backpressure | |
US11734077B2 (en) | Evaluation device, evaluation method and evaluation program | |
WO2020248687A1 (en) | Method and apparatus for preventing malicious attack | |
CN111343102A (en) | Flow rate control method, server-side server, client-side server and system | |
CN114268957A (en) | Abnormal business data processing method, device, server and storage medium | |
CN107589990A (en) | A kind of method and system of the data communication based on thread pool | |
CN117592685A (en) | Service processing method, device, electronic equipment and storage medium | |
CN109120527B (en) | Method and system for transmitting service flow | |
CN110995796A (en) | Data transmission method and device based on private line | |
CN113973084B (en) | A flow control method and device | |
CN113765871A (en) | Fortress management method and device | |
CN106547609A (en) | A kind of event-handling method and equipment | |
CN110620733A (en) | Service flow control method and device | |
CN115733800A (en) | Network card selection method, system, electronic device and medium | |
CN109033189B (en) | Compression method and device of link structure log, server and readable storage medium | |
CN115118782A (en) | Data control method and device, electronic equipment and computer readable storage medium | |
CN112529435A (en) | Resource allocation method and device | |
CN109445934B (en) | Query request distribution method and system | |
CN113590325A (en) | Hotel distributor interface current limiting method and device, computer equipment and storage medium | |
CN114629973B (en) | Message processing method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |