CN113271265A - Request queue dynamic adjustment method and related equipment - Google Patents

Request queue dynamic adjustment method and related equipment Download PDF

Info

Publication number
CN113271265A
CN113271265A CN202110570825.7A CN202110570825A CN113271265A CN 113271265 A CN113271265 A CN 113271265A CN 202110570825 A CN202110570825 A CN 202110570825A CN 113271265 A CN113271265 A CN 113271265A
Authority
CN
China
Prior art keywords
service
server
request
service request
determining
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.)
Granted
Application number
CN202110570825.7A
Other languages
Chinese (zh)
Other versions
CN113271265B (en
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.)
China Information Technology Security Evaluation Center
Original Assignee
China Information Technology Security Evaluation Center
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 China Information Technology Security Evaluation Center filed Critical China Information Technology Security Evaluation Center
Priority to CN202110570825.7A priority Critical patent/CN113271265B/en
Publication of CN113271265A publication Critical patent/CN113271265A/en
Application granted granted Critical
Publication of CN113271265B publication Critical patent/CN113271265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1458Denial of Service
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The method for dynamically adjusting the request queue and the related device can determine the length of a first request queue of a server at the current moment; determining a first service request quantity of a server planning to process service requests at the current moment according to the length of the first request queue and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing; determining the number of second service requests of the server to be accessed to the service requests at the current moment at least according to the number of the service requests obtained by the server before the current moment; and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment. According to the method and the device, the access control is performed on the service requests through the first service request quantity and the second service request quantity, the request queue length of the server is dynamically adjusted in real time, and the denial of service attack is effectively defended.

Description

Request queue dynamic adjustment method and related equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method for dynamically adjusting a request queue and a related device.
Background
With the continuous development and progress of computer technology, people pay more and more attention to network security.
At present, the denial of service (DoS) attack has the characteristics of simple operation, great destructiveness and long duration, and becomes a network attack means widely used by lawbreakers. Denial-of-service attacks can make a consumption attack on the network bandwidth, easily causing the target service to be suspended or the host to crash. Therefore, an effective countermeasure against the denial of service attack is required.
Disclosure of Invention
In view of the foregoing problems, the present disclosure provides a method and related device for dynamically adjusting a request queue, which overcome the foregoing problems or at least partially solve the foregoing problems, and the technical solutions are as follows:
a dynamic adjustment method for a request queue comprises the following steps:
determining the length of a first request queue of a server at the current moment;
determining a first service request quantity of the server planning to process the service request at the current moment according to the first request queue length and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing;
determining a second service request quantity of the server needing to be accessed to the service request at the current moment at least according to the quantity of the service requests obtained by the server before the current moment;
and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment.
Optionally, the determining, according to the first request queue length and a preset resource scheduling value, a first service request number for the server to plan to process a service request at the current time includes:
comparing the length of the first request queue with a preset resource scheduling value to obtain a comparison result;
and determining the first service request quantity of the server planning to process the service requests at the current moment according to the comparison result.
Optionally, the determining, at least according to the number of service requests obtained by the server before the current time, a second number of service requests to be accessed by the server at the current time includes:
determining a third service request quantity of the service requests obtained by the server at the current moment;
determining the average service request quantity of service requests obtained by the server in a preset time period, wherein the preset time period is a time period from a preset initial time to the current time;
and determining the second service request quantity of the service requests to be accessed by the server at the current moment according to the third service request quantity and the average service request quantity.
Optionally, the determining, according to the comparison result, a first service request number for which the server plans to process the service request at the current time includes:
when the comparison result is
Figure BDA0003082538480000021
Determining that the first service request quantity of the server planning to process the service requests at the current moment is a preset maximum service request quantity;
when the comparison result is
Figure BDA0003082538480000022
Determining that the server is scheduled to process a first service request of the service requests at the current timeThe number is 0;
wherein t is the current time; q (t) is the first request queue length;
Figure BDA0003082538480000023
setting the preset resource scheduling value; v is a parameter for regulating the importance degree of the service request processing capacity compared with the resource consumed by the service request processing; e is the unit resource consumed by service request processing.
Optionally, the determining, according to the third service request number and the average service request number, a second service request number of the service requests to be accessed by the server at the current time includes:
according to the formula:
Figure BDA0003082538480000024
determining a second service request quantity of the server needing to be accessed to the service requests at the current moment, wherein t is the current moment; a (t) is the second service request number;
Figure BDA0003082538480000025
a (t) is the third service request number;
Figure BDA0003082538480000026
the average number of service requests;
Figure BDA0003082538480000031
Δ t is the duration of the preset time period; when x is less than or equal to 0,
Figure BDA0003082538480000032
when x is larger than or equal to 1,
Figure BDA0003082538480000033
when x is more than 0 and less than 1,
Figure BDA0003082538480000034
optionally, the adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at a time next to the current time includes:
according to the formula:
Q(t+1)=max[Q(t)-C(t),0]+A(t)
obtaining a second request queue length of the server at a time next to the current time, wherein t is the current time; t +1 is the next moment of the current moment; q (t +1) is the second request queue length; q (t) is the first request queue length; c (t) is the first service request number; a (t) is the second service request number.
A dynamic request queue adjustment apparatus, comprising: a first request queue length determining unit, a first service request quantity determining unit, a second service request quantity determining unit, and a second request queue length obtaining unit,
the first request queue length determining unit is used for determining the first request queue length of the server at the current moment;
the first service request quantity determining unit is used for determining a first service request quantity of the server planning to process the service request at the current moment according to the first request queue length and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing;
the second service request quantity determining unit is used for determining the second service request quantity of the service requests which need to be accessed by the server at the current moment at least according to the quantity of the service requests obtained by the server before the current moment;
the second request queue length obtaining unit is configured to adjust the length of the first request queue according to the number of the first service requests and the number of the second service requests, and obtain a length of a second request queue of the server at a time next to the current time.
Optionally, the first service request quantity determining unit includes: the comparison results in a subunit and a first number determining subunit,
the comparison result obtaining subunit is configured to compare the first request queue length with a preset resource scheduling value, and obtain a comparison result;
the first number determining subunit is configured to determine, according to the comparison result, a first service request number for which the server plans to process a service request at the current time.
A computer readable storage medium, having stored thereon a program which, when executed by a processor, implements a method of dynamic adjustment of a request queue as claimed in any one of the preceding claims.
An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform the request queue dynamic adjustment method as described in any one of the above.
By means of the technical scheme, the method for dynamically adjusting the request queue and the related device can determine the length of the first request queue of the server at the current moment; determining a first service request quantity of a server planning to process service requests at the current moment according to the length of the first request queue and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing; determining the number of second service requests of the server to be accessed to the service requests at the current moment at least according to the number of the service requests obtained by the server before the current moment; and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment. According to the method and the device, the access control is performed on the service requests through the first service request quantity and the second service request quantity, the request queue length of the server is dynamically adjusted in real time, and the denial of service attack is effectively defended.
The foregoing description is only an overview of the technical solutions of the present disclosure, and the embodiments of the present disclosure are described below in order to make the technical means of the present disclosure more clearly understood and to make the above and other objects, features, and advantages of the present disclosure more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the disclosure. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic diagram illustrating an implementation manner of a request queue dynamic adjustment method provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating another implementation manner of a request queue dynamic adjustment method provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating another implementation manner of a request queue dynamic adjustment method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram illustrating a request queue dynamic adjustment apparatus provided in an embodiment of the present disclosure;
fig. 5 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, a schematic diagram of an implementation manner of a request queue dynamic adjustment method provided in an embodiment of the present disclosure may include:
s100, determining the length of a first request queue of a server at the current moment.
In a normal situation, a request queue is set for the server to cache data of the service request, and a worker thread in the server obtains and processes the data of the service request from the request queue. The method and the device for determining the request queue length can determine the first request queue length of the request queue at the current moment of the server. The length of the request queue can be set and adjusted. It will be appreciated that a skilled person may set an initial request queue length for the request queue. At the starting time when the server starts to work, the embodiments of the present disclosure may determine that the initial request queue length of the server is the first request queue length when the current time is the starting time.
S200, determining the first service request quantity of the server planning to process the service requests at the current moment according to the first request queue length and a preset resource scheduling value, wherein the preset resource scheduling value is related to the service request processing capacity and the resources consumed by service request processing.
The embodiment of the disclosure may perform mathematical modeling with the request queue length of the server kept stable as a limiting condition and with the resource consumed by the service request processing reduced as an optimization target, thereby obtaining a relationship between the first request queue length, the preset resource scheduling value and the first service request quantity.
Specifically, the embodiment of the present disclosure uses a multi-objective optimization method, and minimizes ec (t) value on the premise of maintaining a stable request queue length, where E is a unit resource consumed by processing a service request, that is, a resource consumed by processing a service request; c (t) is the first service request number. Therefore, the relation between the comparison result of the first request queue length and the preset resource scheduling value and the first service request quantity can be obtained.
Optionally, based on the method shown in fig. 1, as shown in fig. 2, a schematic diagram of another implementation manner of the request queue dynamic adjustment method provided in the embodiment of the present disclosure, step S200 may include:
s210, comparing the length of the first request queue with a preset resource scheduling value to obtain a comparison result.
S220, determining the first service request quantity of the server planning to process the service requests at the current moment according to the comparison result.
Specifically, step S220 may include:
when the comparison result is
Figure BDA0003082538480000061
When the server is scheduled to process the service requests at the current moment, the first service request quantity of the server is determined to be the preset maximum service request quantity, namely C (t) ═ Cmax
When the comparison result is
Figure BDA0003082538480000062
When the number of the first service requests that the server plans to process the service requests at the current time is determined to be 0, that is, c (t) is 0.
Wherein t is the current moment; q (t) is the first request queue length;
Figure BDA0003082538480000063
setting a preset resource scheduling value; v is a parameter for regulating the importance degree of the service request processing capacity compared with the resource consumed by the service request processing; e is the unit resource consumed by service request processing.
When the value of V is increased, it means that the resource consumed by the service request processing is more emphasized, and c (t) is 0. When the value of V is reduced, it shows that the processing capacity of the service request is more emphasized, and C (t) takes the value of the preset maximum service request quantity Cmax
The preset maximum service request number may be set with reference to the actual processing capacity of the server.
The embodiment of the disclosure determines the relationship among the length of the first request queue, the preset resource scheduling value and the number of the first service requests through a multi-objective optimization method, and determines the number of the first service requests planned to process the service requests at the current moment through the comparison of the length of the first request queue and the preset resource scheduling value in the actual use process, so that the server can process the service requests efficiently.
S300, determining the second service request quantity of the server needing to access the service request at the current moment according to the quantity of the service requests obtained by the server at least before the current moment.
Optionally, in the embodiment of the present disclosure, the number of the second service requests that the server needs to access the service request at the current time may be determined according to the number of the service requests that the server obtains at any historical time.
Optionally, in the embodiment of the present disclosure, the second number of service requests that the server needs to access to the service request at the current time may be determined according to the number of service requests that the server obtains at the current time and the number of service requests that the server obtains at any historical time before the current time.
Optionally, based on the method shown in fig. 1, as shown in fig. 3, a schematic diagram of another implementation manner of the request queue dynamic adjustment method provided in the embodiment of the present disclosure, step S300 may include:
s310, determining the third service request quantity of the service requests obtained by the server at the current moment.
S320, determining the average service request quantity of the service requests obtained by the server in a preset time period, wherein the preset time period is a time period from a preset initial time to a current time.
The preset initial time may be any time before the current time. Optionally, in a normal case, the preset initial time is a starting time. For example: the preset time period may be a time period from a preset initial time 0 to a current time 5. The embodiment of the disclosure may calculate and obtain the average number of service requests according to the number of service requests obtained within the preset time period.
S330, determining the second service request quantity of the service requests to be accessed by the server at the current moment according to the third service request quantity and the average service request quantity.
Specifically, step S330 may include:
according to the formula:
Figure BDA0003082538480000071
determining the number of second service requests of the server needing to be accessed to the service requests at the current moment, wherein t is the current moment; a (t) is the second service request number;
Figure BDA0003082538480000072
a (t) is a third service request number;
Figure BDA0003082538480000073
the average number of service requests;
Figure BDA0003082538480000074
delta t is the duration of a preset time period; when x is less than or equal to 0,
Figure BDA0003082538480000075
when x is larger than or equal to 1,
Figure BDA0003082538480000076
when x is more than 0 and less than 1,
Figure BDA0003082538480000077
according to the third service request quantity of the service requests obtained by the server at the current moment and the average service request quantity obtained in the preset time period, the second service request quantity of the service requests required to be accessed by the server at the current moment can be accurately determined.
S400, adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests, and obtaining the length of the second request queue of the server at the next moment of the current moment.
Optionally, step S400 may include:
according to the formula:
Q(t+1)=max[Q(t)-C(t),0]+A(t)
obtaining the length of a second request queue of the server at the next moment of the current moment, wherein t is the current moment; t +1 is the next moment of the current moment; q (t +1) is the second request queue length; q (t) is the first request queue length; c (t) is the first service request number; a (t) is the second service request number.
It is understood that, after obtaining the second request queue length, the embodiment of the present disclosure may take the next time of the current time as the current time, take the second request queue length as the first request queue length, and return to execute step S100, thereby implementing the loop calculation.
The method for dynamically adjusting the request queue can determine the length of a first request queue of a server at the current moment; determining a first service request quantity of a server planning to process service requests at the current moment according to the length of the first request queue and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing; determining the number of second service requests of the server to be accessed to the service requests at the current moment at least according to the number of the service requests obtained by the server before the current moment; and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment. According to the method and the device, the access control is performed on the service requests through the first service request quantity and the second service request quantity, the request queue length of the server is dynamically adjusted in real time, and the denial of service attack is effectively defended.
Although the operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the foregoing method embodiment, an embodiment of the present disclosure further provides a device for dynamically adjusting a request queue, where the structure of the device is shown in fig. 4, and the device may include: a first request queue length determining unit 100, a first service request quantity determining unit 200, a second service request quantity determining unit 300, and a second request queue length obtaining unit 400.
A first request queue length determining unit 100, configured to determine a first request queue length of the server at the current time.
A first service request quantity determining unit 200, configured to determine a first service request quantity that the server plans to process the service request at the current time according to the first request queue length and a preset resource scheduling value, where the preset resource scheduling value is related to a service request processing capacity and a resource consumed by processing the service request.
Optionally, the first service request quantity determining unit 200 includes: the comparison result obtains a subunit and a first number determination subunit.
And the comparison result obtaining subunit is configured to compare the first request queue length with a preset resource scheduling value, and obtain a comparison result.
And the first quantity determining subunit is used for determining the first service request quantity of the service requests planned to be processed by the server at the current moment according to the comparison result.
In particular, the first number determining subunit is specifically configured to determine when the comparison result is
Figure BDA0003082538480000091
When the server is scheduled to process the service requests at the current moment, the first service request quantity of the server is determined to be the preset maximum service request quantity, namely C (t) ═ Cmax
When the comparison result is
Figure BDA0003082538480000092
When the number of the first service requests that the server plans to process the service requests at the current time is determined to be 0, that is, c (t) is 0.
Wherein t is the current moment; q (t) is firstRequest queue length;
Figure BDA0003082538480000093
setting a preset resource scheduling value; v is a parameter for regulating the importance degree of the service request processing capacity compared with the resource consumed by the service request processing; e is the unit resource consumed by service request processing.
The second service request quantity determining unit 300 is configured to determine, at least according to the quantity of service requests obtained by the server before the current time, a second service request quantity of service requests to be accessed by the server at the current time.
Optionally, the second service request number determining unit 300 may include: a second number determining subunit, an average service request number determining subunit, and a third number determining subunit.
A second number determining subunit, configured to determine a third service request number of service requests obtained by the server at the current time.
The server comprises an average service request quantity determining subunit, configured to determine an average service request quantity of service requests obtained by the server within a preset time period, where the preset time period is a time period from a preset initial time to a current time.
And the third quantity determining subunit is used for determining the second service request quantity of the service requests to be accessed by the server at the current moment according to the third service request quantity and the average service request quantity.
In particular, the third number determining subunit may be specifically configured to:
Figure BDA0003082538480000101
determining the number of second service requests of the server needing to be accessed to the service requests at the current moment, wherein t is the current moment; a (t) is the second service request number;
Figure BDA0003082538480000102
a (t) is a third service request number;
Figure BDA0003082538480000103
the average number of service requests;
Figure BDA0003082538480000104
delta t is the duration of a preset time period; when x is less than or equal to 0,
Figure BDA0003082538480000105
when x is larger than or equal to 1,
Figure BDA0003082538480000106
when x is more than 0 and less than 1,
Figure BDA0003082538480000107
a second request queue length obtaining unit 400, configured to adjust the first request queue length according to the first service request quantity and the second service request quantity, and obtain a second request queue length of the server at a time next to the current time.
Optionally, the second request queue length obtaining unit 400 may be specifically configured to:
Q(t+1)=max[Q(t)-C(t),0]+A(t)
obtaining the length of a second request queue of the server at the next moment of the current moment, wherein t is the current moment; t +1 is the next moment of the current moment; q (t +1) is the second request queue length; q (t) is the first request queue length; c (t) is the first service request number; a (t) is the second service request number.
It is to be understood that, after obtaining the second request queue length, the second request queue length obtaining unit 400 takes the next time of the current time as the current time, and takes the second request queue length as the first request queue length, and triggers the first request queue length determining unit 100 back.
The dynamic adjustment device for the request queue provided by the disclosure can determine the length of a first request queue of a server at the current moment; determining a first service request quantity of a server planning to process service requests at the current moment according to the length of the first request queue and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing; determining the number of second service requests of the server to be accessed to the service requests at the current moment at least according to the number of the service requests obtained by the server before the current moment; and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment. According to the method and the device, the access control is performed on the service requests through the first service request quantity and the second service request quantity, the request queue length of the server is dynamically adjusted in real time, and the denial of service attack is effectively defended.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
The dynamic adjustment apparatus for request queues comprises a processor and a memory, wherein the first request queue length determining unit 100, the first service request quantity determining unit 200, the second service request quantity determining unit 300, the second request queue length obtaining unit 400, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, access control is carried out on the service requests through the first service request quantity and the second service request quantity by adjusting kernel parameters, the request queue length of the server is dynamically adjusted in real time, and denial of service attack is effectively defended.
The disclosed embodiments provide a computer-readable storage medium on which a program is stored, which, when executed by a processor, implements the request queue dynamic adjustment method.
The embodiment of the disclosure provides a processor, which is used for running a program, wherein the program executes the dynamic adjustment method for the request queue during running.
As shown in fig. 5, an embodiment of the present disclosure provides an electronic device 500, where the electronic device 500 includes at least one processor 501, and at least one memory 502 and a bus 503 connected to the processor 501; the processor 501 and the memory 502 complete communication with each other through the bus 503; the processor 501 is used for calling the program instructions in the memory 502 to execute the request queue dynamic adjustment method described above. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present disclosure also provides a computer program product adapted to perform a program for initializing the above-mentioned method steps of the dynamic adjustment of the request queue when executed on an electronic device.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
In the description of the present disclosure, it is to be understood that the directions or positional relationships indicated as referring to the terms "upper", "lower", "front", "rear", "left" and "right", etc., are based on the directions or positional relationships shown in the drawings, and are only for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the positions or elements referred to must have specific directions, be constituted and operated in specific directions, and thus, are not to be construed as limitations of the present disclosure.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The above are merely examples of the present disclosure, and are not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the scope of the claims of the present disclosure.

Claims (10)

1. A method for dynamically adjusting a request queue, comprising:
determining the length of a first request queue of a server at the current moment;
determining a first service request quantity of the server planning to process the service request at the current moment according to the first request queue length and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing;
determining a second service request quantity of the server needing to be accessed to the service request at the current moment at least according to the quantity of the service requests obtained by the server before the current moment;
and adjusting the length of the first request queue according to the number of the first service requests and the number of the second service requests to obtain the length of the second request queue of the server at the next moment of the current moment.
2. The method of claim 1, wherein determining the first number of service requests that the server plans to process service requests at the current time based on the first request queue length and a preset resource scheduling value comprises:
comparing the length of the first request queue with a preset resource scheduling value to obtain a comparison result;
and determining the first service request quantity of the server planning to process the service requests at the current moment according to the comparison result.
3. The method of claim 1, wherein determining a second number of service requests that the server needs to access service requests at the current time based on at least the number of service requests that the server obtained before the current time comprises:
determining a third service request quantity of the service requests obtained by the server at the current moment;
determining the average service request quantity of service requests obtained by the server in a preset time period, wherein the preset time period is a time period from a preset initial time to the current time;
and determining the second service request quantity of the service requests to be accessed by the server at the current moment according to the third service request quantity and the average service request quantity.
4. The method of claim 2, wherein said determining a first number of service requests that the server is scheduled to process at the current time based on the comparison comprises:
when the comparison result is
Figure FDA0003082538470000021
Determining that the first service request quantity of the server planning to process the service requests at the current moment is a preset maximum service request quantity;
when the comparison result is
Figure FDA0003082538470000022
Determining that the number of first service requests of the server planning to process the service requests at the current moment is 0;
wherein t is the current time; q (t) is the first request queue length;
Figure FDA0003082538470000023
setting the preset resource scheduling value; v is a parameter for regulating the importance degree of the service request processing capacity compared with the resource consumed by the service request processing; e is the unit resource consumed by service request processing.
5. The method of claim 3, wherein the determining a second number of service requests that the server needs to access to service requests at the current time according to the third number of service requests and the average number of service requests comprises:
according to the formula:
Figure FDA0003082538470000024
determining a second service request quantity of the server needing to be accessed to the service requests at the current moment, wherein t is the current moment; a (t) is the second service request number;
Figure FDA0003082538470000025
a (t) is the third service request number;
Figure FDA0003082538470000026
the average number of service requests;
Figure FDA0003082538470000027
Δ t is the duration of the preset time period; when x is less than or equal to 0,
Figure FDA0003082538470000028
when x is larger than or equal to 1,
Figure FDA0003082538470000029
when x is more than 0 and less than 1,
Figure FDA00030825384700000210
6. the method of claim 1, wherein the adjusting the first request queue length according to the first service request quantity and the second service request quantity to obtain a second request queue length of the server at a time next to the current time comprises:
according to the formula:
Q(t+1)=max[Q(t)-C(t),0]+A(t)
obtaining a second request queue length of the server at a time next to the current time, wherein t is the current time; t +1 is the next moment of the current moment; q (t +1) is the second request queue length; q (t) is the first request queue length; c (t) is the first service request number; a (t) is the second service request number.
7. A dynamic request queue adjustment apparatus, comprising: a first request queue length determining unit, a first service request quantity determining unit, a second service request quantity determining unit, and a second request queue length obtaining unit,
the first request queue length determining unit is used for determining the first request queue length of the server at the current moment;
the first service request quantity determining unit is used for determining a first service request quantity of the server planning to process the service request at the current moment according to the first request queue length and a preset resource scheduling value, wherein the preset resource scheduling value is related to service request processing capacity and resources consumed by service request processing;
the second service request quantity determining unit is used for determining the second service request quantity of the service requests which need to be accessed by the server at the current moment at least according to the quantity of the service requests obtained by the server before the current moment;
the second request queue length obtaining unit is configured to adjust the length of the first request queue according to the number of the first service requests and the number of the second service requests, and obtain a length of a second request queue of the server at a time next to the current time.
8. The apparatus of claim 7, wherein the first service request number determining unit comprises: the comparison results in a subunit and a first number determining subunit,
the comparison result obtaining subunit is configured to compare the first request queue length with a preset resource scheduling value, and obtain a comparison result;
the first number determining subunit is configured to determine, according to the comparison result, a first service request number for which the server plans to process a service request at the current time.
9. A computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing a method for dynamic adjustment of a request queue according to any one of claims 1 to 6.
10. An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform the request queue dynamic adjustment method of any one of claims 1 to 6.
CN202110570825.7A 2021-05-25 2021-05-25 Request queue dynamic adjustment method and related equipment Active CN113271265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110570825.7A CN113271265B (en) 2021-05-25 2021-05-25 Request queue dynamic adjustment method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110570825.7A CN113271265B (en) 2021-05-25 2021-05-25 Request queue dynamic adjustment method and related equipment

Publications (2)

Publication Number Publication Date
CN113271265A true CN113271265A (en) 2021-08-17
CN113271265B CN113271265B (en) 2022-11-08

Family

ID=77232691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110570825.7A Active CN113271265B (en) 2021-05-25 2021-05-25 Request queue dynamic adjustment method and related equipment

Country Status (1)

Country Link
CN (1) CN113271265B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000295247A (en) * 1999-04-09 2000-10-20 Nec Corp Scheduling method in queuing system and chuting blanks switch
CN107391268A (en) * 2016-05-17 2017-11-24 阿里巴巴集团控股有限公司 service request processing method and device
CN109104500A (en) * 2018-09-29 2018-12-28 广东省信息工程有限公司 A kind of server load balancing method and device of dynamic adjustment
CN109451051A (en) * 2018-12-18 2019-03-08 百度在线网络技术(北京)有限公司 Service request processing method, device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000295247A (en) * 1999-04-09 2000-10-20 Nec Corp Scheduling method in queuing system and chuting blanks switch
CN107391268A (en) * 2016-05-17 2017-11-24 阿里巴巴集团控股有限公司 service request processing method and device
CN109104500A (en) * 2018-09-29 2018-12-28 广东省信息工程有限公司 A kind of server load balancing method and device of dynamic adjustment
CN109451051A (en) * 2018-12-18 2019-03-08 百度在线网络技术(北京)有限公司 Service request processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113271265B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN108829350B (en) Data migration method and device based on block chain
EP3117317B1 (en) Resource management based on device-specific or user-specific resource usage profiles
US8424007B1 (en) Prioritizing tasks from virtual machines
CN110362517A (en) It is calculating equipment for dynamically adjusting and is storing the technology of the mode of transmission I/O request between equipment
CN107948084B (en) Current limiting method and device
JP3737560B2 (en) Distributed processing method and system in network
CN111445340A (en) Method and device for estimating value of financial product, electronic equipment and readable storage medium
US11614968B2 (en) Processing future-dated resource reservation requests
CN113271265B (en) Request queue dynamic adjustment method and related equipment
CN111338803B (en) Thread processing method and device
CN107194712B (en) Method and device for recording change information of shared account and method and system for supplementing account of internal account
CA3044826C (en) Processing future-dated resource reservations requests
CN111736975A (en) Request control method and device, computer equipment and computer readable storage medium
US11388063B2 (en) Intraday resource management system
CN115048186A (en) Method and device for processing expansion and contraction of service container, storage medium and electronic equipment
CN108270744B (en) Media data access method and device
CN110868333A (en) Data caching method and system for gateway
CN109561123B (en) Token caching method and device
CN106033304A (en) Data interaction method and device
CN111754332B (en) Service request processing method and device, storage medium and electronic equipment
CA3069092C (en) Optimal query scheduling for resource utilization optimization
CN110795367B (en) Storage access control method and device
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium
CA3201884C (en) Intraday resource management system
CN110650173B (en) Request processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant