CN113779019A - Current limiting method and device based on annular linked list - Google Patents

Current limiting method and device based on annular linked list Download PDF

Info

Publication number
CN113779019A
CN113779019A CN202110050553.8A CN202110050553A CN113779019A CN 113779019 A CN113779019 A CN 113779019A CN 202110050553 A CN202110050553 A CN 202110050553A CN 113779019 A CN113779019 A CN 113779019A
Authority
CN
China
Prior art keywords
data
linked list
tail pointer
server
current 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.)
Pending
Application number
CN202110050553.8A
Other languages
Chinese (zh)
Inventor
姜振飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110050553.8A priority Critical patent/CN113779019A/en
Publication of CN113779019A publication Critical patent/CN113779019A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation 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/5055Allocation 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 software capabilities, i.e. software resources associated or available to the machine

Abstract

The invention discloses a current limiting method and device based on a circular linked list, and relates to the technical field of computers. One embodiment of the method comprises: initializing a storage space of the annular linked list and a head pointer and a tail pointer pointing to a space address of the annular linked list; storing data to be transmitted into a storage space of the annular linked list; setting the position of the tail pointer according to the data flow limiting information to control the transmission rate of data; transmitting the data in the circular linked list from the head pointer to the tail pointer to a server through traversal from the head pointer to the tail pointer of the circular linked list. Therefore, the embodiment of the invention can solve the problem of current limiting according to the circular linked list and improve the service processing capacity.

Description

Current limiting method and device based on annular linked list
Technical Field
The invention relates to the technical field of computers, in particular to a current limiting method and device based on a circular linked list.
Background
Conventionally, a leaky bucket algorithm is used as a current limiting method. The leaky bucket algorithm limits the outlet flow rate by a constant amount, when the inlet flow rate is greater than the outlet flow rate, because the flow container is limited, when the flow container size is exceeded, the excess flow is discarded. In addition, a counter fixed window algorithm can be adopted as a current limiting mode. The algorithm maintains a count per unit time, increments the count by 1 each time a request passes, and rejects other requests per unit time when the count exceeds a predetermined threshold.
The prior art has at least the following problems:
1. when a large number of instantaneous requests are sent to the server, a large amount of data can be rejected if a leaky bucket algorithm is used, and meanwhile, the utilization rate of the server cannot be improved if the server is in an idle state.
2. In the counter fixed window algorithm, assuming that the allowed request threshold is 200 in 1 second, if a user sends 200 requests in the last few milliseconds of a time window and then 200 requests at the beginning of the next time window, the user has actually successfully requested 400 times in one second, thereby exceeding the threshold without being throttled.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for current limiting based on a circular linked list, which can solve the problem of current limiting according to the circular linked list and improve service processing capability.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for limiting current based on a circular linked list, including:
initializing a storage space of the annular linked list and a head pointer and a tail pointer pointing to a space address of the annular linked list;
storing data to be transmitted into a storage space of the annular linked list;
setting the position of the tail pointer according to data flow limiting information to control the transmission rate of the data;
transmitting the data in the circular linked list from the head pointer to the tail pointer to a server through traversal from the head pointer to the tail pointer of the circular linked list.
Preferably, the setting of the position of the tail pointer to control the transfer rate of the data according to the data restriction information includes:
setting a current limit threshold in the data current limit information by monitoring a performance index of the server,
adjusting a position of the tail pointer based on the current limit threshold.
Preferably, the performance indicators of the server include: at least one of time a user requests and responds to the server, monitoring of service anomalies, and service resource usage.
Preferably, when the time for the user to request the server and respond exceeds a preset time, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
When the time that the user requests the server and responds is monitored not to exceed the preset time, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards to improve the transmission rate of the data.
Preferably, when the server is monitored to be abnormal, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
And when the server is monitored to work normally, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the transmission rate of the data.
Preferably, when the monitored resource utilization rate of the server exceeds a preset threshold, the current limiting threshold is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
And when the resource utilization rate of the server is monitored not to exceed a preset threshold value, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the transmission rate of the data.
Preferably, the resource utilization rate includes a CPU utilization rate, a memory utilization rate, or a connection number.
According to another aspect of the embodiments of the present invention, there is provided a device for limiting current based on a linked list, including:
the initialization unit initializes the storage space of the annular linked list and a head pointer and a tail pointer pointing to the space address of the annular linked list;
the data storage unit is used for storing the data with the transmission into the storage space of the annular linked list;
the data current limiting unit is used for setting the position of the tail pointer according to data current limiting information so as to control the transmission rate of the data; and
a data transfer unit that transfers the data from the head pointer to the tail pointer in the circular linked list to a server through traversal from the head pointer to the tail pointer of the circular linked list.
According to another aspect of the embodiments of the present invention, there is provided a current limiting electronic device based on a circular linked list, including:
one or more processors; and
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 a method as in the above aspects.
According to another aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of the above aspect.
One embodiment of the above invention has the following advantages or benefits: the current limiting scheme based on the annular linked list controls the request rate through the annular linked list, so that the service processing request capacity can be dynamically improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a circular linked list based current limiting method according to an embodiment of the present invention;
FIG. 2 is a specific flowchart of a method for limiting current based on a circular linked list according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of a circular linked list according to an embodiment of the present invention;
FIG. 3b is a diagram of an overall pointer structure of a circular linked list according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of monitoring performance of a server according to an embodiment of the invention;
FIG. 5 is a schematic diagram of the major modules of a circular linked list based current limiting apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed; and
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of a main flow of a circular linked list based current limiting method according to an embodiment of the present invention; as shown in fig. 1, the method for limiting current based on a circular linked list includes: step S101, initializing a storage space of an annular linked list and a head pointer and a tail pointer pointing to a space address of the annular linked list; step S102, storing the data to be transmitted into a storage space of an annular linked list; step S103, setting the position of the tail pointer according to the data flow limiting information to control the transmission rate of the data; and step S104, transmitting the data from the head pointer to the tail pointer in the circular linked list to the server through traversal from the head pointer to the tail pointer of the circular linked list.
Preferably, step S103 specifically includes: and setting a current limiting threshold value in the data current limiting information by monitoring the performance index of the server, and adjusting the position of the tail pointer based on the current limiting threshold value.
The performance indicators of the server include, for example: at least one of time a user requests and responds to the server, monitoring of service anomalies, and service resource usage.
When the time that the user requests the server and responds exceeds the preset time is monitored, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and when the time that the user requests the server and responds is monitored not to exceed the preset time, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards to improve the data transmission rate.
When the server is monitored to be abnormal, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the data transmission rate; and when the server is monitored to work normally, the current limit threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the data transmission rate.
When the resource utilization rate of the server exceeds a preset threshold value, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the data transmission rate; and when the resource utilization rate of the server is monitored not to exceed a preset threshold value, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the data transmission rate.
The resource usage includes, for example, CPU usage, memory usage, or the number of connections.
Specific examples of a method of restricting current based on a circular linked list according to an embodiment of the present invention are described below with reference to fig. 2 to 4.
Fig. 2 shows a specific flow example of a circular linked list-based current limiting method according to an embodiment of the present invention.
As shown in fig. 2, in step S1, the circular linked list, the head pointer and the tail pointer are initialized, the space size of the linked list is determined according to the estimated data amount, and two pointers, namely the head pointer and the tail pointer, point to one of the space addresses.
The purpose of the circular linked list module is to temporarily store the requested data. FIG. 3a is a diagram illustrating a circular linked list according to an embodiment of the present invention. The circular linked list is a limited space linked list, each space of the circular queue stores request data, each request data can be regarded as an object, and the structure of the object is as follows:
requesting content Next pointer
Where the next pointer is a pointer to the next object. The overall pointer structure is shown in fig. 3 (b).
In step S2, the circular linked list receives the request data. When the request content is received, the request content is stored in the storage space of the circular linked list in turn, for example, as shown in fig. 3b, the request content1, content2, content3 and content4 are stored in the space of the circular linked list.
In step S3, a tail pointer is set to point to the corresponding spatial address according to the default current limiting threshold. The position of the tail pointer is adjusted according to the set current limit threshold, e.g., three requests are limited to be sent per second, and the tail pointer is pointed to the position of content 3.
Step S4: and traversing the data of the circular linked list from the head pointer to the tail pointer and sending the data to the server for processing.
Step S5: server performance is monitored in real time and then the position of the tail pointer, i.e., the current limit threshold, is dynamically adjusted.
The purpose of server performance monitoring is to maximize the utilization of service processing capacity. If the current phase service has no other tasks to process, then the current limit rate is automatically discovered and increased, e.g., by 4 requests per second, then the tail pointer will be moved back from the content3 position to the content4 position. The rate is at most the maximum spatial value of the circular queue. Therefore, using this scheme requires a prediction of service performance.
Specifically, referring to fig. 4, performance monitoring of the server is performed by collecting monitored indexes using, for example, an Nginx server. The performance index of the server mainly comprises at least one of the following:
(1) time when user requests server and responds
For example, the corresponding time can be obtained by using the self-contained parameter $ request _ time of Nginx, if the normal access time is exceeded, such as 10 times in 200ms, the performance of the server interface is poor, and if the interface is called frequently for a long time, the server will be failed. Therefore, it is necessary to adjust the current limit threshold downward using Nginx and advance the tail pointer to limit the array transfer rate. If the monitored user requests the server and responds for a time that does not exceed the normal access time, the throttling threshold may be adjusted upward to increase the data transfer rate.
(2) Service anomaly monitoring
For example, if the server suddenly returns 502 (interface timeout) or 504 (service failure), etc., the current limiting threshold may be dynamically adjusted by Nginx according to the status code returned by the server, and the tail pointer is moved forward; and when the service is available, the current limit threshold is raised and the tail pointer is moved backward.
(3) Service resource usage rate
For example, the server resource utilization rate, including CPU utilization rate, memory utilization rate, connection number, etc., is counted per minute using the nginnx. For example, when the CPU memory usage exceeds a certain threshold (e.g., 90%), the current limit threshold is adjusted downward to move the tail pointer forward, and when the CPU memory usage does not exceed the certain threshold, the current limit threshold is adjusted upward to move the tail pointer backward.
When the head pointer and the tail pointer point to the same storage space of the circular linked list, the circular linked list is full. In this case, the circular linked list does not limit the speed of the transmitting end, thereby improving the transmission performance.
When the current limit for data transfer is high, this may result in slow processing and received requests exceeding the processing rate, and thus a full link may occur. This needs to be solved by adding a circular linked list, i.e. processing the requested data simultaneously with multiple circular linked lists. For example: the speed limit is 2 requests per second, and 4 received requests per second are 4 requests, so that 2 more requests per second are stored in a linked list; if the link capacity is 10 requests, the circular links are full after 5 seconds, so that one machine needs to be added to receive the requests (which is equivalent to processing the requests by two circular links), so that 2 requests are processed on one server, and the other 2 requests are processed on the other server. Thereby preventing the storage space of the linked list from being full.
According to the current limiting method based on the annular linked list, the request rate can be controlled through the annular linked list, and therefore the service processing request capacity can be dynamically improved.
Fig. 5 is a schematic diagram of main modules of a circular linked list based current limiting apparatus according to an embodiment of the present invention. As shown in fig. 5, the circular linked list-based current limiting apparatus 200 includes: an initialization unit 201, which initializes a storage space of the circular linked list and a head pointer and a tail pointer pointing to a space address of the circular linked list; a data storage unit 202, which stores the data to be transmitted into the storage space of the circular linked list; a data stream limiting unit 203 for setting the position of the tail pointer according to the data stream limiting information to control the transmission rate of the data; and a data transfer unit 204 that transfers data from the head pointer to the tail pointer in the circular linked list to the server through traversal from the head pointer to the tail pointer of the circular linked list.
The data current limiting unit 203 sets a current limiting threshold in the data current limiting information by monitoring the performance index of the server, and adjusts the position of the tail pointer based on the current limiting threshold.
The performance indicators of the server include, for example: at least one of time a user requests and responds to the server, monitoring of service anomalies, and service resource usage.
Preferably, when the data throttling unit 203 monitors that the time for the user to request the server and respond exceeds the preset time, the throttling threshold is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and when the data throttling unit 203 monitors that the time for the user to request the server and respond does not exceed the preset time, the throttling threshold value is adjusted upwards, and the tail pointer is moved backwards to improve the transmission rate of the data.
Preferably, when the data throttling unit 203 monitors that the server is abnormal, the throttling threshold is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and when the data current limiting unit 203 monitors that the server works normally, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the transmission rate of the data.
Preferably, when the data throttling unit 203 monitors that the resource utilization rate of the server exceeds a predetermined threshold, the throttling threshold is adjusted downward, and the tail pointer is moved forward to reduce the transmission rate of the data; and when the data flow limiting unit 203 monitors that the resource utilization rate of the server does not exceed a preset threshold, the flow limiting threshold is adjusted upwards, and the tail pointer is moved backwards to improve the transmission rate of the data.
The resource usage includes, for example, CPU usage, memory usage, or the number of connections.
According to the current limiting device based on the annular linked list, the request rate can be controlled through the annular linked list, and therefore the service processing request capacity can be dynamically improved.
Fig. 6 illustrates an exemplary system architecture 600 of a circular linked list based current limiting method or a circular linked list based current limiting apparatus to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as a web browser application, a search-type application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for limiting current based on a circular linked list provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the current limiting apparatus based on a circular linked list is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. 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 of the computer readable storage medium may include, but are not limited to: 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 present invention, 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. In the present invention, however, 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an initialization unit, a data storage unit, a data throttling unit, and a data transmission unit. Where the names of these elements do not in some cases constitute a limitation on the elements themselves, for example, an initialization element may also be described as an "element that initializes the storage space of a circular linked list and the head and tail pointers to the spatial addresses of the circular linked list".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: initializing a storage space of the annular linked list and a head pointer and a tail pointer pointing to a space address of the annular linked list; storing data to be transmitted into a storage space of the annular linked list; setting the position of a tail pointer according to the data flow limiting information to control the transmission rate of data; and transmitting the data from the head pointer to the tail pointer in the circular linked list to the server through traversing from the head pointer to the tail pointer of the circular linked list.
According to the current limiting method based on the annular linked list and the current limiting device based on the annular linked list, the request rate can be controlled through the annular linked list, and therefore the service processing request capacity can be dynamically improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for limiting current based on a circular linked list is characterized by comprising the following steps:
initializing a storage space of the annular linked list and a head pointer and a tail pointer pointing to a space address of the annular linked list;
storing data to be transmitted into a storage space of the annular linked list;
setting the position of the tail pointer according to data flow limiting information to control the transmission rate of the data;
transmitting the data in the circular linked list from the head pointer to the tail pointer to a server through traversal from the head pointer to the tail pointer of the circular linked list.
2. The circular linked list-based current limiting method of claim 1, wherein setting the position of the tail pointer to control the transfer rate of the data according to data current limiting information comprises:
setting a current limit threshold in the data current limit information by monitoring a performance index of the server,
adjusting a position of the tail pointer based on the current limit threshold.
3. The method of claim 2,
the performance indexes of the server comprise: at least one of time a user requests and responds to the server, monitoring of service anomalies, and service resource usage.
4. The method of claim 3,
when the time that the user requests the server and responds is monitored to exceed the preset time, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
When the time that the user requests the server and responds is monitored not to exceed the preset time, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards to improve the transmission rate of the data.
5. The method of claim 3,
when the server is monitored to be abnormal, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
And when the server is monitored to work normally, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the transmission rate of the data.
6. The method of claim 3,
when the monitored resource utilization rate of the server exceeds a preset threshold value, the current limiting threshold value is adjusted downwards, and the tail pointer is moved forwards to reduce the transmission rate of the data; and is
And when the resource utilization rate of the server is monitored not to exceed a preset threshold value, the current limiting threshold value is adjusted upwards, and the tail pointer is moved backwards so as to improve the transmission rate of the data.
7. The method of claim 6,
the resource utilization rate comprises a CPU utilization rate, a memory utilization rate or a connection number.
8. A current limiting device based on a circular linked list, comprising:
the initialization unit initializes the storage space of the annular linked list and a head pointer and a tail pointer pointing to the space address of the annular linked list;
the data storage unit is used for storing the data with the transmission into the storage space of the annular linked list;
the data current limiting unit is used for setting the position of the tail pointer according to data current limiting information so as to control the transmission rate of the data; and
a data transfer unit that transfers the data from the head pointer to the tail pointer in the circular linked list to a server through traversal from the head pointer to the tail pointer of the circular linked list.
9. A current-limiting electronic device based on a circular linked list, comprising:
one or more processors; and
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 any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110050553.8A 2021-01-14 2021-01-14 Current limiting method and device based on annular linked list Pending CN113779019A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110050553.8A CN113779019A (en) 2021-01-14 2021-01-14 Current limiting method and device based on annular linked list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110050553.8A CN113779019A (en) 2021-01-14 2021-01-14 Current limiting method and device based on annular linked list

Publications (1)

Publication Number Publication Date
CN113779019A true CN113779019A (en) 2021-12-10

Family

ID=78835430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110050553.8A Pending CN113779019A (en) 2021-01-14 2021-01-14 Current limiting method and device based on annular linked list

Country Status (1)

Country Link
CN (1) CN113779019A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6426943B1 (en) * 1998-04-10 2002-07-30 Top Layer Networks, Inc. Application-level data communication switching system and process for automatic detection of and quality of service adjustment for bulk data transfers
US6496873B1 (en) * 1999-05-21 2002-12-17 International Business Machines Corporation Real time device driver interface apparatus and method therefor
US20030121030A1 (en) * 2001-12-21 2003-06-26 Christopher Koob Method for implementing dual link list structure to enable fast link-list pointer updates
CN1567819A (en) * 2003-07-01 2005-01-19 深圳市中兴通讯股份有限公司 A method for timing online subscriber by broad band switch-in server
CN1595910A (en) * 2004-06-25 2005-03-16 中国科学院计算技术研究所 A data packet receiving interface component of network processor and storage management method thereof
US20050201400A1 (en) * 2004-03-15 2005-09-15 Jinsoo Park Maintaining packet sequence using cell flow control
CN102984089A (en) * 2012-11-19 2013-03-20 中兴通讯股份有限公司 Method and device for traffic management and scheduling
US20140348101A1 (en) * 2011-12-14 2014-11-27 Optis Cellular Technology, Llc Buffer resource management method and telecommunication equipment
CN104717087A (en) * 2013-12-15 2015-06-17 中国航空工业集团公司第六三一研究所 Flow processing circuit and method for supporting small service
CN108683601A (en) * 2018-06-06 2018-10-19 千寻位置网络有限公司 Broadcast data current-limiting method, device and data broadcasting system in satellite-based
US20190065371A1 (en) * 2017-08-30 2019-02-28 Red Hat, Inc. Split head invalidation for consumer batching in pointer rings
CN110557341A (en) * 2018-05-31 2019-12-10 北京京东尚科信息技术有限公司 Method and device for limiting data current
WO2020026013A1 (en) * 2018-07-31 2020-02-06 优视科技新加坡有限公司 Data transmission method, apparatus and device/terminal/server and computer readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6426943B1 (en) * 1998-04-10 2002-07-30 Top Layer Networks, Inc. Application-level data communication switching system and process for automatic detection of and quality of service adjustment for bulk data transfers
US6496873B1 (en) * 1999-05-21 2002-12-17 International Business Machines Corporation Real time device driver interface apparatus and method therefor
US20030121030A1 (en) * 2001-12-21 2003-06-26 Christopher Koob Method for implementing dual link list structure to enable fast link-list pointer updates
CN1567819A (en) * 2003-07-01 2005-01-19 深圳市中兴通讯股份有限公司 A method for timing online subscriber by broad band switch-in server
US20050201400A1 (en) * 2004-03-15 2005-09-15 Jinsoo Park Maintaining packet sequence using cell flow control
CN1595910A (en) * 2004-06-25 2005-03-16 中国科学院计算技术研究所 A data packet receiving interface component of network processor and storage management method thereof
US20140348101A1 (en) * 2011-12-14 2014-11-27 Optis Cellular Technology, Llc Buffer resource management method and telecommunication equipment
CN102984089A (en) * 2012-11-19 2013-03-20 中兴通讯股份有限公司 Method and device for traffic management and scheduling
US20150271108A1 (en) * 2012-11-19 2015-09-24 Zte Corporation Method and Apparatus for Traffic Management Scheduling
CN104717087A (en) * 2013-12-15 2015-06-17 中国航空工业集团公司第六三一研究所 Flow processing circuit and method for supporting small service
US20190065371A1 (en) * 2017-08-30 2019-02-28 Red Hat, Inc. Split head invalidation for consumer batching in pointer rings
CN110557341A (en) * 2018-05-31 2019-12-10 北京京东尚科信息技术有限公司 Method and device for limiting data current
CN108683601A (en) * 2018-06-06 2018-10-19 千寻位置网络有限公司 Broadcast data current-limiting method, device and data broadcasting system in satellite-based
WO2020026013A1 (en) * 2018-07-31 2020-02-06 优视科技新加坡有限公司 Data transmission method, apparatus and device/terminal/server and computer readable storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GWANG KIM ET AL: "FlexiBuffer:reducing leakage power in on-chiip network fouters", 《PROCEEDINGS OF THE 48TH DESIGN AUTOMATION CONFERENCE》, 5 June 2011 (2011-06-05) *
周昕: "基于DPI和DFI的P2P流量识别设计与实现", 《中国硕士学位论文电子期刊》, vol. 2012, no. 3, 15 March 2012 (2012-03-15) *
张明伟;: "双向循环有序链表的设计与实现", 中国科技信息, no. 16, 15 August 2009 (2009-08-15) *

Similar Documents

Publication Publication Date Title
CN109684358B (en) Data query method and device
CN110545246A (en) Token bucket-based current limiting method and device
CN111786895A (en) Method and apparatus for dynamic global current limiting
CN112445857A (en) Resource quota management method and device based on database
US20160094611A1 (en) Managing requests to a high utilization website
CN109428926B (en) Method and device for scheduling task nodes
CN111858040A (en) Resource scheduling method and device
CN112445988A (en) Data loading method and device
CN112788076A (en) Method and device for deploying multi-service load
CN111447113B (en) System monitoring method and device
CN112084042A (en) Message processing method and device
CN113765969A (en) Flow control method and device
CN113742389A (en) Service processing method and device
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN113765964A (en) Method and device for distributing services of distributed system
CN112667368A (en) Task data processing method and device
CN114265692A (en) Service scheduling method, device, equipment and storage medium
CN113779019A (en) Current limiting method and device based on annular linked list
CN112688982B (en) User request processing method and device
CN114374657A (en) Data processing method and device
CN110019671B (en) Method and system for processing real-time message
CN113572704A (en) Information processing method, production end, consumption end and server
CN113761433A (en) Service processing method and device
CN113778730B (en) Service degradation method and device for distributed system
CN113778660A (en) System and method for managing hot spot data

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