CN114513461A - Current limiting method and device, electronic equipment and storage medium - Google Patents

Current limiting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114513461A
CN114513461A CN202210127815.0A CN202210127815A CN114513461A CN 114513461 A CN114513461 A CN 114513461A CN 202210127815 A CN202210127815 A CN 202210127815A CN 114513461 A CN114513461 A CN 114513461A
Authority
CN
China
Prior art keywords
flow
access
current
determining
time
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
CN202210127815.0A
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.)
Lianren Healthcare Big Data Technology Co Ltd
Original Assignee
Lianren Healthcare Big Data 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 Lianren Healthcare Big Data Technology Co Ltd filed Critical Lianren Healthcare Big Data Technology Co Ltd
Priority to CN202210127815.0A priority Critical patent/CN114513461A/en
Publication of CN114513461A publication Critical patent/CN114513461A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a current limiting method, a current limiting device, electronic equipment and a storage medium. The method comprises the following steps: when at least one access request is received, determining the receiving time corresponding to each access request; determining a current detection window based on the receiving time and the detection duration; and determining the total access flow of each flow detection time segment in the current detection window, and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold. The problem of among the prior art based on fixed time window statistics access flow, carry out the current-limiting to all access requests in the time window, lead to flow monitoring effect poor, the current-limiting promptness is low is solved, when realizing improving access flow monitoring precision, also improve the promptness of current-limiting, reach the effect of carrying out accurate current-limiting control to access flow.

Description

Current limiting method and device, electronic equipment and storage medium
Technical Field
The embodiments of the present invention relate to computer processing technologies, and in particular, to a current limiting method and apparatus, an electronic device, and a storage medium.
Background
With the development of internet technology, the number of users of the client is increasing, in the process of client operation, activities or sales promotion needs to be held indefinitely, the activity of the client is improved, at the moment, the access amount of the client is increased sharply, when the access request exceeds a threshold value which can be borne by the system for a long time, the system may be crushed, finally, the whole service is unavailable, a plurality of users of the platform are affected, and therefore accurate current limitation on the access request becomes a problem to be solved urgently.
The existing flow limiting mechanism usually counts access flow in a fixed time window, and performs flow limiting if the access flow exceeds a flow limiting threshold, but during flow limiting, all access requests in the time window need to be limited, which causes problems of low flow monitoring effect and untimely flow limiting.
Disclosure of Invention
Embodiments of the present invention provide a current limiting method, a current limiting device, an electronic device, and a storage medium, so as to improve accuracy of access flow monitoring and timeliness of current limiting, thereby achieving a technical effect of performing accurate current limiting control on access flow.
In a first aspect, an embodiment of the present invention provides a current limiting method, where the method includes:
when at least one access request is received, determining the receiving time corresponding to each access request;
determining a current detection window based on the receiving time and the detection duration;
and determining the total access flow of each flow detection time segment in the current detection window, and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
In a second aspect, an embodiment of the present invention further provides a current limiting device, where the device includes:
the receiving moment determining module is used for determining the receiving moment corresponding to each access request when at least one access request is received;
a current detection window determining module, configured to determine a current detection window based on the receiving time and the detection duration;
and the flow limiting information determining module is used for determining the total access flow of each flow detection time segment in the current detection window and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the current limiting method according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the current limiting method according to any one of the embodiments of the present invention.
The technical scheme of the embodiment of the invention determines the receiving time corresponding to each access request when receiving at least one access request, determines the current detection window based on the receiving time and the detection duration, further determines the total access flow of each flow detection time segment in the current detection window, and determines the flow limiting information corresponding to at least one access request based on the total access flow and the preset access flow threshold, solves the problems of poor flow monitoring effect and low flow limiting timeliness caused by counting the access flow based on a fixed time window and limiting all the access requests in the time window in the prior art, realizes the purpose of determining the total access flow of the current detection window by recording the access flow of each flow detection time segment in the current detection window in real time, improves the accuracy of access flow monitoring, and is suitable for the service scene of instant large-flow access at a critical point, when the total access flow is larger than the preset access flow threshold, the flow is limited in time, the timeliness of the flow limitation is improved, and the technical effect of performing accurate flow limitation control on the access flow is achieved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart of a current limiting method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a current limiting method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a current limiting device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a current limiting method provided in an embodiment of the present invention, where this embodiment is applicable to monitoring access traffic, and the method may be executed by a current limiting device in an embodiment of the present invention, where the device may be implemented in a software and/or hardware manner, and optionally, the method is implemented by an electronic device, where the electronic device may be a mobile terminal, a PC end, a server end, or the like. The apparatus may be configured in a computing device, and the current limiting method provided in this embodiment specifically includes the following steps:
s110, when at least one access request is received, the receiving time corresponding to each access request is determined.
The access request may be an HTTP (Hyper Text Transfer Protocol) request or an HTTPs (Hyper Text Transfer Protocol over secure session layer) request. For example, in an actual application scenario, when a user clicks a certain control in a browser, it is considered that an access request is triggered, and the access request may be a query request or a deletion request. The access request may carry, but is not limited to, a service identifier, a browser identifier, a request type, a generation time, and the like. When an access request uploaded by a client is detected, the access request is considered to be received, and the receiving time corresponding to the access request can be recorded; when the access request is generated, the system may be considered to have received the access request, and the corresponding acceptance time may be recorded. Accordingly, the receiving time corresponding to a plurality of access requests can be obtained. So that the access flow corresponding to the access request can be counted based on the receiving time.
When at least one access request is received and the receiving time corresponding to each access request is determined, the receiving time may be obtained by analyzing data information in the received access request.
Optionally, when at least one access request is received, determining a receiving time corresponding to each access request includes: receiving at least one access request generated based on a user trigger operation; and analyzing each access request to obtain corresponding receiving time.
The triggering operation may include at least one of clicking, touching, and sliding.
In practical application, a user generates corresponding access requests by using a trigger operation of an input device on a client, and accordingly, the access requests can be received according to the generation time corresponding to each access request, and data carried in each access request can be analyzed during receiving to obtain the receiving time corresponding to each access request.
And S120, determining a current detection window based on the receiving time and the detection duration.
The detection duration can be understood as unit duration of access flow detection, and the access flow refers to internet access amount. The detection window refers to a sliding window, and can be understood as a mechanism for collecting and calculating the number of times of access flow. For example, in a real-time information display scenario, if a sliding window of five-minute transaction details is maintained, all transaction details from the current time to five minutes before need to be recorded, and data before five minutes is discarded, so that data corresponding to the sliding window is dynamically updated, and the window in which data is recorded within the current detection duration can be used as the current detection window.
In this embodiment, in the process of receiving at least one access request, the access request within the detection time length may be determined based on the receiving time corresponding to the access request. For example, the detection duration is 5min, the access request corresponding to the receiving time from the current time to the previous 5min may be recorded, and the access request is counted in a sliding window, that is, the current detection window, to determine the access traffic corresponding to the access request recorded in the current detection window.
It should be noted that the principle of judging the sliding window in the current limiting process is to take the detection time length corresponding to the sliding window as unit time, compare the request number in the sliding window with the request number threshold corresponding to the current limiting condition in each judgment, and then make a decision whether current limiting is needed. Correspondingly, the corresponding access flow detection time length can be determined in advance based on the current service current limiting requirement, the detection time length corresponding to the sliding window is set, and the sliding window is established based on the detection time length, so that the sliding window is applied to carry out current limiting on the access request corresponding to the current service, and the service requirement is met.
Optionally, determining the current detection window based on the receiving time and the detection duration includes: determining detection duration according to the service type corresponding to the target service; determining a received time corresponding to the current receiving time based on the detection time; a current detection window is determined based on the current receive time and the corresponding received time.
Wherein the received time is earlier than the current receiving time.
In this embodiment, the detection duration corresponding to the sliding window may be set according to the service type corresponding to the actual service, for example, in an e-commerce scenario, the detection duration corresponding to the payment service may be set, for example, 1min, and a sliding window of 1min may be correspondingly created for monitoring the access flow in real time. Further, in the flow monitoring process, the received time before the current receiving time within the detection time is determined, and the current receiving time and each received time can be integrated to be used as a current detection window so as to count the access flow of the current detection window.
S130, determining the total access flow of each flow detection time segment in the current detection window, and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
The preset access flow threshold may be determined according to a service requirement corresponding to the target service, for example, the payment service is 1000, the query service is 500, and the like. The traffic detection time slice refers to a time slice in the sliding window, and is used for recording an access request in a corresponding detection duration, optionally, the sliding window includes at least one time slice, for example, the detection duration of the sliding window is 1min, the detection duration of each time slice is 1s, and correspondingly, there are 60 time slices, that is, there are 60 traffic detection time slices. In an actual scenario, after counting the access requests corresponding to the current traffic detection time segment, the access requests corresponding to 59 traffic detection time segments before the current traffic detection time segment may be accumulated, and the access traffic may be determined based on each access request, for example, counting the access traffic may be to count the total number of all access requests, or to count the file sizes of all access requests. The sum of the access traffic corresponding to the 59 traffic detection time slices can be used as the total access traffic of the current detection window.
Specifically, the sum of the access traffic of each traffic detection time segment corresponding to the current detection window may be used as the total access traffic of the current detection window, and then the total access traffic may be compared with a preset access traffic threshold, and if the total access traffic exceeds the preset access traffic threshold, that is, exceeds a current limiting standard, the access request may be limited based on a preset current limiting technology, such as validity verification current limiting, queuing current limiting, and the like.
It should be noted that, when determining the total access traffic of each traffic detection time segment in the current detection window, the detection window may be further divided into a preset number of time segments, that is, traffic detection time segments, and the total inflow number of the access requests may be recorded in each traffic detection time segment, so that the total access traffic of the detection window may be determined based on the total inflow number corresponding to each traffic detection time segment, thereby implementing real-time traffic monitoring on a certain time segment, avoiding server crash caused by an instantaneous peak period of traffic, and improving accuracy of traffic monitoring.
Optionally, determining the total access traffic of each traffic detection time segment in the current detection window includes: dividing a current detection window to obtain at least one flow detection time segment; determining the access flow to be used corresponding to the current flow detection time segment based on the receiving time and the current flow detection time segment aiming at each flow detection time segment; and determining the total access flow corresponding to the current detection window based on the access flow to be used corresponding to each flow detection time segment.
In this embodiment, the detection window may be divided in advance to obtain a preset number of traffic detection time segments, for example, the length of the detection window is selected according to a service requirement, for example, 1 minute is selected. The fixed 1 minute time period may be divided into equal minimum time slice units, such as 1 minute divided into 60 time slices, each time slice unit being 1 second, which are used as the flow rate detection time slices. The more detailed the division of the detection window and the time slice unit, the more accurate the statistics of the flow, which can be determined by the technical personnel according to the specific service scenario, and the technical scheme is not limited. In the process of flow monitoring, access requests corresponding to receiving moments matched with the current flow detection time segments can be recorded, and access flows corresponding to the access requests are counted and used as access flows to be used. The current traffic detection time segment and the access traffic to be used corresponding to each traffic detection time segment with the preset number can be accumulated to be used as the total access traffic corresponding to the current detection window. For example, every time there is an access request in a time slice (1 second), the access amount of the time slice and the previous 59 time slices are accumulated as the total access flow, that is, when the total number of requests of all the access requests in the current detection window is calculated, the access flow in all the time slices in the current detection window is accumulated.
It should be noted that, when determining the to-be-used access traffic corresponding to the current traffic detection time segment based on the receiving time and the current traffic detection time segment, the access request at the receiving time corresponding to the current traffic detection time segment may be recorded in the current traffic detection time segment as the to-be-used access traffic corresponding to the current traffic detection time segment.
Optionally, determining, based on the receiving time and the current traffic detection time segment, an access traffic to be used corresponding to the current traffic detection time segment, includes: determining at least one access request corresponding to the current traffic detection time slice based on the receiving time; and determining the access flow to be used corresponding to the current flow detection time slice based on each access request.
In practical application, the access requests at the receiving time corresponding to the current traffic detection time segment may be counted, if the current traffic detection time segment is 1s, all the access requests corresponding to the receiving time within 1s may be counted, and the access traffic corresponding to each access request may be used as the access traffic corresponding to the current traffic detection time segment, that is, the access traffic to be used. It should be noted that the traffic of the traffic detection time slice may be stored in a key/value manner. The key is composed of a service identifier and a time slice identifier, and the service identifier can be customized according to a service line scene to distinguish different service current limiting standards. The value can be newly added according to the self atomic operation of Redis (Remote Dictionary Server), and the thread safety is ensured.
It should be further noted that, when determining the current limiting information corresponding to at least one access request based on the total access traffic and the preset access traffic threshold, if the total access traffic exceeds the preset access traffic threshold, the corresponding current limiting technology may be used based on the service requirement corresponding to the access request to accurately limit the current of the service, so as to meet the service current limiting requirement.
Optionally, determining, based on the total access traffic and a preset access traffic threshold, current limiting information corresponding to at least one access request includes: and if the total access flow is greater than a preset access flow threshold value, determining the current limiting information based on the service types corresponding to the access requests.
Specifically, the total access traffic may be compared with a preset access traffic threshold, and if the total access traffic is not greater than the preset access traffic threshold, no current limitation is performed. If the total access flow is greater than the preset access flow threshold, the current limiting information corresponding to the service type can be determined based on the type of the actual service, and the current limiting information is utilized to limit the access request corresponding to the current flow detection time segment.
The technical solution of this embodiment is to determine the receiving time corresponding to each access request when receiving at least one access request, determine the current detection window based on the receiving time and the detection duration, further determine the total access flow of each flow detection time segment in the current detection window, and determine the current limiting information corresponding to at least one access request based on the total access flow and the preset access flow threshold, thereby solving the problems of poor flow monitoring effect and low current limiting timeliness caused by counting the access flow based on the fixed time window and limiting all the access requests in the time window in the prior art, and realizing that the total access flow of the current detection window is determined by recording the access flow of each flow detection time segment in the current detection window in real time, the accuracy of access flow monitoring is improved, and the method is applicable to the service scenario of instant large-flow access at the critical point, when the total access flow is larger than the preset access flow threshold, the flow is limited in time, the timeliness of the flow limitation is improved, and the technical effect of performing accurate flow limitation control on the access flow is achieved.
Example two
As an alternative embodiment of the foregoing embodiment, fig. 2 is a schematic diagram of a current limiting method according to a second embodiment of the present invention. Specifically, the following details can be referred to.
Illustratively, a mechanism for acquiring and calculating the number of times of access flow by using a sliding detection window based on Redis three-party cache can be adopted, so that the real-time monitoring of the access flow is realized, and the timeliness and accuracy of flow limiting are improved. And (3) building a distributed Redis cache cluster with a sentinel model, ensuring the uniqueness, high-performance reading and writing and high availability of a counted data source, and selecting the length of a sliding detection window, namely the detection duration of the detection window, for example, selecting 1 minute according to business requirements. The minimum time unit of the flow detection time slice is confirmed, for example, 1 second is selected. The fixed time period (1 minute) may be divided into equal minimum time slice units (1 second), for example, 1 minute is divided into 60 time slices, that is, traffic detection time slices, each time slice unit is 1 second, referring to fig. 2, the current detection window 1 includes time slice 1, time slice 2, and time slice 3. For example, the access amounts of the time slice 60 and the previous 59 time slices are accumulated as the total access flow, and the current limiting is performed if the current limiting standard is exceeded. Every time a time slice (1 second) passes, the time window (the time period of which the flow needs to be counted) slides one time slice to the right, for example, the time slice 1 in fig. 2 is moved out, the access flow corresponding to the time slices 2 and 3 is counted, and the time slice 61 is taken as the current flow detection time slice. The total number of requests for all requests within the sliding detection window is counted up over all time slices. The more detailed the sliding detection window and the time slice unit division, the more accurate the statistics of the traffic, which is determined by the specific traffic scenario. The flow of the flow detection time slice can be stored in a key/value mode. The key is composed of a service identifier and a time slice identifier, and the service identifier can be customized according to a service line scene to distinguish different service current limiting standards. value can be newly added according to the atomic operation carried by Redis, and thread safety is guaranteed.
The technical solution of this embodiment is to determine the receiving time corresponding to each access request when receiving at least one access request, determine the current detection window based on the receiving time and the detection duration, further determine the total access flow of each flow detection time segment in the current detection window, and determine the current limiting information corresponding to at least one access request based on the total access flow and the preset access flow threshold, thereby solving the problems of poor flow monitoring effect and low current limiting timeliness caused by counting the access flow based on the fixed time window and limiting all the access requests in the time window in the prior art, and realizing that the total access flow of the current detection window is determined by recording the access flow of each flow detection time segment in the current detection window in real time, the accuracy of access flow monitoring is improved, and the method is applicable to the service scenario of instant large-flow access at the critical point, when the total access flow is larger than the preset access flow threshold, the flow is limited in time, the timeliness of the flow limitation is improved, and the technical effect of performing accurate flow limitation control on the access flow is achieved.
EXAMPLE III
Fig. 3 is a block diagram of a current limiting device according to a third embodiment of the present invention. The device includes: a reception time determination module 310, a current detection window determination module 320, and a current limit information determination module 330.
The receiving time determining module 310 is configured to determine a receiving time corresponding to each access request when at least one access request is received; a current detection window determining module 320, configured to determine a current detection window based on the receiving time and the detection duration; a current limiting information determining module 330, configured to determine a total access traffic of each traffic detection time segment in the current detection window, and determine current limiting information corresponding to the at least one access request based on the total access traffic and a preset access traffic threshold.
The technical solution of this embodiment is to determine the receiving time corresponding to each access request when receiving at least one access request, determine the current detection window based on the receiving time and the detection duration, further determine the total access flow of each flow detection time segment in the current detection window, and determine the current limiting information corresponding to at least one access request based on the total access flow and the preset access flow threshold, thereby solving the problems of poor flow monitoring effect and low current limiting timeliness caused by counting the access flow based on the fixed time window and limiting all the access requests in the time window in the prior art, and realizing that the total access flow of the current detection window is determined by recording the access flow of each flow detection time segment in the current detection window in real time, the accuracy of access flow monitoring is improved, and the method is applicable to the service scenario of instant large-flow access at the critical point, when the total access flow is larger than the preset access flow threshold, the flow is limited in time, the timeliness of the flow limitation is improved, and the technical effect of performing accurate flow limitation control on the access flow is achieved.
On the basis of the foregoing apparatus, optionally, the receiving time determining module 310 includes: an access request receiving unit and a reception time determining unit.
An access request receiving unit, configured to receive at least one access request generated based on a user trigger operation;
and the receiving time determining unit is used for analyzing and processing each access request to obtain corresponding receiving time.
Based on the above apparatus, optionally, the current detection window determining module 320 includes a detection duration determining unit, a received time determining unit, and a current detection window determining unit.
The detection duration determining unit is used for determining the detection duration according to the service type corresponding to the target service;
a received time determining unit configured to determine a received time corresponding to a current receiving time based on the detection duration; wherein the received time is earlier than the current receiving time;
and the current detection window determining unit is used for determining a current detection window based on the current receiving time and the corresponding received time.
On the basis of the above device, optionally, the flow limiting information determining module 330 includes a flow detection time slice obtaining unit, a to-be-used access flow determining unit, and a total access flow determining unit.
A traffic detection time segment obtaining unit, configured to divide the current detection window to obtain at least one traffic detection time segment;
a to-be-used access flow determining unit, configured to determine, for each flow detection time segment, a to-be-used access flow corresponding to the current flow detection time segment based on the receiving time and the current flow detection time segment;
and the total access flow determining unit is used for determining the total access flow corresponding to the current detection window based on the to-be-used access flow corresponding to each flow detection time segment.
On the basis of the foregoing apparatus, optionally, the to-be-used access traffic determining unit includes an access request determining subunit and a to-be-used access traffic determining subunit.
An access request determining subunit, configured to determine, based on the receiving time, at least one access request corresponding to the current traffic detection time slice;
and the to-be-used access flow determining subunit is used for determining to-be-used access flow corresponding to the current flow detection time slice based on each access request.
On the basis of the above device, optionally, the current limit information determining module 330 further includes a current limit information determining unit.
And the current limiting information determining unit is used for determining current limiting information based on the service type corresponding to each access request if the total access flow is greater than a preset access flow threshold.
The current limiting device provided by the embodiment of the invention can execute the current limiting method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement the current limiting method provided by the embodiment of the present invention.
EXAMPLE five
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method of limiting current. The method comprises the following steps:
when at least one access request is received, determining the receiving time corresponding to each access request;
determining a current detection window based on the receiving time and the detection duration;
and determining the total access flow of each flow detection time segment in the current detection window, and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of limiting current, comprising:
when at least one access request is received, determining the receiving time corresponding to each access request;
determining a current detection window based on the receiving time and the detection duration;
and determining the total access flow of each flow detection time slice in the current detection window, and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
2. The method of claim 1, wherein determining a receiving time corresponding to each access request when receiving at least one access request comprises:
receiving at least one access request generated based on a user trigger operation;
and analyzing each access request to obtain corresponding receiving time.
3. The method of claim 1, wherein determining a current detection window based on the receiving time and a detection duration comprises:
determining detection duration according to the service type corresponding to the target service;
determining a received time corresponding to the current receiving time based on the detection duration; wherein the received time is earlier than the current receiving time;
and determining a current detection window based on the current receiving time and the corresponding received time.
4. The method of claim 1, wherein the determining the total access traffic for each traffic detection time segment in the current detection window comprises:
dividing the current detection window to obtain at least one flow detection time segment;
for each flow detection time segment, determining the access flow to be used corresponding to the current flow detection time segment based on the receiving time and the current flow detection time segment;
and determining the total access flow corresponding to the current detection window based on the to-be-used access flow corresponding to each flow detection time segment.
5. The method of claim 4, wherein determining the to-be-used access traffic corresponding to the current traffic detection time slice based on the receiving time and the current traffic detection time slice comprises:
determining at least one access request corresponding to the current traffic detection time slice based on the receiving time;
and determining the access flow to be used corresponding to the current flow detection time segment based on each access request.
6. The method of claim 1, wherein determining the throttling information corresponding to the at least one access request based on the total access traffic and a preset access traffic threshold comprises:
and if the total access flow is greater than a preset access flow threshold value, determining current limiting information based on the service type corresponding to each access request.
7. A current limiting device, comprising:
the receiving moment determining module is used for determining the receiving moment corresponding to each access request when at least one access request is received;
a current detection window determining module, configured to determine a current detection window based on the receiving time and the detection duration;
and the flow limiting information determining module is used for determining the total access flow of each flow detection time segment in the current detection window and determining the flow limiting information corresponding to the at least one access request based on the total access flow and a preset access flow threshold.
8. The apparatus of claim 7, wherein the receiving time determining module comprises:
an access request receiving unit, configured to receive at least one access request generated based on a user trigger operation;
and the receiving time determining unit is used for analyzing and processing each access request to obtain corresponding receiving time.
9. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of limiting current as recited in any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of limiting current according to any one of claims 1 to 6.
CN202210127815.0A 2022-02-11 2022-02-11 Current limiting method and device, electronic equipment and storage medium Pending CN114513461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210127815.0A CN114513461A (en) 2022-02-11 2022-02-11 Current limiting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210127815.0A CN114513461A (en) 2022-02-11 2022-02-11 Current limiting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114513461A true CN114513461A (en) 2022-05-17

Family

ID=81552164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210127815.0A Pending CN114513461A (en) 2022-02-11 2022-02-11 Current limiting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114513461A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683605A (en) * 2018-06-12 2018-10-19 阿里巴巴集团控股有限公司 A kind of current-limiting method and device of service call
CN110166371A (en) * 2019-05-16 2019-08-23 北京达佳互联信息技术有限公司 Flow control methods, device, electronic equipment and storage medium
CN111262795A (en) * 2020-01-08 2020-06-09 京东数字科技控股有限公司 Service interface-based current limiting method and device, electronic equipment and storage medium
CN111352967A (en) * 2020-02-27 2020-06-30 携程旅游网络技术(上海)有限公司 Frequency control method, system, device and medium for sliding window algorithm
CN112200397A (en) * 2019-07-08 2021-01-08 中国移动通信集团湖南有限公司 Service monitoring and early warning implementation method
CN112866179A (en) * 2019-11-27 2021-05-28 北京沃东天骏信息技术有限公司 Current limiting method and current limiting device
CN113285883A (en) * 2021-05-25 2021-08-20 挂号网(杭州)科技有限公司 Access request current limiting method and device, electronic equipment and storage medium
CN113726683A (en) * 2021-09-09 2021-11-30 海尔数字科技(青岛)有限公司 Access current limiting method, device, equipment, storage medium and computer program product
CN113765814A (en) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 Network access current limiting method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683605A (en) * 2018-06-12 2018-10-19 阿里巴巴集团控股有限公司 A kind of current-limiting method and device of service call
CN110166371A (en) * 2019-05-16 2019-08-23 北京达佳互联信息技术有限公司 Flow control methods, device, electronic equipment and storage medium
CN112200397A (en) * 2019-07-08 2021-01-08 中国移动通信集团湖南有限公司 Service monitoring and early warning implementation method
CN112866179A (en) * 2019-11-27 2021-05-28 北京沃东天骏信息技术有限公司 Current limiting method and current limiting device
CN111262795A (en) * 2020-01-08 2020-06-09 京东数字科技控股有限公司 Service interface-based current limiting method and device, electronic equipment and storage medium
CN111352967A (en) * 2020-02-27 2020-06-30 携程旅游网络技术(上海)有限公司 Frequency control method, system, device and medium for sliding window algorithm
CN113765814A (en) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 Network access current limiting method and device
CN113285883A (en) * 2021-05-25 2021-08-20 挂号网(杭州)科技有限公司 Access request current limiting method and device, electronic equipment and storage medium
CN113726683A (en) * 2021-09-09 2021-11-30 海尔数字科技(青岛)有限公司 Access current limiting method, device, equipment, storage medium and computer program product

Similar Documents

Publication Publication Date Title
EP3968159A1 (en) Performance monitoring in a distributed storage system
CN112367269A (en) Double-pointer-based sliding window current limiting method, device, equipment and storage medium
CN109561212B (en) Merging method, device, equipment and storage medium for published information
WO2019232821A1 (en) Method for processing risk control data, device, computer apparatus, and storage medium
US10015181B2 (en) Using natural language processing for detection of intended or unexpected application behavior
CN114595765A (en) Data processing method and device, electronic equipment and storage medium
US11651031B2 (en) Abnormal data detection
CN110855658B (en) Service login method, device, equipment and storage medium
CN111784176A (en) Data processing method, device, server and medium
CN114513461A (en) Current limiting method and device, electronic equipment and storage medium
CN110659280A (en) Road blocking abnormity detection method and device, computer equipment and storage medium
US11200138B1 (en) Policy-based request tracing using a computer
CN115016890A (en) Virtual machine resource allocation method and device, electronic equipment and storage medium
CN113225325B (en) IP (Internet protocol) blacklist determining method, device, equipment and storage medium
CN110569182B (en) Crash rate calculation method and device, computer equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN114205156A (en) Message detection method and device for tangent plane technology, electronic equipment and medium
US8949862B2 (en) Rate of operation progress reporting
CN113760589A (en) Service fusing method and device based on real-time stream processing framework
CN113760988A (en) Method, device, equipment and storage medium for associating and processing unbounded stream data
CN113760989A (en) Method, device and equipment for processing unbounded stream data and storage medium
CN112003833A (en) Abnormal behavior detection method and device
US9633061B2 (en) Methods for determining event counts based on time-sampled data
CN111162968A (en) Cloud resource use efficiency metering method and device, electronic equipment and storage medium
CN111026612A (en) Application program operation monitoring method and device, storage medium and electronic equipment

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