CN117112222A - Request processing method and device, electronic equipment and storage medium - Google Patents

Request processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117112222A
CN117112222A CN202311144322.9A CN202311144322A CN117112222A CN 117112222 A CN117112222 A CN 117112222A CN 202311144322 A CN202311144322 A CN 202311144322A CN 117112222 A CN117112222 A CN 117112222A
Authority
CN
China
Prior art keywords
request
determining
queue
requests
bandwidth
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
CN202311144322.9A
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 Acoinfo Technology Co ltd
Original Assignee
Beijing Acoinfo 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 Acoinfo Technology Co ltd filed Critical Beijing Acoinfo Technology Co ltd
Priority to CN202311144322.9A priority Critical patent/CN117112222A/en
Publication of CN117112222A publication Critical patent/CN117112222A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5013Request control
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a request processing method, a request processing device, electronic equipment and a storage medium. Comprising the following steps: determining a unit bandwidth quota based on a preset bandwidth quota corresponding to each common virtual machine in the current processing period; determining a first request quantity of requests expected to be processed by the request queue in the current processing week based on a preset bandwidth quota and a unit bandwidth quota aiming at the request queue corresponding to each common virtual machine; determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity; determining the second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of residual bandwidths according to the request queue corresponding to each common virtual machine, acquiring target requests of the target request quantity in the request queue, and adding each target request into an activation queue; the target request number is the sum of the first request number and the second request number; and performing access processing on each target request in the activation queue, and ending the current processing period.

Description

Request processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of networks, in particular to a request processing method, a request processing device, electronic equipment and a storage medium.
Background
The system structure of the micro-service architecture type is a common architecture in the embedded field, and the system architecture comprises at least one service virtual machine, wherein the service virtual machine is connected with at least one common virtual machine; the service virtual machine can allocate bandwidth resources provided by the physical device for each common virtual machine, so as to process the request sent by each common virtual machine according to the allocated bandwidth resources.
In the prior art, when bandwidth resources are allocated to common virtual machines, the bandwidth resources are generally allocated according to preset bandwidth quota corresponding to each common virtual machine, and requests sent by each common virtual machine are processed based on the allocated bandwidth resources. However, in the process of implementing the present invention, it is found that at least the following technical problems exist in the prior art: according to the fixed bandwidth quota, the request is processed, the residual bandwidth resources may not be allocated, so that the resource waste is caused, and the request processing efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a request processing method, a request processing device, electronic equipment and a storage medium, so as to realize the purposes of fully utilizing bandwidth resources and improving request processing efficiency.
According to an aspect of the present invention, there is provided a request processing method, including:
determining a unit bandwidth quota based on a preset bandwidth quota corresponding to each common virtual machine in the current processing period;
determining a first request quantity of requests expected to be processed by the request queue in the current processing week based on the preset bandwidth quota and the unit bandwidth quota aiming at the request queue corresponding to each common virtual machine;
determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity;
determining a second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of the residual bandwidths according to the request queues corresponding to each common virtual machine, acquiring target requests with target request quantity in the request queues, and adding each target request into an activation queue; wherein the target number of requests is a sum of the first number of requests and the second number of requests;
and carrying out access processing on each target request in the activation queue, and ending the current processing period.
According to another aspect of the present invention, there is provided a request processing apparatus including: the unit bandwidth quota determining module is used for determining unit bandwidth quota based on preset bandwidth quota corresponding to each common virtual machine in the current processing period;
The first request quantity determining module is used for determining the first request quantity of the requests expected to be processed by the request queues in the current processing week based on the preset bandwidth quota and the unit bandwidth quota aiming at the request queues corresponding to each common virtual machine;
the residual bandwidth sum determining module is used for determining the residual bandwidth sum corresponding to the current processing period based on the first request quantity;
the target request adding module is used for determining the second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of the residual bandwidths for the request queues corresponding to each common virtual machine, acquiring target requests of the target request quantity in the request queues, and adding each target request into an activation queue; wherein the target number of requests is a sum of the first number of requests and the second number of requests;
and the target request processing module is used for performing access processing on each target request in the activation queue and ending the current processing period.
According to another aspect of the present invention, there is provided an electronic apparatus including:
At least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the request processing method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a request processing method according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, aiming at the request queue corresponding to each common virtual machine, the first request quantity of the requests expected to be processed by the request queue in the current processing cycle is determined through the preset bandwidth quota corresponding to each common virtual machine in the current processing cycle and the determined unit bandwidth quota, so that the first allocation of bandwidth resources based on the preset bandwidth quota is realized. Determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity; for each request queue, determining a second request quantity of the requests to be processed in the current processing cycle of the request queue based on the residual bandwidth sum, thereby realizing the reassignment of the residual bandwidth sum. Determining the target request quantity as the sum of the first request quantity and the second request quantity, acquiring target requests of the target request quantity in a request queue, and adding each target request into an activation queue; and ending the current processing period by performing access processing on each target request in the activation queue. The second request quantity is determined based on the residual bandwidth sum, so that the reallocation of the residual bandwidth sum is realized, bandwidth resources are fully utilized, and the request processing efficiency is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a request processing method provided according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a system architecture provided in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a request-to-send process provided in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a service flow of a service virtual machine according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a request processing device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing a request processing method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "includes," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a request processing method according to an embodiment of the present invention. The embodiment is applicable to the situation that the service virtual machine processes the request task in the request queue corresponding to each common virtual machine under the system structure of the micro-service architecture type, and the method can be executed by a request processing device, and the request processing device can be realized in a form of hardware and/or software.
It should be noted that the technical solution may be applied to a system structure of a micro-service architecture type, where the system architecture is shown in fig. 2, and the system architecture includes at least one service virtual machine, where the service virtual machine is connected to at least one common virtual machine; the service virtual machine receives an Input/Output (IO) request task from the common virtual machine, and when the service virtual machine is scheduled to be executed, the service virtual machine starts to process the IO request task and accesses a physical device shared by a plurality of common virtual machines, that is, the access of the common virtual machine to the shared physical device is realized through the service virtual machine. By means of the inter-virtual machine communication component provided by the virtual machine manager, an IO request is sent to the service virtual machine by the common virtual machine. Access to the physical device is achieved through a device driver in the service virtual machine.
A request queue is maintained in the service virtual machine for each common virtual machine. As shown in fig. 3, the normal virtual machine VM0 corresponds to the request queue VM0 in the service virtual machine, and the normal virtual machine VM1 corresponds to the request queue VM1 in the service virtual machine. When the service virtual machine starts to execute, the service virtual machine determines the request number of the request tasks which can be processed and correspond to each common virtual machine in the current processing period, then takes out the request tasks (io req) with the corresponding request number from the request queues of each common virtual machine and adds the request tasks (io req) into the activation queues corresponding to the service virtual machine, processes each request in the activation queues and accesses the shared physical equipment. As shown in fig. 3, the activation queue includes two requests (VM 0 io) corresponding to the normal virtual machine VM0 and one request (VM 1 io) corresponding to the normal virtual machine VM1.
As shown in fig. 1, the method of this embodiment may specifically include:
s110, determining a unit bandwidth quota based on a preset bandwidth quota corresponding to each common virtual machine in the current processing period.
In this embodiment, each process of activating all requests in the queue may be treated as a single processing cycle. In order to determine the number of requests corresponding to the current processing period, a unit bandwidth quota needs to be determined first. Wherein the unit bandwidth quota is a minimum allocation unit when allocating bandwidth. The preset bandwidth quota may be a bandwidth quota determined in advance by the service virtual machine for each common virtual machine.
Optionally, the implementation of determining the unit bandwidth quota may be: and determining the average value among preset bandwidth quotas corresponding to each common virtual machine in the current processing period, and determining the average value as a unit bandwidth quota. Or determining the minimum preset bandwidth quota in the preset bandwidth quotas, and determining a quota value corresponding to the preset proportion of the minimum preset bandwidth quota as the unit bandwidth quota. Wherein the preset proportion is more than 0% and less than or equal to 100%.
Or, based on the preset bandwidth quota corresponding to each common virtual machine in the current processing period, determining the implementation manner of the unit bandwidth quota is as follows: and determining a request queue with the least number of tasks in the current processing period, and determining a preset bandwidth quota corresponding to the request queue with the least number of tasks as a unit bandwidth quota.
Specifically, the task number of the request tasks in each request queue can be determined, and the preset bandwidth quota corresponding to the request queue with the minimum task number is determined as the unit bandwidth quota. By taking the preset bandwidth quota corresponding to the request queue with the minimum task number as the unit bandwidth quota, when the first request number is determined in the current processing period, at least one request in the request queue with the minimum task number can be processed, and balanced processing of the requests in each request queue is facilitated.
Further, in order to avoid resource waste caused by allocation of bandwidth resources to the request queues without request tasks, the preset bandwidth quota corresponding to the request queues with the task number larger than zero and the task number minimum can be determined as the unit bandwidth quota, so that the bandwidth resources are allocated to the request queues with the requests to be processed as much as possible, and the bandwidth resources are effectively utilized.
S120, determining the first request quantity of the requests expected to be processed by the request queue in the current processing week based on the preset bandwidth quota and the unit bandwidth quota aiming at the request queue corresponding to each common virtual machine.
In a specific implementation, for a request queue with zero task number, the first request number corresponding to the request queue may be determined to be zero, so as to avoid resource waste. For a request queue with a number of tasks other than zero, the manner of determining the first number of requests may be: for request queues with preset bandwidth quota less than the unit bandwidth quota, the first request quantity can be determined as the preset quantity; the preset number may be 1, for example. For request queues with preset bandwidth quota greater than or equal to the unit bandwidth quota, the corresponding first request quantity can be determined based on preset bandwidth quota proportional values among the request queues.
In this embodiment, for a request queue with a number of tasks other than zero, the manner of determining the first number of requests may further be: and determining a quotient of the preset bandwidth quota divided by the unit bandwidth quota, and determining an integer value corresponding to the quotient as the first request quantity. For example, if the preset bandwidth quota corresponding to the current request queue is 50% of the total quota, and the unit bandwidth quota is 20% of the total quota, the quotient is 2.5, and it may be determined that the first request number is an integer value of 2. If the preset bandwidth quota corresponding to the current request queue is 50% of the total quota, and the unit bandwidth quota is 10% of the total quota, the quotient is 5, and it can be determined that the first request quantity is an integer value of 5.
According to the method, the device and the system, the integer value of the quotient is determined as the first request quantity, so that the first request quantity is determined according to the preset bandwidth quota of each request queue, and the larger the preset bandwidth quota is, the more the first request quantity is, so that bandwidth resources can be utilized conveniently and fully.
S130, determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity.
Wherein the sum of the residual bandwidths is the sum of the allocatable bandwidths of the request queues, and for each request queue, the allocatable bandwidths can be: the request queue sums the current allocatable bandwidth of the current processing cycle and the last remaining bandwidth of the last processing cycle.
In a specific implementation, after determining the first request number, an allocated bandwidth in the current processing period may be determined, and based on the bandwidth available to the shared physical device, the allocated bandwidth, and a last remaining bandwidth in the last processing period, a sum of remaining bandwidths corresponding to the current processing period may be determined.
Specifically, based on the first request number, determining the sum of the residual bandwidths corresponding to the current processing period includes: determining allocated bandwidths corresponding to the current processing period based on the first request quantity aiming at the request queue corresponding to each common virtual machine, and determining the queue residual bandwidths corresponding to the request queue based on the preset bandwidth quota corresponding to the request queue, the last queue residual bandwidth corresponding to the last processing period and the allocated bandwidths; and determining the sum of the residual bandwidths of the queues corresponding to the request queues as the sum of the residual bandwidths.
In implementations, the allocated bandwidth may be a product of the first number of requests and the actual bandwidth to process each request. The manner of determining the remaining bandwidth of the queue may be: determining the sum value of the preset bandwidth quota and the residual bandwidth of the last queue, and determining the difference value obtained by subtracting the allocated bandwidth from the sum value as the residual bandwidth of the queue. And calculating the sum of the residual bandwidths of the queues, and determining the sum of the residual bandwidths of the queues as the sum of the residual bandwidths.
S140, determining the second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of the residual bandwidths according to the request queues corresponding to each common virtual machine, acquiring target requests of the target request quantity in the request queues, and adding each target request into the activation queue.
Wherein the target request number is a sum of the first request number and the second request number.
In particular implementations, to avoid allocating bandwidth to a request queue for which there is no pending request task, determining the second number of requests may include: dividing the sum of the residual bandwidths by the unit bandwidth quota to obtain the total residual quantity, determining the ratio of the unprocessed quantity of unprocessed requests of the request queue to the sum of the unprocessed requests in each request queue, and determining the product between the total residual quantity and the ratio as the second request quantity.
Alternatively, another way to determine the second number of requests of the request queue to be processed in the current processing cycle may be: determining a remaining total number of requests to be processed in the current processing cycle based on the remaining bandwidth sum and the unit bandwidth quota; and determining a second request quantity corresponding to the request queue based on the residual total quantity and the residual bandwidth of the queue.
Specifically, an integer value corresponding to the ratio of the total remaining bandwidth to the quota of unit bandwidth may be determined as the total remaining number. Determining, based on the total number of residuals and the remaining bandwidth of the queue, a second number of requests corresponding to the request queue, including: determining the ratio of the residual bandwidth of the queue to the total residual bandwidth; and determining the product obtained by multiplying the remaining total number by the ratio, and determining the integer value corresponding to the product as the second request number.
The residual bandwidth of the queue is the sum of the difference value between the preset bandwidth quota corresponding to the request queue and the allocated bandwidth and the residual bandwidth of the last queue.
In order to further process the requests in each request queue according to the preset bandwidth quota, the ratio of the residual bandwidth of the queue to the total residual bandwidth can be determined, and the product of the total residual bandwidth and the ratio is determined as the second request quantity. According to the method and the device, the second request quantity is determined through the ratio of the residual bandwidth of the queue to the sum of the residual bandwidths, so that bandwidth resources can be more fully utilized, and the processing efficiency of the requests is improved.
In a specific implementation, the pending requests with the target request number can be obtained from each request queue as target requests, and the target requests in each request queue are added to the activation queue.
S150, performing access processing on each target request in the activation queue, and ending the current processing period.
Specifically, each target request in the activation queue can be traversed, access processing is performed on each target request, and after all target requests in the activation queue perform access operation, the current processing period is ended.
In an implementation, performing access processing on each target request in the activation queue includes: determining a first priority of a common virtual machine to which a current target request corresponding to an activation queue belongs; determining whether the second priority corresponding to the service virtual machine is matched with the first priority; if not, the control service virtual machine inherits the first priority and performs access processing on the current target request.
The current target request is a target request which is required to be accessed currently in the activation queue. The first priority is the priority of a preset common virtual machine; the second priority is the priority of the preset service virtual machine.
In order to ensure that the access processing process can be successfully completed, when each target request in the activation queue is accessed, a first priority of a common virtual machine to which the current target request corresponding to the activation queue belongs and a second priority corresponding to the service virtual machine can be determined. It is determined whether the first priority matches the second priority. It should be noted that whether the first priority is matched with the second priority can be determined according to the actual application situation; for example, if the second priority is preset to be higher than the first priority, the request corresponding to the first priority may be executed, and it may be determined that the first priority matches the second priority; otherwise, if the request corresponding to the first priority is not executable, determining that the first priority and the second priority are not matched.
Specifically, if the first priority level matches the second priority level, then the access processing to the current target request may be performed to end the current processing cycle. And if the first priority is not matched with the second priority, controlling the service virtual machine to inherit the first priority, so that the service virtual machine has the authority of processing the current target request, and performing access processing on the current target request.
According to the technical scheme of the embodiment of the invention, aiming at the request queue corresponding to each common virtual machine, the first request quantity of the requests expected to be processed by the request queue in the current processing cycle is determined through the preset bandwidth quota corresponding to each common virtual machine in the current processing cycle and the determined unit bandwidth quota, so that the first allocation of bandwidth resources based on the preset bandwidth quota is realized. Determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity; for each request queue, determining a second request quantity of the requests to be processed in the current processing cycle of the request queue based on the residual bandwidth sum, thereby realizing the reassignment of the residual bandwidth sum. Determining the target request quantity as the sum of the first request quantity and the second request quantity, acquiring target requests of the target request quantity in a request queue, and adding each target request into an activation queue; and ending the current processing period by performing access processing on each target request in the activation queue. The second request quantity is determined based on the residual bandwidth sum, so that the reallocation of the residual bandwidth sum is realized, bandwidth resources are fully utilized, and the request processing efficiency is improved.
The foregoing details of the embodiments corresponding to the request processing method are described in detail, and specific application scenarios are given below in order to make the technical solutions of the method further clear to those skilled in the art.
FIG. 4 is a schematic diagram of a service flow of a service virtual machine according to an embodiment of the present invention; as shown in fig. 4, the main business flow of the service virtual machine is as follows:
1. a dispatcher in the virtual machine manager dispatches the service virtual machine to start execution;
2. the service virtual machine judges whether IO requests wait for processing, if so, the next step is continued, if not, the service virtual machine waits for the arrival of the IO requests until the IO requests wait for processing, and the next step is executed;
3. the service virtual machine takes out IO requests from the request queues corresponding to the common virtual machines according to the preset bandwidth quota and the request queues of the common virtual machines;
4. adding the selected IO request into an activation queue of the service virtual machine;
specifically, when selecting an IO request corresponding to the current processing period, a request queue with a non-zero task number and a minimum task number may be determined first, and a common virtual machine of the request queue is referred to as a VMK, where the task number of the request queue is referred to as TK, and a preset bandwidth quota of the VMK is referred to as BK.
Traversing all the request queues, and respectively determining the first request quantity which corresponds to each request queue and is added into the activation queue. During the traversal, for a request queue with zero number of tasks, the number of requests added to the active queue is zero. For a request queue with the number of tasks not being zero, dividing the preset bandwidth quota Bi of the request queue by BK to obtain a multiple Mi, wherein Mi is a positive integer. A Mi is determined as the first number of requests that the request queue can be added to the activation queue. The remaining bandwidth Ri of each request queue is the bandwidth that is not allocated in the current processing cycle and accumulated in the last remaining bandwidth of the last processing cycle.
The sum of the remaining bandwidths of the queues is calculated as the sum of the remaining bandwidths, and the sum of the remaining bandwidths is divided by BK to obtain the total number Kt of requests which can be added to the active queue.
Traversing each request queue, determining a ratio L of the residual bandwidth of each request queue to the sum of the residual bandwidths, taking the product of Kt and L as the second request quantity which can be added to the active queue in the currently traversed request queue, wherein the total quantity of the requests which can be added to the active queue by the request queue is as follows: a sum of the first number of requests and the second number of requests; the total number of requests selected in the request queue is added to the activation queue accordingly.
5. The service virtual machine starts to process IO requests in the activation queue;
6. judging whether the priority of the service virtual machine is consistent with the priority of the common virtual machine to which the IO request to be processed belongs, if not, the service virtual machine inherits the priority of the common virtual machine to which the IO request belongs; if yes, continuing the next step;
7. the service virtual machine starts to process the IO request extracted from the activation queue, and accesses the physical equipment which is actually shared by a plurality of common virtual machines according to the IO access parameters in the IO request;
8. after one IO request is processed, judging whether the IO request in the activation queue is processed, if not, continuing to process; if so, a new round of processing cycle is started.
The second request quantity is determined based on the residual bandwidth sum, so that the reallocation of the residual bandwidth sum is realized, and the bandwidth resources are fully utilized; when IO requests are processed, whether the priority of the service virtual machine is consistent with the priority of the common virtual machine to which the IO requests to be processed belong is determined, so that the dynamic adjustment of the priority of the service virtual machine is realized, the IO requests can be accurately processed, and the processing efficiency of the IO requests is improved.
Fig. 5 is a schematic structural diagram of a request processing apparatus according to an embodiment of the present invention, where the apparatus is configured to perform the request processing method provided in any of the foregoing embodiments. The device and the request processing method of each embodiment belong to the same invention conception, and the details of the embodiment of the request processing device, which are not described in detail, can be referred to the embodiment of the request processing method. As shown in fig. 5, the apparatus includes:
the unit bandwidth quota determining module 10 is configured to determine a unit bandwidth quota based on a preset bandwidth quota corresponding to each common virtual machine in the current processing period;
the first request quantity determining module 11 is configured to determine, for a request queue corresponding to each common virtual machine, a first request quantity of requests expected to be processed by the request queue in a current processing week based on a preset bandwidth quota and a unit bandwidth quota;
a remaining bandwidth sum determining module 12, configured to determine a remaining bandwidth sum corresponding to the current processing period based on the first request number;
the target request adding module 13 is configured to determine, for each request queue corresponding to the common virtual machine, a second request number of requests to be processed in the current processing period of the request queue based on the sum of residual bandwidths, obtain target requests of the target request number in the request queue, and add each target request to the activation queue; wherein the target request number is the sum of the first request number and the second request number;
The target request processing module 14 is configured to perform access processing on each target request in the activation queue, and end the current processing period.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the unit bandwidth quota determining module 10 includes:
the unit bandwidth quota determining unit is used for determining a request queue with the least number of tasks in the current processing period, and determining a preset bandwidth quota corresponding to the request queue with the least number of tasks as the unit bandwidth quota.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the first request quantity determining module 11 includes:
the first request quantity determining unit is used for determining a quotient value of dividing the preset bandwidth quota by the unit bandwidth quota and determining an integer value corresponding to the quotient value as the first request quantity.
On the basis of any optional technical scheme in the embodiment of the present invention, the optional residual bandwidth sum determining module 12 includes:
the queue residual bandwidth determining unit is used for determining an allocated bandwidth corresponding to the current processing period based on the first request quantity aiming at the request queue corresponding to each common virtual machine, and determining a queue residual bandwidth corresponding to the request queue based on a preset bandwidth quota corresponding to the request queue, a last queue residual bandwidth corresponding to the last processing period and the allocated bandwidth;
And the residual bandwidth sum determining unit is used for determining the sum of the residual bandwidths of the queues corresponding to the request queues as the residual bandwidth sum.
On the basis of any optional technical scheme in the embodiment of the present invention, optionally, the target request adding module 13 includes:
a remaining total number determining unit configured to determine a remaining total number of requests to be processed in a current processing cycle based on the remaining bandwidth sum and the unit bandwidth quota;
and the second request quantity determining unit is used for determining the second request quantity corresponding to the request queue based on the residual total quantity and the residual bandwidth of the queue.
On the basis of any optional technical scheme in the embodiment of the present invention, optionally, the second request number determining unit includes:
a ratio determining subunit, configured to determine a ratio of the remaining bandwidth of the queue to the sum of the remaining bandwidths;
and the second request quantity determining subunit is used for determining a product obtained by multiplying the remaining total quantity by the ratio and determining an integer value corresponding to the product as the second request quantity.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the target request processing module 14 includes:
the first priority determining unit is used for determining a first priority of the common virtual machine to which the current target request corresponding to the activation queue belongs;
The first priority inheritance unit is used for determining whether the second priority corresponding to the service virtual machine is matched with the first priority; if not, the control service virtual machine inherits the first priority and performs access processing on the current target request.
According to the technical scheme of the embodiment of the invention, aiming at the request queue corresponding to each common virtual machine, the first request quantity of the requests expected to be processed by the request queue in the current processing cycle is determined through the preset bandwidth quota corresponding to each common virtual machine in the current processing cycle and the determined unit bandwidth quota, so that the first allocation of bandwidth resources based on the preset bandwidth quota is realized. Determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity; for each request queue, determining a second request quantity of the requests to be processed in the current processing cycle of the request queue based on the residual bandwidth sum, thereby realizing the reassignment of the residual bandwidth sum. Determining the target request quantity as the sum of the first request quantity and the second request quantity, acquiring target requests of the target request quantity in a request queue, and adding each target request into an activation queue; and ending the current processing period by performing access processing on each target request in the activation queue. The second request quantity is determined based on the residual bandwidth sum, so that the reallocation of the residual bandwidth sum is realized, bandwidth resources are fully utilized, and the request processing efficiency is improved.
It should be noted that, in the embodiment of the request processing apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Fig. 6 is a schematic structural diagram of an electronic device implementing a request processing method according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 20 includes at least one processor 21, and a memory, such as a Read Only Memory (ROM) 22, a Random Access Memory (RAM) 23, etc., communicatively connected to the at least one processor 21, wherein the memory stores a computer program executable by the at least one processor, and the processor 21 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 22 or the computer program loaded from the storage unit 28 into the Random Access Memory (RAM) 23. In the RAM23, various programs and data required for the operation of the electronic device 20 may also be stored. The processor 21, the ROM22 and the RAM23 are connected to each other via a bus 24. An input/output (I/O) interface 25 is also connected to bus 24.
Various components in the electronic device 20 are connected to the I/O interface 25, including: an input unit 26 such as a keyboard, a mouse, etc.; an output unit 27 such as various types of displays, speakers, and the like; a storage unit 28 such as a magnetic disk, an optical disk, or the like; and a communication unit 29 such as a network card, modem, wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 21 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 21 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 21 performs the respective methods and processes described above, such as a request processing method.
In some embodiments, the request processing method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 28. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 20 via the ROM22 and/or the communication unit 29. When the computer program is loaded into RAM23 and executed by processor 21, one or more steps of the request processing method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to perform the request processing method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of processing a request, comprising:
determining a unit bandwidth quota based on a preset bandwidth quota corresponding to each common virtual machine in the current processing period;
determining a first request quantity of requests expected to be processed by the request queue in the current processing week based on the preset bandwidth quota and the unit bandwidth quota aiming at the request queue corresponding to each common virtual machine;
Determining the sum of residual bandwidths corresponding to the current processing period based on the first request quantity;
determining a second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of the residual bandwidths according to the request queues corresponding to each common virtual machine, acquiring target requests with target request quantity in the request queues, and adding each target request into an activation queue; wherein the target number of requests is a sum of the first number of requests and the second number of requests;
and carrying out access processing on each target request in the activation queue, and ending the current processing period.
2. The method according to claim 1, wherein the determining the unit bandwidth quota based on the preset bandwidth quota corresponding to each common virtual machine in the current processing cycle includes:
and determining a request queue with the least number of tasks in the current processing period, and determining a preset bandwidth quota corresponding to the request queue with the least number of tasks as the unit bandwidth quota.
3. The method of claim 1, wherein the determining, based on the preset bandwidth quota and the unit bandwidth quota, a first number of requests that the request queue expects to process during the current processing week comprises:
And determining a quotient of dividing the preset bandwidth quota by the unit bandwidth quota, and determining an integer value corresponding to the quotient as the first request quantity.
4. The method of claim 1, wherein determining, based on the first number of requests, a sum of remaining bandwidths corresponding to the current processing cycle comprises:
determining an allocated bandwidth corresponding to the current processing period based on the first request quantity for the request queue corresponding to each common virtual machine, and determining a queue residual bandwidth corresponding to the request queue based on the preset bandwidth quota corresponding to the request queue, a last queue residual bandwidth corresponding to a last processing period and the allocated bandwidth;
and determining the sum of the residual bandwidths of the queues corresponding to the request queues as the sum of the residual bandwidths.
5. The method of claim 4, wherein the determining a second number of requests of the request queue to process in the current processing cycle based on the sum of remaining bandwidths comprises:
determining a remaining total number of requests to be processed in the current processing cycle based on the remaining bandwidth sum and the unit bandwidth quota;
And determining the second request quantity corresponding to the request queue based on the residual total quantity and the residual bandwidth of the queue.
6. The method of claim 5, wherein determining the second number of requests corresponding to the request queue based on the total number of residuals and the remaining bandwidth of the queue comprises:
determining the ratio of the residual bandwidth of the queue to the sum of the residual bandwidths;
and determining a product obtained by multiplying the remaining total number by the ratio, and determining an integer value corresponding to the product as the second request number.
7. The method of claim 1, wherein said processing access to each of said target requests in said activation queue comprises:
determining a first priority of a common virtual machine to which a current target request corresponding to the activation queue belongs;
determining whether a second priority corresponding to the service virtual machine is matched with the first priority;
and if not, controlling the service virtual machine to inherit the first priority and performing access processing on the current target request.
8. A request processing apparatus, comprising:
The unit bandwidth quota determining module is used for determining unit bandwidth quota based on preset bandwidth quota corresponding to each common virtual machine in the current processing period;
the first request quantity determining module is used for determining the first request quantity of the requests expected to be processed by the request queues in the current processing week based on the preset bandwidth quota and the unit bandwidth quota aiming at the request queues corresponding to each common virtual machine;
the residual bandwidth sum determining module is used for determining the residual bandwidth sum corresponding to the current processing period based on the first request quantity;
the target request adding module is used for determining the second request quantity of the requests to be processed in the current processing period of the request queue based on the sum of the residual bandwidths for the request queues corresponding to each common virtual machine, acquiring target requests of the target request quantity in the request queues, and adding each target request into an activation queue; wherein the target number of requests is a sum of the first number of requests and the second number of requests;
and the target request processing module is used for performing access processing on each target request in the activation queue and ending the current processing period.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the request processing method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the request processing method of any one of claims 1-7.
CN202311144322.9A 2023-09-06 2023-09-06 Request processing method and device, electronic equipment and storage medium Pending CN117112222A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311144322.9A CN117112222A (en) 2023-09-06 2023-09-06 Request processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311144322.9A CN117112222A (en) 2023-09-06 2023-09-06 Request processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117112222A true CN117112222A (en) 2023-11-24

Family

ID=88801999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311144322.9A Pending CN117112222A (en) 2023-09-06 2023-09-06 Request processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117112222A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873691A (en) * 2024-03-13 2024-04-12 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873691A (en) * 2024-03-13 2024-04-12 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US20130238780A1 (en) Managing risk in resource over-committed systems
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN113849312B (en) Data processing task allocation method and device, electronic equipment and storage medium
CN112783659B (en) Resource allocation method and device, computer equipment and storage medium
CN117112222A (en) Request processing method and device, electronic equipment and storage medium
CN108028806B (en) Method and device for allocating virtual resources in Network Function Virtualization (NFV) network
CN112527509A (en) Resource allocation method and device, electronic equipment and storage medium
CN109189581B (en) Job scheduling method and device
CN115098269A (en) Resource allocation method, device, electronic equipment and storage medium
CN115952054A (en) Simulation task resource management method, device, equipment and medium
CN113051051B (en) Scheduling method, device, equipment and storage medium of video equipment
CN115168040A (en) Job preemption scheduling method, device, equipment and storage medium
CN114579187A (en) Instruction distribution method and device, electronic equipment and readable storage medium
WO2017133421A1 (en) Method and device for sharing resources among multiple tenants
CN114327897A (en) Resource allocation method and device and electronic equipment
CN114090247A (en) Method, device, equipment and storage medium for processing data
CN116893893B (en) Virtual machine scheduling method and device, electronic equipment and storage medium
CN112988399B (en) Processor scheduling method and processor scheduling device based on virtualization technology
CN114610575B (en) Method, apparatus, device and medium for calculating updated peak value of branch
CN117591249A (en) Transaction processing method, device, electronic equipment and storage medium
CN116700996B (en) Memory allocation method, device, equipment and medium of neural network
CN115934246A (en) Virtual machine creating method, device, equipment and medium
CN111538559B (en) Virtual machine migration method and device, electronic equipment and storage medium thereof
CN117632425A (en) Task allocation method and device, electronic equipment and storage medium
CN116361008A (en) Task balanced distribution method, device, equipment and medium based on electric power Internet of things

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