WO2015077958A1 - 一种业务流量控制方法、装置和系统 - Google Patents

一种业务流量控制方法、装置和系统 Download PDF

Info

Publication number
WO2015077958A1
WO2015077958A1 PCT/CN2013/088051 CN2013088051W WO2015077958A1 WO 2015077958 A1 WO2015077958 A1 WO 2015077958A1 CN 2013088051 W CN2013088051 W CN 2013088051W WO 2015077958 A1 WO2015077958 A1 WO 2015077958A1
Authority
WO
WIPO (PCT)
Prior art keywords
business
service
requests
unit
utilization
Prior art date
Application number
PCT/CN2013/088051
Other languages
English (en)
French (fr)
Inventor
海杰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201380002465.4A priority Critical patent/CN103842955B/zh
Priority to PCT/CN2013/088051 priority patent/WO2015077958A1/zh
Publication of WO2015077958A1 publication Critical patent/WO2015077958A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • 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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5019Workload prediction

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a service flow control method, apparatus, and system. Background technique
  • the service flow control policy widely used in storage systems is to set thresholds for one or several of the three main resources of the storage system, namely, memory, central processing unit (CPU), and disk.
  • the threshold When the consumption of resources reaches the threshold, the system is considered to be in an overload state, and then back pressure is performed to achieve the purpose of traffic flow control.
  • the embodiment of the invention provides a service flow control method, device and system, which can flexibly control the flow rate and make full use of system resources.
  • an embodiment of the present invention provides a service flow control method, including:
  • KNN K-nearest-neighbors
  • the acquiring resource load information includes:
  • the KNN algorithm is used to estimate the number N of service requests that the system can process in the next unit period.
  • the memory utilization, the CPU utilization, and the memory utilization according to the latest K unit periods are any two
  • the above information, and the number of service requests processed by the acquisition, estimate the number N of service requests that the system can process in the next unit period including:
  • the submitting the obtained service request to the service thread pool for processing further Includes:
  • the method before the obtaining the N service requests from the service request processing queue, the method further includes:
  • the first or second possible implementation manner of the first aspect after the obtained service request is submitted to the service thread pool for processing, also includes:
  • the embodiment of the present invention further provides a service flow control apparatus, including an information acquiring unit, an estimating unit, a request acquiring unit, and a submitting unit;
  • An information acquiring unit configured to acquire resource load information
  • An estimating unit configured to estimate, according to the resource load information, a number N N of service requests that the system can process in the next unit period, where the N is a positive integer;
  • a request obtaining unit configured to obtain N service requests from the service request processing queue in the next unit period
  • a submitting unit configured to submit the obtained business request to the service thread pool for processing.
  • the information acquiring unit is configured to collect any two or more pieces of information about memory utilization, CPU utilization, and memory utilization of the last K unit periods, and collect the number of processed service requests, where the K is a positive integer. ;
  • the estimating unit is specifically configured to use a K nearest neighbor classification algorithm according to any two or more pieces of information such as memory utilization, CPU utilization, and memory utilization of the latest K unit periods, and the number of service requests processed. Estimate the number N of service requests that the system can process in the next unit period.
  • the estimating unit is specifically configured to convert any two or more pieces of information of the most recent K unit periods of memory utilization, medium CPU utilization, and memory utilization into characteristic vectors of respective periods; respectively calculating the respective The distance between the periodic feature vector and the preset overload vector; according to the distance, the number of service requests processed by each cycle is weighted according to a preset weighting strategy, and the weighting strategy satisfies the smaller distance to empower The larger the condition, the result of multiplying the number of service requests processed in each cycle by the corresponding weights, and dividing by the sum of the ownership values to obtain the service request that the system can process in the next unit period. Number N.
  • the service flow control apparatus further includes a recording unit, where: The recording unit is configured to record the number of acquired service requests.
  • the service flow control apparatus further includes a receiving unit, where:
  • the receiving unit is configured to receive a service request, and add the service request to a service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the service flow control apparatus further includes a sending unit, where:
  • the receiving unit is further configured to receive a processing result about the service request returned by the service thread pool, where the sending unit is configured to send the processing result to the protocol adaptation layer, so as to return the processing result to the user.
  • the embodiment of the present invention further provides a communication system, including any service flow control apparatus provided by the embodiment of the present invention.
  • the embodiment of the present invention further provides a storage system, including a protocol adaptation layer, a private file system, and a storage for storing data, where the private file system includes a quality of service module; Receiving and encapsulating the service request, and transmitting the service request to the quality of service module in the private file system;
  • the service quality module is configured to receive a service request, add the received service request to the service request processing queue, obtain resource load information, and use the KNN algorithm to estimate, according to the resource load information, a system that can be processed in the next unit period.
  • the service request number N the N is a positive integer.
  • the N service requests are obtained from the service request processing queue, and the obtained service request is submitted to the service thread pool for processing.
  • the service quality module is specifically configured to collect any two or more pieces of memory utilization, CPU utilization, and memory utilization in the last K unit periods, and collect the number of processed service requests, where the K is a positive integer. And estimating the system in the next unit period by using the K nearest neighbor classification algorithm according to any two or more pieces of memory utilization, CPU utilization, and memory utilization of the last K unit periods, and the number of service requests processed; The number N of business requests that can be processed.
  • the service quality module is specifically configured to convert any two or more pieces of memory utilization, CPU utilization, and memory utilization of the most recent K unit cycles into characteristic vectors of respective periods;
  • Number N is specifically configured to convert any two or more pieces of memory utilization, CPU utilization, and memory utilization of the most recent K unit cycles into characteristic vectors of respective periods;
  • the quality of service module is further configured to record the number of acquired service requests.
  • the service quality module is further configured to receive a processing result about the service request returned by the service thread pool; and send the processing result to the protocol adaptation layer, so as to return the processing result to the user.
  • an embodiment of the present invention further provides a storage controller, including a central processing unit and a volatile storage medium for storing data;
  • the central processing unit is configured to acquire resource load information, and use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, where the N is a positive integer; In the next unit period, the N service requests are obtained from the service request processing queue; the obtained service request is submitted to the service thread pool for processing.
  • the central processing unit is specifically configured to collect any two of the utilization rate of the volatile storage medium, the utilization rate of the central processing unit, and the utilization rate of the non-volatile storage medium in the last K unit periods.
  • the above information, and the number of service requests processed by the collection, the K is a positive integer; the utilization rate of the volatile storage medium according to the latest K unit periods, the utilization rate of the central processor, and the non-easy Any two or more kinds of information on the utilization rate of the storage medium and the number of service requests processed, use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period.
  • the central processor is specifically configured to use any of the most recent K unit cycles of the utilization of the volatile storage medium, the utilization of the central processing unit, and the utilization rate of the non-volatile storage medium.
  • the central processor is further configured to record the number of acquired service requests.
  • the central processor is further configured to receive a service request, and add the service request to a service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the central processor is further configured to receive a processing result about the service request returned by the service thread pool; and send the processing result to the protocol adaptation layer, so as to return the processing result to the user.
  • an embodiment of the present invention further provides a computer system, including a storage controller and a non-volatile storage medium for storing data, where the storage controller includes a central processing unit and an easy to store data Loss storage medium;
  • the central processing unit is configured to acquire resource load information, and use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, where the N is a positive integer; In the next unit period, the N service requests are obtained from the service request processing queue; the obtained service request is submitted to the service thread pool for processing.
  • the central processing unit is specifically configured to collect the utilization rate of the volatile storage medium in the last K unit periods, the utilization rate of the central processing unit, and the utilization rate of the non-volatile storage medium. Any two or more pieces of information, and the number of service requests processed by the collection, wherein the K is a positive integer; the utilization rate of the volatile storage medium according to the latest K unit periods, and the utilization rate of the central processor And any two or more pieces of information on the utilization rate of the non-volatile storage medium, and the number of service requests processed, use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period.
  • the central processing unit is specifically configured to use the utilization rate of the volatile storage medium of the latest K unit periods, the utilization rate of the central processing unit, and the utilization rate of the non-volatile storage medium. Any two or more pieces of information are respectively converted into characteristic vectors of respective periods; respectively, calculating a distance between the feature vector of each period and a preset overload vector; according to the distance, according to a preset weighting strategy for each period.
  • the number of processed service requests is weighted, and the weighting policy satisfies the condition that the smaller the distance is, the greater the weighting is; the result of multiplying the number of service requests processed by the respective cycles by the corresponding weights is superimposed, And divided by the sum of the ownership values, the number N of service requests that the system can process in the next unit period is obtained.
  • the central processor is further configured to record the number of acquired service requests.
  • the central processor is further configured to receive a service request, and add the service request to a service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the central processor is further configured to receive a processing result about the service request returned by the service thread pool; and send the processing result to the protocol adaptation layer, so as to return the processing result to the user.
  • the resource load information is acquired, and according to the resource load information, the KNN algorithm is used to estimate the number N of service requests that can be processed by the system in the next unit period, and N of the service request processing queues are obtained in the unit period.
  • Business request and submit the obtained business request to The service thread pool is processed; since the solution can comprehensively consider the load of various resources in the storage system and control the traffic according to the load condition, the system can be more fully utilized than the prior art. Resources help improve the overall performance of the system.
  • FIG. 1 is a flowchart of a service flow control method according to an embodiment of the present invention.
  • FIG. 2a is a schematic structural diagram of a storage server in an embodiment of the present invention.
  • 2b is a schematic block diagram showing the structure of a service flow control apparatus according to an embodiment of the present invention.
  • 2c is another flowchart of a service flow control method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a service flow control apparatus according to an embodiment of the present invention.
  • FIG. 4 is another schematic structural diagram of a service flow control apparatus according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a storage system according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a storage controller according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a computer system according to an embodiment of the present invention.
  • System resources are diverse. For storage systems, the most critical system resources are memory, CPU, and memory (such as disk). Requests also have different characteristics. For example, some service requests are CPU type, which consume more CPU resources. Some service requests are input/output (I/O, Input/Output) type, and their memory consumption is Memory (such as disk) resources are more, while some business requests consume more memory resources, etc. Therefore, the system resources consumed by different types of requests are different. In the prior art, the system is in an overload state only when the consumption of a certain system resource reaches a threshold, and the limitation is limited. Use of other resources. For example, when CPU utilization is high and memory utilization is low, the system can still process some type 10 requests, and should not determine that the system is in an overload state, limiting all requests. To this end, an embodiment of the present invention provides a service flow control method, apparatus, and system. The details are described below separately. Embodiment 1
  • a service flow control device which may be an independent entity or integrated in other devices, such as a storage server.
  • a service flow control method includes: acquiring resource load information, and using the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, and processing the service request from the next unit period
  • the N service requests are obtained in the queue, and the obtained service request is submitted to the service thread pool for processing.
  • resource load information for example, the specific information may be as follows:
  • K is a positive integer
  • the memory in the embodiment of the present invention refers to a volatile storage medium
  • the memory refers to a non-volatile storage medium, such as a magnetic disk, a solid state hard disk, or an optical disk.
  • step 101 use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period, where N is a positive integer.
  • the KNN algorithm is used to estimate the number N of service requests that the system can process in the next unit period, such as Specifically, it can be as follows:
  • the memory utilization and CPU utilization of the last K unit periods are obtained in step 101, the memory utilization and CPU utilization of the obtained K unit cycles are respectively converted into characteristic vectors of the respective periods; If the memory utilization and memory utilization of the last K unit periods are obtained in step 101, the obtained memory utilization and memory utilization of the last K unit periods are respectively converted into characteristic vectors of the respective periods; Obtaining the CPU utilization and memory utilization of the last K unit periods in 101, the CPU utilization and the memory utilization rate of the obtained K unit cycles are respectively converted into the characteristic vectors of the respective periods; if in step 101 Obtaining the memory utilization, CPU utilization, and memory utilization of the last K unit cycles, and converting the acquired memory utilization, CPU utilization, and memory utilization of the last K unit cycles into characteristics of each cycle. Vector, and so on, and so on.
  • the memory utilization rate of the n-3th unit period, the CPU utilization rate Y 2 of the n -3th unit period, and the memory of the ⁇ -3 unit period are obtained in step 101
  • memory utilization in the n-2th unit period, CPU utilization in the n-2th unit period, memory utilization in the n-2th unit period, processed in the n-2th unit period The number of service requests, the memory utilization of the n-1th unit period, the CPU utilization of the n-1th unit period, the memory utilization of the n-1th unit period, and the processing of the n-1th unit period
  • the number of business requests, at this time, can be: 3 ⁇ 4 mouth: Converting the memory utilization of the n-3th unit period, the CPU utilization of the n-3th unit period, and the memory utilization of the n-3th unit period into the characteristic vector X of the n-3th unit period ( x n ,
  • the memory utilization of the ⁇ -1 unit period, the CPU utilization of the ⁇ -1 unit period, and the memory utilization of the n-1th unit period are converted into the characteristic vector X 3 of the n-1th unit period ( x 31 , 2, 3 ⁇ 43 ).
  • the overload vector can be set according to the requirements of the actual application. For example, if the memory resource usage of the memory, CPU, and memory is 90%, the overload vector is (90, 90, 90); If the system resource utilization rate of the defined memory is 80%, the overload state, the system resource utilization rate of the CPU is 85%, the overload state, and the system resource utilization rate of the memory is 90%, the overload state is used. For (80, 85, 90), and so on, and so on.
  • the overload vector is Y ( yi , y 2 , y 3 ), the n-3th unit period characteristic vector Xi Xll, Xl2, Xl3 ), and the n-2 unit period characteristic vector ⁇ 2 ( ⁇ 2 ⁇ , x 22 , x 23 ), and the n-1th unit period characteristic vector X 3 (x 31 , x 32 , x 33 ) as an example, B'J:
  • the characteristic vector X ( X11 , x 12 , x 13 ) and the overload vector of the n- 3th unit period are Y ( yi , y 2 ,
  • the large deviation between the characteristic vector X 2 (x 21 , x 22 , x 23 ) of the n-2th unit period and the overload vector Y ( yi , y 2 , y 3 ) is:
  • the characteristic vector X 3 ( x 31 , x 32 , x 33 ) and the overload vector of the n-1th unit period are Y ( yi , y 2 , .
  • the number of service requests processed in each cycle is weighted according to the preset weighting strategy.
  • the weighting policy satisfies the condition that the smaller the distance is, the larger the weighting is, and the specificity may be set according to the requirements of the actual application. For example, the following strategies may be adopted:
  • the weight is equal to the difference between the distance of the current period and the farthest distance.
  • N which is the number of service requests processed in each cycle
  • Wl is the weight corresponding to the cycle
  • K is the number of cycles.
  • the service request processing queue For example, if the number of actual service requests in the service request processing queue is greater than or equal to N, after the N service requests are taken out from the service request processing queue, the service request is stopped, and the next scheduling is performed, where the stop service is stopped.
  • the requested operation can also be called flow control back pressure. If the number of actual service requests in the service request processing queue is less than N, the actual number of requests is taken as the actual number of service requests are taken out from the service request processing queue.
  • the service request here mainly refers to a service request initiated by the client and encapsulated by the protocol adaptation layer, that is, before the step of "acquiring N service requests from the service request processing queue (ie, step 103)",
  • the method can also include: Receiving a service request, and adding the service request to a service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • Each file system has a service thread pool that is used to process requests in the front-end request queue.
  • the number of the obtained service requests may also be recorded, so as to calculate the number of service requests that the system can process in the subsequent unit period. "Time can be used as a reference factor (as one of the resource load information).
  • the processing result of the service request returned by the service thread pool may be received, and the processing result is sent to the protocol adaptation layer, so as to be returned to the user; that is, in step "submit the obtained service request to the service thread pool,
  • the method may further include: receiving a processing result about the service request returned by the service thread pool; sending the processing result to the protocol adaptation layer, so that the protocol adaptation layer passes the protocol layer The result of the processing is returned to the user.
  • the resource load information is acquired, and according to the resource load information, the KNN algorithm is used to estimate the number N of service requests that the system can process in the next unit period, and the service request processing queue is in the unit period.
  • the KNN algorithm is used to estimate the number N of service requests that the system can process in the next unit period, and the service request processing queue is in the unit period.
  • the memory is specifically a disk (ie, a disk array), and the service flow control device is integrated into the storage server.
  • the service flow control device may be specifically integrated in the private file.
  • QOS Quality of Service
  • the figure is a schematic structural diagram of a storage server.
  • the storage server may include a protocol adaptation layer, a virtual file system (VFS, a virtual file system), a private file system, and a disk array.
  • the client can pass the Transmission Control Protocol/Internet Protocol (TCP/IP, Transmission Control Protocol/Internet Protocol)
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the network enters the service request into the storage server, first through the protocol adaptation layer and the virtual file system layer, and then enters the private file system, the private file system.
  • There is a QOS module in it. After that, it is driven into the disk array to perform 10 operations on the data.
  • the service flow control device is mainly located in the Q0S module of the private file system.
  • the service flow control device can obtain resource load information through information collection, for example, through a virtual device layer (ie, a virtual file system), and a cache.
  • the system management module collects memory utilization, CPU utilization, disk utilization, number of service requests processed, and the like for the last K unit periods, and then performs flow control back pressure according to the obtained resource load information, and The resulting processing result is returned to the protocol adaptation layer, and the processing result is returned to the user by the protocol adaptation layer through the protocol layer.
  • the QOS module can also report the information in the system (such as the number of service requests N that the system can process in the next unit period and/or the number of service requests actually processed), and display it in the management interface.
  • the management interface can also accept the configuration management of the Q0S module. Among them, the I/O between each module can be managed and scheduled by the I/O scheduling layer.
  • a service flow control method as shown in Figure 2c, the specific process can be as follows:
  • the Q0S module periodically collects resource load information, for example, the following may be: periodically collecting the CPU utilization rate of the last K unit periods from the system management module, and collecting the memory utilization rate of the latest K unit periods from the cache, And regularly collects the disk utilization rate of the last K unit periods from the virtual device layer, and so on, and also collects the number of processed service requests of the last K unit periods.
  • K is a positive integer
  • the period in which the QOS module collects the resource load information may be set according to the requirements of the actual application, and details are not described herein again.
  • the client sends a service request to the protocol adaptation layer by using a protocol.
  • the protocol adaptation layer encapsulates the received service request, and encapsulates the service request. Add to the business request processing queue.
  • each file system front end (the position parallel to the protocol adaptation layer) has a request processing queue, and all service requests entering the private file system first enter the service request processing team ⁇ ij, which is determined by the private file system.
  • service request processing team ⁇ ij which is determined by the private file system.
  • each private file system has a business thread pool set up to process requests in the front-end request queue. In a per-unit cycle, the service thread pool can take a certain number of service requests from the service request processing queue for processing, and will not be described here.
  • step 201 may be performed first, then steps 202 and 203 may be performed, or steps 202 and 203 may be performed first, then step 201, and so on. I will not repeat them here.
  • the QOS module estimates, according to the obtained resource load information, the number N of service requests that the system can process in the next unit period, where N is a positive integer.
  • N can be as follows:
  • Characteristic vector X ( 50, 20, 30) of the n-5th unit period; Characteristic vector X 2 (60, 35, 40) of the n-4th unit period;
  • Characteristic vector X 3 (65, 90, 80) of the n-3th unit period
  • Characteristic vector X 4 ( 80, 80, 90) of the n-2th unit period
  • the characteristic vector X 5 ( 85, 95, 95 ) of the n-1th unit period.
  • the overload vector can be set according to the requirements of the actual application.
  • the overload is performed as an example of Y (90, 90, 90). Then according to the formula:
  • the characteristic vector (50 20, 30) and the overload vector of the n-5th unit period are Y (90, 90,
  • the characteristic vector X 2 ( 60, 35 , 40) of the n-4th unit period has a distance of 73 for the overload vector Y (90, 90, 90);
  • the characteristic vector X 3 ( 65, 90 , 80) of the n-3th unit period has a distance of 27 for the overload vector Y (90, 90, 90);
  • the characteristic vector X 4 (80, 80, 90) of the n-2th unit period has a distance of 14 for the overload vector Y (90, 90, 90);
  • the characteristic vector X 5 (85, 95, 95) of the n-1th unit period has a distance of 9 for the overload vector Y (90, 90, 90).
  • the number of service requests processed in each cycle is weighted according to the preset weighting strategy.
  • the weighting policy satisfies the condition that the smaller the distance is, the larger the weighting is, and the setting may be set according to the actual application requirement. For example, the difference between the distance equal to the current period and the farthest distance is taken as an example.
  • the correspondence between each distance and the weight can be as shown in Table 2.
  • the value (value) refers to the number of service requests processed in each cycle. As shown in Table 1, the number of service requests processed in the n-5th unit cycle is 100;
  • the number of service requests processed in the n-4th unit period is 350;
  • the number of service requests processed in the n-3th unit period is 450;
  • the number of service requests processed in the n-2th unit cycle is 500;
  • the number of service requests processed in the n-th unit cycle is 600.
  • the number N of service requests processed in the nth unit cycle is 505.
  • the QOS module obtains N service requests from the service request processing queue in the next unit period (that is, in the nth unit period), and submits the obtained service request to the service thread pool for processing. And record the number of business requests obtained.
  • step 203 it is learned that N is 505.
  • 505 service requests can be obtained from the service request processing queue, and then the obtained service request is submitted to the service thread pool for processing, and the record is obtained.
  • the number of business requests to "505".
  • the number of service requests taken out in the unit period is less than N
  • the number of service requests actually processed is taken as the standard, and the number of service requests actually processed is recorded, for example, recorded in the information collection submodule of the QOS module. If the N service requests have been taken out when the unit cycle has not been completed, the service request is stopped and the next scheduling is entered. 206. After processing the service request, the service thread pool returns a processing result about the service request to the QOS module, and the QOS module sends the processing result to the protocol adaptation layer.
  • the protocol adaptation layer returns the processing result to the user through the protocol layer.
  • the embodiment of the present invention adopts the service flow control device integrated in the QOS module, and the QOS module periodically collects the resource load information, and uses the KNN algorithm to estimate the service request that the system can process in the next unit period according to the resource load information.
  • the number N in the unit period, obtains N service requests from the service request processing queue, and submits the obtained service request to the service thread pool for processing; since the solution can comprehensively consider various types in the storage system
  • the characteristics of the resource and the specific load conditions, and control the traffic according to the load situation For example, when the system resources are overloaded, the flow control back pressure is implemented, and when the system resources are sufficient, the service request is obtained according to the maximum capability that the system can handle. , etc., so compared with the prior art, the system resources can be more fully utilized, which is beneficial to improve the overall performance of the system.
  • the embodiment of the present invention further provides a service flow control apparatus.
  • the service flow control apparatus includes an information acquisition unit 301, an estimation unit 302, a request acquisition unit 303, and a submission unit 304. , as follows:
  • the information obtaining unit 301 is configured to acquire resource load information.
  • the estimating unit 302 is configured to estimate the number N of service requests that the system can process in the next unit period according to the resource load information acquired by the information acquiring unit 301, where N is a positive integer;
  • the request obtaining unit 303 is configured to obtain N service requests from the service request processing queue in the next unit period;
  • the service request processing queue For example, if the number of actual service requests in the service request processing queue is greater than or equal to N, after the N service requests are taken out from the service request processing queue, the service request is stopped, and the next scheduling is performed, where the stop service is stopped.
  • the requested operation can also be called flow control back pressure. If the number of actual service requests in the service request processing queue is less than N, the actual number of requests is taken as the actual number of service requests are taken out from the service request processing queue.
  • the submitting unit 304 is configured to submit the service request acquired by the request obtaining unit 303 to the service thread pool for processing. After the submitting unit 304 submits the obtained service request to the service thread pool for processing, the number of the obtained service requests may also be recorded, so as to calculate the number of service requests that the system can process in the subsequent unit period.
  • the time can be used as a reference factor (as one of the resource load information), that is, as shown in FIG. 4, the service flow control device may further include a recording unit 305;
  • the recording unit 305 is configured to record the number of acquired service requests.
  • the information obtaining unit 301 may be configured to collect any two or more pieces of information about the memory utilization rate, the CPU utilization rate, and the memory utilization rate of the last K unit periods, and collect the number of service requests processed.
  • K is a positive integer
  • the estimating unit 302 may be specifically configured to use any two or more pieces of information such as memory utilization, CPU utilization, and memory utilization of the most recent K unit periods, and the number of service requests processed.
  • the KNN algorithm estimates the number N of service requests that the system can process in the next unit period. For example, the details can be as follows:
  • the estimating unit 302 is specifically configured to use the memory utilization rate of the latest K unit periods collected,
  • Any two or more kinds of information in CPU utilization and memory utilization are respectively converted into characteristic vectors of respective periods; respectively, the distance between the feature vector of each period and the preset overload vector is calculated; according to the calculated distance, according to the preset
  • the weighting strategy assigns the number of business requests processed in each cycle; superimposes the number of service numbers processed in each cycle by the corresponding weights, and divides them by the sum of the ownership values to obtain the next The number N of service requests that the system can process in a unit period.
  • the overload vector can be set according to the actual application requirements. For example, if the memory resource usage of the memory, CPU, and memory is 90%, the overload vector is (90, 90, 90); For example, if the system resource utilization rate of the defined memory is 80%, the overload state, the system resource utilization rate of the CPU is 85%, the overload state, and the system resource utilization rate of the memory is 90%, the overload state is The overload vector is (80, 85, 90), and so on.
  • the weighting policy satisfies the condition that the smaller the distance is, the more the weighting is greater, and the setting may be set according to the requirements of the actual application. For example, the weight may be set to be equal to the difference between the distance of the current period and the farthest distance.
  • the weight may be set to be equal to the difference between the distance of the current period and the farthest distance.
  • the service request here mainly refers to a service request initiated by the client and encapsulated by the protocol adaptation layer, that is, as shown in FIG. 4, the service flow control apparatus may further include a receiving unit 306; Receiving a service request, and adding the service request to a service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the processing result of the service request returned by the service thread pool may be received, and the processing result is sent to the protocol adaptation layer, so as to be returned to the user; that is, as shown in FIG. 4, the service flow control device may further include sending Unit 307;
  • the receiving unit 306 is further configured to receive a processing result about the service request returned by the service thread pool;
  • the sending unit 307 is configured to send the processing result to the protocol adaptation layer, so as to return the processing result to the user.
  • the foregoing units may be implemented as an independent entity, and may be implemented in any combination, and may be implemented as the same entity or a plurality of entities.
  • the foregoing units refer to the foregoing method embodiments, and details are not described herein again. .
  • the service flow control device may be a separate entity or integrated in a storage server or the like. For example, it may be integrated into a QOS, Quality of Service module of a private file system in the storage server.
  • the information acquiring unit 301 of the service flow control apparatus of the embodiment of the present invention can obtain the resource load information, and then the estimating unit 302 uses the KNN algorithm to estimate the service request that the system can process in the next unit period according to the resource load information.
  • Number N and then the request obtaining unit 303 acquires N service requests from the service request processing queue in the unit period, and submits the obtained service request to the service thread pool by the submitting unit 304 for processing;
  • the solution can comprehensively consider the load of various resources in the storage system, and control the traffic according to the load situation, so that the system resources can be more fully utilized compared with the prior art, which is beneficial to improving the overall performance of the system. .
  • Embodiment 4 Embodiment 4
  • a communication system provided by the embodiment of the present invention includes any service flow control device provided by the embodiment of the present invention.
  • the service flow control device may be specifically integrated in the storage server.
  • the specific information may be as follows:
  • the storage server is configured to obtain resource load information, and use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, and obtain N from the service request processing queue in the next unit period.
  • the business request submits the obtained business request to the service thread pool for processing.
  • the number of the obtained service requests may also be recorded, so as to be a reference factor when calculating the number of service requests N that the system can process in the subsequent unit period. (as one of the resource load information).
  • the method for obtaining resource load information and estimating the number of service requests that the system can process in the next unit period may be various.
  • the details may be as follows:
  • the storage server may be used to collect any two or more pieces of memory utilization, CPU utilization, and memory utilization in the last K unit periods, and collect the number of processed service requests, that is, collect the last K unit periods. Any two or more of memory utilization, CPU utilization of the last K unit cycles, and memory utilization of the last K unit cycles, and the number of service requests processed in the last K unit cycles; according to the latest K Any two or more pieces of memory utilization, CPU utilization, and memory utilization per unit cycle, and the number of service requests processed.
  • the K nearest neighbor classification algorithm is used to estimate the number of service requests that the system can process in the next unit period. .
  • K is a positive integer
  • any two or more pieces of memory utilization, CPU utilization, and memory utilization of the last K unit periods may be respectively converted into characteristic vectors of respective periods, and feature vectors of respective periods and presets are respectively calculated.
  • the distance between the overload vectors is weighted according to the calculated distance, and the number of service requests processed in each cycle is weighted according to the preset weighting strategy, and the number of service requests processed in each cycle is multiplied by the corresponding weights respectively.
  • the resulting results are superimposed and divided by the sum of the ownership values to obtain the number N of service requests that the system can process in the next unit period.
  • the overload vector can be set according to the requirements of the actual application, and the weighting strategy satisfies the condition that the weight is smaller and the weight is larger.
  • the storage server is further configured to: before receiving the N service requests from the service request processing queue, receive the service request, and add the service request to the service request processing queue, where the service request is adapted by the protocol.
  • the layers are packaged.
  • the storage server can also receive the processing result about the service request returned by the service thread pool, and send the processing result to the protocol adaptation layer for return to the user.
  • the communication system may further include other devices, for example, a client; a client, configured to send a user request to the storage server, and receive a processing result returned by the storage server regarding the service request.
  • a client configured to send a user request to the storage server, and receive a processing result returned by the storage server regarding the service request.
  • the communication system includes any of the service flow control devices provided by the embodiments of the present invention, so that the beneficial effects that can be achieved by any of the service flow control devices provided by the embodiments of the present invention can be implemented. For details, refer to the previous embodiment. No longer. Embodiment 5
  • the embodiment of the present invention further provides a storage system, such as a storage server, as shown in FIG. 5, including a protocol adaptation layer 501, a private file system 502, and a memory 503 for storing data.
  • a storage system such as a storage server, as shown in FIG. 5, including a protocol adaptation layer 501, a private file system 502, and a memory 503 for storing data.
  • Any of the non-volatile storage media may be, for example, a disk (ie, a disk array), a solid state drive, or an optical disk.
  • the private file system 502 may include a quality of service module (ie, a QOS module) 5021, as follows:
  • a protocol adaptation layer 501 configured to receive and encapsulate a service request, and send the service request to a quality of service module in the private file system;
  • the service quality module 5021 is configured to receive a service request, add the received service request to the service request processing queue, obtain resource load information, and use the K nearest neighbor classification KNN algorithm to estimate the system in the next unit period according to the resource load information.
  • the number of service requests N can be various, for example, the specifics can be as follows:
  • the service quality module 5021 may be configured to collect any two or more pieces of information about memory utilization, CPU utilization, and memory utilization (that is, utilization of the memory 503) in the last K unit periods, and collect the processed service request. According to the memory utilization, CPU utilization, memory utilization and the number of service requests processed in the last K unit periods, the K nearest neighbor classification algorithm is used to estimate the number N of service requests that the system can process in the next unit period.
  • K is a positive integer
  • the details can be as follows:
  • the service quality module 5021 may be specifically configured to convert any two or more pieces of memory utilization, CPU utilization, and memory utilization of the last K unit periods into characteristic vectors of respective periods; respectively, calculating characteristics of each period The distance between the vector and the preset overload vector; according to the calculated distance, the number of service requests processed in each cycle is weighted according to the preset weighting strategy; multiplying the number of service requests processed in each cycle by The results generated after the corresponding weights are superimposed and divided by the sum of the ownership values to obtain the number N of service requests that the system can process in the next unit period.
  • the overload vector can be set according to the requirements of the actual application, and the weighting strategy satisfies the condition that the weight is smaller and the weight is larger. For details, refer to the previous embodiment, and details are not described herein.
  • the service quality module 5021 can also be used to record the number of acquired service requests, so as to be a reference factor (as one of the resource load information) when calculating the number of service requests N that the system can process in the subsequent unit period. .
  • the QoS module 5021 is further configured to receive a processing result about the service request returned by the service thread pool; send the processing result to the protocol adaptation layer 501, so that the protocol adaptation layer 501 returns the processing result to the user. .
  • the storage system may further include other modules, such as a virtual file system, etc., and the virtual file system is mainly used to provide resource load information of the system, for example, providing memory utilization of the last K unit cycles to the quality of service module. 5021.
  • the virtual file system is mainly used to provide resource load information of the system, for example, providing memory utilization of the last K unit cycles to the quality of service module. 5021.
  • the storage system provided by the embodiment of the present invention can obtain resource load information, and use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, and the service period in the unit period.
  • Requesting a processing queue to obtain N business requests, and The obtained service request is submitted to the service thread pool for processing; since the solution can comprehensively consider the load condition of various resources in the storage system, and control the traffic according to the load condition, it is compared with the prior art. In other words, system resources can be more fully utilized, which helps to improve the overall performance of the system.
  • Embodiment 6 Embodiment 6
  • the embodiment of the present invention further provides a storage controller.
  • the storage controller may include a central processing unit 601 and a volatile storage medium 602 for storing data; as follows: The central processing unit 601 And for obtaining resource load information; according to the resource load information, using the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period, where N is a positive integer; in the next unit period, the service request The service queue obtains N service requests; the obtained service request is submitted to the service thread pool for processing.
  • the central processing unit 601 can also record the number of the obtained service requests, so as to calculate the number of service requests N that the system can process in the subsequent unit period. As a reference factor (as one of the resource load information).
  • the method for obtaining resource load information and estimating the number of service requests that the system can process in the next unit period may be various.
  • the details may be as follows:
  • the central processing unit 601 can be used to collect any two or more kinds of information about the utilization rate of the volatile storage medium 602 of the last K unit periods, the utilization rate of the central processing unit 601, and the utilization rate of the non-volatile storage medium. And collecting the number of service requests processed; any two or more of the utilization rate of the volatile storage medium 602, the utilization rate of the central processing unit 601, and the utilization rate of the nonvolatile storage medium according to the last K unit cycles.
  • the information, as well as the number of business requests processed uses the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period.
  • the volatile storage medium 602 may specifically be a device such as a memory, and the non-volatile storage medium may be a device such as a magnetic disk, a solid state hard disk, or an optical disk.
  • K is a positive integer
  • the central processing unit 601 may specifically use any one or more of the utilization rate of the volatile storage medium 602, the utilization rate of the central processing unit 601, and the utilization rate of the nonvolatile storage medium in the last K unit cycles.
  • the information is separately converted into characteristic vectors of respective periods; the respective periods are respectively calculated
  • the distance between the feature vector and the preset overload vector; according to the distance, the number of service requests processed by each cycle is weighted according to the preset weighting strategy; and the number of service requests processed in each cycle is multiplied by corresponding
  • the result of the weighting is superimposed and divided by the sum of the ownership values to obtain the number N of service requests that the system can process in the next unit period.
  • the overload vector can be set according to the requirements of the actual application, and the weighting strategy satisfies the condition that the weight is smaller and the weight is larger. For details, refer to the previous embodiment, and details are not described herein.
  • the central processing unit 601 is further configured to receive a service request, and add the service request to the service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the central processing unit 601 can also receive the processing result of the service request returned by the service thread pool, and send the processing result to the protocol adaptation layer for return to the user.
  • the storage controller provided by the embodiment of the present invention can obtain resource load information, and use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period according to the resource load information, in the unit period, Obtaining N service requests in the service request processing queue, and submitting the obtained service request to the service thread pool for processing; because the solution can comprehensively consider the load status of various resources in the storage system, and according to the load situation In order to control the traffic, the system resources can be more fully utilized than in the prior art, which is beneficial to improving the overall performance of the system.
  • the embodiment of the present invention further provides a computer system, including any one of the storage controller and the non-volatile storage medium for storing data provided by the embodiment of the present invention.
  • the system can include a storage controller 701 and a non-volatile storage medium 702, wherein the storage controller 701 can include a central processing unit 7011 and a volatile storage medium 7012 for storing data; as follows:
  • the central processing unit 7011 is configured to acquire resource load information. According to the resource load information, use the K nearest neighbor classification KNN algorithm to estimate the number N of service requests that the system can process in the next unit period, where N is a positive integer; Obtaining N service requests from the service request processing queue in one unit period; submitting the obtained service request to the service thread pool for processing.
  • the central processing unit 7011 After the obtained service request is submitted to the service thread pool, the central processing unit 7011 It is also possible to record the number of service requests obtained so as to be a reference factor (as one of the resource load information) when calculating the number of service requests N that the system can process in the subsequent unit period.
  • the method for obtaining resource load information and estimating the number of service requests that the system can process in the next unit period may be various.
  • the details may be as follows:
  • the central processing unit 7011 can be specifically configured to collect any two or more of the utilization rate of the volatile storage medium 7012 in the last K unit periods, the utilization rate of the central processing unit 7011, and the utilization rate of the nonvolatile storage medium 702. Information, and the number of service requests processed by the acquisition; in accordance with the utilization of the volatile storage medium 7012 of the most recent K unit periods, the utilization of the central processing unit 7011, and the utilization of the non-volatile storage medium 702 Any two or more kinds of information, and the number of service requests processed, use the KNN algorithm to estimate the number N of service requests that the system can process in the next unit period.
  • the volatile storage medium 7012 may specifically be a device such as a memory, and the non-volatile storage medium 702 may be a device such as a magnetic disk, a solid state hard disk, or an optical disk.
  • K is a positive integer
  • the central processing unit 7011 may specifically calculate the utilization ratio of the volatile storage medium 7012, the utilization rate of the central processing unit 7011, and the utilization rate of the nonvolatile storage medium 702 in the last K unit periods.
  • the above information is respectively converted into characteristic vectors of respective periods; respectively, the distance between the feature vector of each period and the preset overload vector is calculated; according to the distance, the service processed by each period according to the preset weighting strategy is used.
  • the number of requests is weighted; the result of multiplying the number of service requests processed in each cycle by the corresponding weights is superimposed, and divided by the sum of the ownership values to obtain the number of service requests that the system can process in the next unit period. .
  • the overload vector can be set according to the requirements of the actual application, and the weighting strategy satisfies the condition that the weight is smaller and the weight is larger. For details, refer to the previous embodiment, and details are not described herein.
  • the central processing unit 7011 is further configured to receive a service request, and add the service request to the service request processing queue, where the service request is encapsulated by a protocol adaptation layer.
  • the central processing unit 7011 may further receive a processing result about the service request returned by the service thread pool, and send the processing result to the protocol adaptation layer, so as to be returned to the user.
  • the storage controller provided by the embodiment of the present invention can obtain resource load information according to
  • the resource load information is used to estimate the number N of service requests that the system can process in the next unit period, and obtain N service requests from the service request processing queue in the unit period, and submit the obtained service request.
  • the service thread pool is processed for processing; since the solution can comprehensively consider the load status of various resources in the storage system and control the traffic according to the load condition, the system can be more fully utilized than the prior art.
  • System resources are conducive to improving the overall performance of the system.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.

Abstract

一种业务流量控制方法,包括:获取资源负载信息;根据所述资源负载信息,利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N,在所述单位周期内,从业务请求处理队列中获取 N个的业务请求,将获取到的业务请求提交给业务线程池,以进行处理。相应的,还提供一种业务流量控制装置和系统。

Description

一种业务流量控制方法、 装置和系统
技术领域
本发明涉及通信技术领域,具体涉及一种业务流量控制方法、装置和系统。 背景技术
由于存储系统中的各种资源是有限的, 因此, 当系统资源紧张时, 需要控 制流入整个系统的业务流量, 以避免整个系统过载,导致系统由于资源耗尽而 宕机。
目前存储系统所广泛使用的业务流量控制策略是对存储系统的三种主要 资源, 即内存、 中央处理器( CPU , Central Processing Unit )和磁盘中的一种 或几种设定阈值,一旦有一种资源的消耗达到该阈值,则认为系统是过载状态, 然后进行反压, 从而达到业务流量控制的目的。
然而, 由于系统资源是多样性的, 而业务请求也是具有不同类型, 因此, 不同类型的业务请求所耗费的系统资源也是不同的,如果仅凭某一种系统资源 的消耗达到阈值就判定系统处于过载状态,将会限制其他资源的利用,导致系 统资源未能被充分利用, 也就是说, 现有技术的业务流量控制方法不够灵活, 未能充分利用系统资源。 发明内容
本发明实施例提供一种业务流量控制方法、装置和系统, 可以灵活地对流 量进行控制, 充分利用系统资源。
第一方面, 本发明实施例提供一种业务流量控制方法, 包括:
获取资源负载信息;
根据所述资源负载信息, 利用 K最近邻分类(KNN, k-nearest-neighbors ) 算法估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正整数; 在所述下一个单位周期内, 从业务请求处理队列中获取 N个的业务请求; 将获取到的业务请求提交给业务线程池, 以进行处理。
在第一种可能的实施方式中, 结合第一方面, 所述获取资源负载信息, 包 括:
采集最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率中的 任意两种以上信息, 以及采集所处理的业务请求数, 所述 K为正整数; 所述根据所述资源负载信息估算下一个单位周期内系统能够处理的业务 请求数 N, 包括:
根据所述最近 K个单位周期的内存利用率、 CPU利用率、 存储器利用率 和所处理的业务请求数, 利用 KNN算法估算下一个单位周期内系统能够处理 的业务请求数 N。
在第二种可能的实施方式中, 结合第一方面的第一种可能的实施方式, 所 述根据所述最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率中 的任意两种以上信息,以及采集所处理的业务请求数估算下一个单位周期内系 统能够处理的业务请求数 N, 包括:
将所述最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率中 的任意两种以上信息分别转换成各个周期的特性向量;
分别计算所述各个周期的特征向量和预置的过载向量之间的距离; 根据所述距离, 按照预置的赋权策略为各个周期所处理的业务请求数赋 权, 所述赋权策略满足距离越小赋权越大的条件;
将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结果 进行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业务 请求数 N。
在第三种可能的实施方式中, 结合第一方面、第一方面的第一或第二种可 能的实施方式,所述将获取到的业务请求提交给业务线程池,以进行处理之后, 还包括:
记录获取到的业务请求数。
在第四种可能的实施方式中, 结合第一方面、第一方面的第一或第二种可 能的实施方式, 所述从业务请求处理队列中获取 N个的业务请求之前, 还包 括:
接收业务请求, 并将所述业务请求添加到业务请求处理队列中, 所述业务 请求由协议适配层进行封装。
在第五种可能的实施方式中, 结合第一方面、第一方面的第一或第二种可 能的实施方式,所述将获取到的业务请求提交给业务线程池,以进行处理之后, 还包括:
接收业务线程池返回的关于业务请求的处理结果;
将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。 第二方面, 本发明实施例还提供一种业务流量控制装置, 包括信息获取单 元、 估算单元、 请求获取单元和提交单元;
信息获取单元, 用于获取资源负载信息;
估算单元, 用于根据所述资源负载信息, 利用 KNN算法估算下一个单位 周期内系统能够处理的业务请求数 N, 所述 N为正整数;
请求获取单元, 用于在所述下一个单位周期内,从业务请求处理队列中获 取 N个的业务请求;
提交单元, 用于将获取到的业务请求提交给业务线程池, 以进行处理。 在第一种可能的实施方式中, 结合第二方面, 其中:
所述信息获取单元,具体用于采集最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及采集所处理的业务请求 数, 所述 K为正整数;
所述估算单元,具体用于根据所述最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及所处理的业务请求数, 利 用 K最近邻分类算法估算下一个单位周期内系统能够处理的业务请求数 N。
在第二种可能的实施方式中, 结合第二方面的第一种可能的实施方式, 其 中:
所述估算单元,具体用于将所述最近 K个单位周期的内存利用率、中 CPU 利用率和存储器利用率中的任意两种以上信息分别转换成各个周期的特性向 量; 分别计算所述各个周期的特征向量和预置的过载向量之间的距离; 根据所 述距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权, 所述赋权 策略满足距离越小赋权越大的条件;将所述各个周期所处理的业务请求数分别 乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到下一个单 位周期内系统能够处理的业务请求数N。
在第三种可能的实施方式中, 结合第二方面、第二方面的第一或第二种可 能的实施方式, 该业务流量控制装置还包括记录单元, 其中: 所述记录单元, 用于记录获取到的业务请求数。
在第三种可能的实施方式中, 结合第二方面、第二方面的第一或第二种可 能的实施方式, 该业务流量控制装置还包括接收单元, 其中:
所述接收单元, 用于接收业务请求, 并将所述业务请求添加到业务请求处 理队列中, 所述业务请求由协议适配层进行封装。
在第三种可能的实施方式中, 结合第二方面、第二方面的第一或第二种可 能的实施方式, 该业务流量控制装置还包括发送单元, 其中:
所述接收单元, 还用于接收业务线程池返回的关于业务请求的处理结果; 所述发送单元, 用于将所述处理结果发送给协议适配层, 以便将所述处理 结果返回给用户。
第三方面, 本发明实施例还提供一种通信系统, 包括本发明实施例提供的 任一种业务流量控制装置。
第四方面, 本发明实施例还提供一种存储系统, 包括协议适配层、 私有文 件系统和用于存储数据的存储器, 所述私有文件系统包括服务质量模块; 所述协议适配层, 用于接收并封装业务请求,将业务请求发送给私有文件 系统中的服务质量模块;
所述服务质量模块, 用于接收业务请求,将接收到的业务请求添加到业务 请求处理队列中, 获取资源负载信息, 利用 KNN算法根据所述资源负载信息 估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正整数, 在 所述下一个单位周期内, 从业务请求处理队列中获取 N个的业务请求, 将获 取到的业务请求提交给业务线程池, 以进行处理。
在第一种可能的实施方式中, 结果第四方面, 其中:
所述服务质量模块,具体用于采集最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及采集所处理的业务请求 数, 所述 K为正整数; 根据所述最近 K个单位周期的内存利用率、 CPU利用 率和存储器利用率中的任意两种以上信息, 以及所处理的业务请求数, 利用 K 最近邻分类算法估算下一个单位周期内系统能够处理的业务请求数 N。
在第二种可能的实施方式中, 结果第四方面的第一种可能的实施方式, 其 中: 所述服务质量模块, 具体用于将所述最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息分别转换成各个周期的特 性向量; 分别计算所述各个周期的特征向量和预置的过载向量之间的距离; 根 据所述距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权, 所述 赋权策略满足距离越小赋权越大的条件;将所述各个周期所处理的业务请求数 分别乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到下一 个单位周期内系统能够处理的业务请求数 N。
在第三种可能的实施方式中, 结果第四方面、第四方面的第一或第二种可 能的实施方式, 其中:
所述服务质量模块, 还用于记录获取到的业务请求数。
在第三种可能的实施方式中, 结果第四方面、第四方面的第一或第二种可 能的实施方式, 其中:
所述服务质量模块,还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
第五方面, 本发明实施例还提供一种存储控制器, 包括中央处理器和用于 存储数据的易失性存储介质;
所述中央处理器, 用于获取资源负载信息; 才艮据所述资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正 整数; 在所述下一个单位周期内, 从业务请求处理队列中获取 N个的业务请 求; 将获取到的业务请求提交给业务线程池, 以进行处理。
在第一种可能的实施方式中, 结合第五方面, 其中:
所述中央处理器, 具体用于采集最近 K个单位周期的所述易失性存储介 质的利用率、所述中央处理器的利用率和非易失性存储介质的利用率中的任意 两种以上信息, 以及采集所处理的业务请求数, 所述 K为正整数; 根据所述 最近 K个单位周期的所述易失性存储介质的利用率、 所述中央处理器的利用 率和非易失性存储介质的利用率中的任意两种以上信息,以及所处理的业务请 求数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N。
在第二种可能的实施方式中, 结合第五方面的第一种可能的实施方式, 其 中: 所述中央处理器, 具体用于将所述最近 K个单位周期的所述易失性存储 介质的利用率、所述中央处理器的利用率和非易失性存储介质的利用率中的任 意两种以上信息分别转换成各个周期的特性向量;分别计算所述各个周期的特 征向量和预置的过载向量之间的距离; 根据所述距离,按照预置的赋权策略为 各个周期所处理的业务请求数赋权,所述赋权策略满足距离越小赋权越大的条 件;将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结果进 行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业务请 求数 N。
在第三种可能的实施方式中, 结合第五方面、第五方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器, 还用于记录获取到的业务请求数。
在第四种可能的实施方式中, 结合第五方面、第五方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器,还用于接收业务请求, 并将所述业务请求添加到业务请 求处理队列中, 所述业务请求由协议适配层进行封装。
在第四种可能的实施方式中, 结合第五方面、第五方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器, 还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
第六方面, 本发明实施例还提供一种计算机系统, 包括存储控制器和用于 存储数据的非易失性存储介质, 其中, 所述存储控制器包括中央处理器和用于 存储数据的易失性存储介质;
所述中央处理器, 用于获取资源负载信息; 才艮据所述资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正 整数; 在所述下一个单位周期内, 从业务请求处理队列中获取 N个的业务请 求; 将获取到的业务请求提交给业务线程池, 以进行处理。
在第一种可能的实施方式中, 结合第六方面, 其中:
所述中央处理器, 具体用于采集最近 K个单位周期的所述易失性存储介 质的利用率、所述中央处理器的利用率和所述非易失性存储介质的利用率中的 任意两种以上信息, 以及采集所处理的业务请求数, 所述 K为正整数; 根据 所述最近 K个单位周期的所述易失性存储介质的利用率、 所述中央处理器的 利用率和所述非易失性存储介质的利用率中的任意两种以上信息,以及所处理 的业务请求数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请 求数 N。
在第二种可能的实施方式中, 结合第六方面的第一种可能的实施方式, 其 中:
所述中央处理器, 具体用于将所述最近 K个单位周期的所述易失性存储 介质的利用率、所述中央处理器的利用率和所述非易失性存储介质的利用率中 的任意两种以上信息分别转换成各个周期的特性向量;分别计算所述各个周期 的特征向量和预置的过载向量之间的距离; 根据所述距离,按照预置的赋权策 略为各个周期所处理的业务请求数赋权,所述赋权策略满足距离越小赋权越大 的条件;将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结 果进行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业 务请求数 N。
在第三种可能的实施方式中, 结合第六方面、第六方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器, 还用于记录获取到的业务请求数。
在第四种可能的实施方式中, 结合第六方面、第六方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器,还用于接收业务请求, 并将所述业务请求添加到业务请 求处理队列中, 所述业务请求由协议适配层进行封装。
在第五种可能的实施方式中, 结合第六方面、第六方面的第一或第二种可 能的实施方式, 其中:
所述中央处理器, 还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
本发明实施例采用获取资源负载信息, 根据该资源负载信息, 利用 KNN 算法估算下一个单位周期内系统能够处理的业务请求数 N, 在该单位周期内, 从业务请求处理队列中获取 N个的业务请求, 并将获取到的业务请求提交给 业务线程池, 以进行处理; 由于该方案可以综合考虑存储系统中各种资源的负 载情况, 并根据该负载情况来对流量进行控制, 所以相对于现有技术而言, 可 以更加充分地利用系统资源, 有利于提高系统的整体性能。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作筒单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创 造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的业务流量控制方法的流程图;
图 2a是本发明实施例中存储服务器的结构示意图;
图 2b是本发明实施例中业务流量控制装置的结构示意框图;
图 2c是本发明实施例提供的业务流量控制方法的另一流程图;
图 3是本发明实施例提供的业务流量控制装置的结构示意图;
图 4是本发明实施例提供的业务流量控制装置的另一结构示意图; 图 5是本发明实施例提供的存储系统的结构示意图;
图 6是本发明实施例提供的存储控制器的结构示意图;
图 7是本发明实施例提供的计算机系统的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域技术人员在没有作出创造性劳 动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
系统资源是多样性的, 对于存储系统, 最关键的系统资源有内存、 CPU、 存储器(比如磁盘)。 而请求也是具有不同特征的, 比如有的业务请求是 CPU 型, 其耗费的 CPU资源多一些, 有的业务请求是输入 /输出(I/O, Input/Output ) 型的, 其耗费的内存和存储器(比如磁盘)资源多一些, 而有的业务请求则是 耗费内存资源多一些, 等等, 因此, 不同类型请求耗费的系统资源是不同的。 现有技术仅凭某一种系统资源的消耗达到阈值就判定系统处于过载状态,会限 制其他资源的利用。 比如当 CPU利用率很高, 内存利用率很低时, 系统还是能 够再处理一些 10型请求的, 而不应该判定系统处于过载状态, 限制所有请求。 为此, 本发明实施例提供一种业务流量控制方法、 装置和系统。 以下分别进行 详细说明。 实施例一、
本发明实施例将从业务流量控制装置的角度进行描述,该业务流量控制装 置可以是独立的实体, 也可以集成在其它设备, 比如存储服务器等设备中。
一种业务流量控制方法, 包括:获取资源负载信息,根据该资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 在该下 一个单位周期内, 从业务请求处理队列中获取 N个的业务请求, 将获取到的 业务请求提交给业务线程池, 以进行处理。
如图 1所示, 具体流程可以如下:
101、 获取资源负载信息; 例如, 具体可以如下:
采集最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率中的 任意两种以上信息, 以及采集所处理的业务请求数, 即采集最近 K个单位周 期的内存利用率、最近 K个单位周期的 CPU利用率和最近 K个单位周期的存 储器利用率中的任意两种以上信息, 以及获取最近 K个单位周期所处理的业 务请求数。 比如, 具体可以如下:
采集最近 K个单位周期的内存利用率、最近 K个单位周期的 CPU利用率、 以及获取最近 K个单位周期所处理的业务请求数; 或者,
采集最近 K个单位周期的内存利用率、 最近 K个单位周期的存储器利用 率、 以及获取最近 K个单位周期所处理的业务请求数; 或者,
采集最近 K个单位周期的 CPU利用率、最近 K个单位周期的存储器利用 率、 以及获取最近 K个单位周期所处理的业务请求数; 或者,
采集最近 K个单位周期的内存利用率、最近 K个单位周期的 CPU利用率、 最近 K个单位周期的存储器利用率、 以及获取最近 K个单位周期所处理的业 务请求数。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。 需说明的是, 为了描述方便, 在本发明实施例中, 将以采集最近 K个单 位周期的内存利用率、 CPU 利用率、 存储器利用率和所处理的业务请求数为 例进行说明。
此外还需说明的是, 本发明实施例中的内存指的是易失性存储介质, 而存 储器指的是非易失性存储介质, 比如, 磁盘、 固态硬盘或光盘等。
102、 根据步骤 101 中获取到的资源负载信息, 利用 KNN算法估算下一 个单位周期内系统能够处理的业务请求数 N, 其中 N为正整数。
例如, 具体可以根据该最近 K个单位周期的内存利用率、 CPU利用率、 存储器利用率和所处理的业务请求数, 利用 KNN算法估算下一个单位周期内 系统能够处理的业务请求数 N, 比如, 具体可以如下:
( 1 )将该最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率 中的任意两种以上信息分别转换成各个周期的特性向量;
比如, 如果步骤 101中获取的是最近 K个单位周期的内存利用率和 CPU 利用率, 则将获取到的最近 K个单位周期的内存利用率和 CPU利用率分别转 换成各个周期的特性向量; 如果步骤 101 中获取的是最近 K个单位周期的内 存利用率和存储器利用率, 则将获取到的最近 K个单位周期的内存利用率和 存储器利用率分别转换成各个周期的特性向量;如果步骤 101中获取的是最近 K个单位周期的 CPU利用率和存储器利用率, 则将获取到的最近 K个单位周 期的 CPU利用率和存储器利用率分别转换成各个周期的特性向量; 如果步骤 101 中获取的是最近 K个单位周期的内存利用率、 CPU利用率和存储器利用 率, 则将获取到的最近 K个单位周期的内存利用率、 CPU利用率和存储器利 用率分别转换成各个周期的特性向量, 以此类推, 等等。
例如, 以 K为 3为例,若步骤 101中获取了第 n-3个单位周期的内存利用 率、第 n-3个单位周期的 CPU利用率 Y2和第 η-3个单位周期的存储器利用率、 第 n-2个单位周期的内存利用率、 第 n-2个单位周期的 CPU利用率、 第 n-2个 单位周期的存储器利用率、 第 n-2个单位周期的所处理的业务请求数、 第 n-1 个单位周期的内存利用率、第 n-1个单位周期的 CPU利用率、第 n-1个单位周 期的存储器利用率、 第 n-1个单位周期的所处理的业务请求数, 则此时, 可以 :¾口下: 将第 n-3个单位周期的内存利用率、第 n-3个单位周期的 CPU利用率和第 n-3个单位周期的存储器利用率转换成第 n-3个单位周期的特性向量 X (xn,
Xl2, Xl3 );
将第 n-2个单位周期的内存利用率、第 n-2个单位周期的 CPU利用率和第 n-2个单位周期的存储器利用率转换成第 n-2个单位周期的特性向量 X2 (x21, χ22, χ23 );
第 η-1个单位周期的内存利用率、 第 η-1个单位周期的 CPU利用率和第 n-1个单位周期的存储器利用率转换成第 n-1个单位周期的特性向量 X3 (x31, 2, ¾3 )。
(2)分别计算各个周期的特征向量和预置的过载向量之间的距离。
其中, 过载向量可以根据实际应用的需求进行设置, 例如, 若定义内存、 CPU和存储器的系统资源利用率均为 90%时为过载状态, 则过载向量为(90, 90, 90); 又例如, 若定义内存的系统资源利用率为 80%时为过载状态、 CPU 的系统资源利用率为 85%时为过载状态、以存储器的系统资源利用率均为 90% 时为过载状态, 则过载向量为 (80, 85, 90), 以此类推, 等等。
其中, 两个特征向量之间的距离可以采用欧几里德距离来表示, 比如, 设 有两个特征向量, X= (xl x2, x3), Y= (yi, y2, y3), 则这两个特征向量之 间的 巨离 dis (X, Y)可
Figure imgf000012_0001
例如, 以过载向量为 Y (yi, y2, y3)、 第 n-3个单位周期的特性向量 Xi Xll, Xl2, Xl3 )、 第 n-2 个单位周期的特性向量 Χ22ι, x22, x23 )、 以及第 n-1个单位周期的特性向量 X3 (x31, x32, x33 ) 为例, 贝' J:
第 n-3个单位周期的特性向量 X (Xll, x12, x13)与过载向量为 Y (yi, y2,
Figure imgf000012_0002
第 n-2个单位周期的特性向量 X2 (x21, x22, x23 )与过载向量为 Y (yi, y2, y3)之间的 巨离为:
Figure imgf000013_0001
第 n-1个单位周期的特性向量 X3 ( x31, x32, x33 )与过载向量为 Y ( yi, y2, 。
Figure imgf000013_0002
( 3 )根据计算出的距离, 按照预置的赋权策略为各个周期所处理的业务 请求数赋权。
其中, 该赋权策略满足距离越小赋权越大的条件, 具体可以根据实际应用 的需求而设置, 例如, 可以采用如下策略:
权值等于本周期的距离与最远距离之间的差值。
当然, 还可以采用其他的策略, 在此不再列举。
( 4 )将该各个周期所处理的业务请求数分别乘以对应的权值后产生的结 果进行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业 务请求 ¾ N。 例如, 具体可以采用如 result =
Figure imgf000013_0003
其中, 所得到的 result就是 N, 为各个周期所处理的业务请求数, Wl 为该周期对应的权值, K为周期数。
103、 在该下一个单位周期内, 从业务请求处理队列中获取 N个的业务请 求。
比如, 如果业务请求处理队列中实际的业务请求数大于等于 N个, 则在 从业务请求处理队列中取出 N个业务请求后, 停止取业务请求, 进入下次调 度, 其中, 这种停止取业务请求的操作, 也可以称为流控反压。 而如果业务请 求处理队列中实际的业务请求数少于 N个, 则以实际的请求数为准, 即从业 务请求处理队列中取出实际数目的业务请求。
其中, 这里的业务请求主要指由客户端发起, 并由协议适配层进行封装后 的业务请求, 即在步骤 "从业务请求处理队列中获取 N个的业务请求(即步 骤 103 )" 之前, 该方法还可以包括: 接收业务请求, 并将该业务请求添加到业务请求处理队列中, 其中, 该业 务请求由协议适配层进行封装。
104、 将获取到的业务请求提交给业务线程池, 以进行处理。
其中,每个文件系统都设置了业务线程池, 用于处理前端请求队列中的请 求。
其中, 在步骤 "将获取到的业务请求提交给业务线程池, 以进行处理"之 后, 还可以记录获取到的业务请求数, 以便在计算后面的单位周期的 "系统能 够处理的业务请求数 N"时可以作为一个参考因素(作为资源负载信息之一)。
此后,还可以接收业务线程池返回的关于业务请求的处理结果, 并将该处 理结果发送给协议适配层, 以便返回给用户; 即在步骤 "将获取到的业务请求 提交给业务线程池, 以进行处理(即步骤 104 )" 之后, 该方法还可以包括: 接收业务线程池返回的关于业务请求的处理结果;将该处理结果发送给协 议适配层, 以便协议适配层通过协议层将该处理结果返回给用户。
由上可知, 本发明实施例采用获取资源负载信息, 根据该资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N,在该单位 周期内, 从业务请求处理队列中获取 N个的业务请求, 并将获取到的业务请求 提交给业务线程池, 以进行处理; 由于该方案可以综合考虑存储系统中各种资 源的负载情况, 并根据该负载情况来对流量进行控制, 所以相对于现有技术而 言, 可以更加充分地利用系统资源, 有利于提高系统的整体性能。 实施例二、
根据实施例一所描述的方法, 以下将举例作进一步详细说明。
为了描述方便, 在本实施例中, 将以存储器具体为磁盘(即磁盘阵列)、 且业务流量控制装置集成在存储服务器中为例进行说明, 其中, 该业务流量控 制装置具体可以集成在私有文件系统的服务质量(QOS, Quality of Service ) 模块中。
如图 2a所示, 该图为存储服务器的结构示意图, 由图 2a可知, 存储服务器 可以包括协议适配层、 虚拟文件系统( VFS , Virtual File System )、 私有文件系 统和磁盘阵列等。 其中, 客户端可以通过传输控制协议 /因特网互联协议 ( TCP/IP, Transmission Control Protocol/Internet Protocol, 筒称网给通讯协议 ) 网络将业务请求进入存储服务器, 首先经过协议适配层与虚拟文件系统层处 理, 然后进入私有文件系统, 该私有文件系统中有个 QOS模块。 此后经过驱动 进入磁盘阵列中, 进行数据的 10操作。
而业务流量控制装置主要位于私有文件系统的 Q0S模块中, 例如,如图 2b 所示, 业务流量控制装置可以通过信息采集来获取资源负载信息, 比如通过虚 拟设备层(即虚拟文件系统)、 緩存和系统管理模块中来采集最近 K个单位周 期的内存利用率、 CPU利用率、 磁盘利用率和所处理的业务请求数等等, 然后 根据获取到的资源负载信息进行流控反压,并将最终得到的处理结果返回给协 议适配层, 由协议适配层通过协议层将处理结果返回给用户。在此过程中 QOS 模块还可以将系统中信息(比如下一个单位周期内系统能够处理的业务请求数 N等信息和 /或实际处理的业务请求数等)及时地上报,并由管理界面进行显示, 而该管理界面也可以接受 Q0S模块的配置管理。 其中, 各个模块之间的 I/O可 以由 I/O调度层进行管理和调度。
基于上述业务流量控制装置的结构示意框图,以下将起具体执行流程进行 详细说明。
一种业务流量控制方法, 如图 2c所示, 具体流程可以如下:
201、 Q0S模块中定时采集资源负载信息, 比如, 具体可以如下: 定时从系统管理模块中采集最近 K个单位周期的 CPU的利用率、 定时从緩 存中采集最近 K个单位周期的内存利用率、 以及定时从虚拟设备层中采集最近 K个单位周期的磁盘利用率等等, 此外, 还会采集最近 K个单位周期的所处理 的业务请求数。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。
此外, QOS模块采集资源负载信息的周期可以根据实际应用的需求进行设 置, 在此不再赘述。
202、 客户端通过协议发送业务请求给协议适配层。
203、 协议适配层对接收到的业务请求进行封装, 并将封装后的业务请求 添加到业务请求处理队列中。
需说明的是, 每个文件系统前端(与协议适配层平行的位置)都设置了请 求处理队列,所有进入私有文件系统的业务请求都会首先进入业务请求处理队 歹 ij , 由私有文件系统决定这些业务请求何时出队处理。 其中, 每个私有文件系 统都设置了业务线程池, 用于处理前端请求队列中的请求。 在每单位周期内, 业务线程池可以从业务请求处理队列中取出一定数目的业务请求进行处理,在 此不再赘述。
其中, 步骤 201和步骤 202、 203之间的执行顺序不分先后, 比如, 可以先 执行步骤 201 , 再执行步骤 202和 203 , 也可以先执行步骤 202和 203 , 再执行步 骤 201 , 等等, 在此不再赘述。
204、 QOS模块根据获取到的资源负载信息估算下一个单位周期内系统能 够处理的业务请求数 N, 其中 N为正整数。
例如, 具体可以根据该最近 K个单位周期的内存利用率、 CPU利用率、 磁 盘利用率和所处理的业务请求数, 利用 K最近邻分类算法估算下一个单位周期 内系统能够处理的业务请求数 N, 比如, 具体可以如下:
( 1 )将该最近 K个单位周期的内存利用率、 CPU利用率和磁盘利用率分 别转换成各个周期的特性向量;
例如, 最近 K个单位周期的内存利用率、 中央处理(CPU )利用率和磁盘 利用率分别如表一所示, 其中, 表中数值的单位为百分比。
表一:
Figure imgf000016_0001
则, 此时可以得到:
第 n-5个单位周期的特性向量 X ( 50, 20, 30 ) ; 第 n-4个单位周期的特性向量 X2 (60, 35, 40 ) ;
第 n-3个单位周期的特性向量 X3 (65, 90, 80 ) ;
第 n-2个单位周期的特性向量 X4 ( 80, 80, 90 ) ;
第 n-1个单位周期的特性向量 X5 ( 85, 95, 95 ) 。
( 2 )分别计算各个周期的特征向量和预置的过载向量之间的距离。
其中, 过载向量可以根据实际应用的需求进行设置, 为了描述方便, 在本 实施例中, 将以过载向 Y (90, 90, 90) 为例进行说明。 则根据公式:
Figure imgf000017_0001
可以得到:
第 n-5个单位周期的特性向量 (50 20, 30)与过载向量为 Y (90, 90,
90) 的距离为 100;
第 n-4个单位周期的特性向量 X2( 60, 35 , 40)过载向量为 Y (90, 90, 90) 的距离为 73;
第 n-3个单位周期的特性向量 X3 ( 65, 90 , 80)过载向量为 Y (90, 90, 90) 的距离为 27;
第 n-2个单位周期的特性向量 X4( 80, 80 , 90)过载向量为 Y (90, 90, 90) 的距离为 14;
第 n-1个单位周期的特性向量 X5( 85, 95 , 95)过载向量为 Y( 90, 90, 90) 的距离为 9。
(3)根据计算出的距离, 按照预置的赋权策略为各个周期所处理的业务 请求数赋权。
其中, 该赋权策略满足距离越小赋权越大的条件, 具体可以根据实际应用 的需求而设置, 例如, 以权值等于本周期的距离与最远距离之间的差值为例, 则可以各个距离与权值之间的对应关系可以如表二所示。
表二:
巨离 ( distance ) 值 ( value ) 权值 (即权重( weight ) )
100 100 0
73 350 27 27 450 73
14 500 86
9 600 91
0 N
其中, 值(value )指的是各个周期所处理的业务请求数, 由表一可知: 第 n-5个单位周期所处理的业务请求数为 100;
第 n-4个单位周期所处理的业务请求数为 350;
第 n-3个单位周期所处理的业务请求数为 450;
第 n-2个单位周期所处理的业务请求数为 500;
第 n- 1个单位周期所处理的业务请求数为 600。
( 4 )将该各个周期所处理的业务请求数分别乘以对应的权值后产生的结 果进行叠加, 并除以所有权值的和, 得到下一个单位周期, 即第 n个单位周期 内系统能够处理的业务请求数N。 具体如下:
将(3 ) 中得到的各个距离分别代入公式:
result
Figure imgf000018_0001
得到第 n个单位周期所处理的业务请求数 N为 505。
205、 QOS模块在该下一个单位周期内 (即在第 n个单位周期内), 从业务 请求处理队列中获取 N个业务请求, 将获取到的业务请求提交给业务线程池, 以进行处理, 并记录获取到的业务请求数。
比如, 在步骤 203中, 获知 N为 505 , 则此时, 可以从业务请求处理队列中 获取 505个的业务请求, 然后将获取到的业务请求提交给业务线程池, 以进行 处理, 并记录获取到的业务请求数 "505"。
需说明的是, 若本单位周期内取出的业务请求数小于 N, 则以实际处理的 业务请求数为准, 并记录该实际处理的业务请求数, 比如记录在 QOS模块的信 息收集子模块中; 若本单位周期还未完的时候, 已经取出 N个业务请求, 则停 止取业务请求, 进入下次调度。 206、业务线程池处理完业务请求后,返回关于业务请求的处理结果给 QOS 模块, QOS模块将该处理结果发送给协议适配层。
207、 协议适配层通过协议层将该处理结果返回给用户。
由上可知, 本发明实施例采用将业务流量控制装置集成在 QOS模块中, 由 QOS模块定时采集资源负载信息, 根据该资源负载信息, 利用 KNN算法估算 下一个单位周期内系统能够处理的业务请求数 N, 在该单位周期内, 从业务请 求处理队列中获取 N个的业务请求, 并将获取到的业务请求提交给业务线程 池, 以进行处理; 由于该方案可以综合考虑存储系统中各种资源的特性和具体 负载情况, 并根据该负载情况来对流量进行控制, 比如在系统资源过载时, 实 行流控反压, 而在系统资源充裕时,根据系统能够处理的最大能力来获取业务 请求, 等等, 所以相对于现有技术而言, 可以更加充分地利用系统资源, 有利 于提高系统的整体性能。 实施例三、
为了更好地实施以上方法, 本发明实施例还提供一种业务流量控制装置, 如图 3所示, 该业务流量控制装置包括信息获取单元 301、 估算单元 302、 请 求获取单元 303和提交单元 304, 如下:
信息获取单元 301 , 用于获取资源负载信息;
估算单元 302, 用于根据信息获取单元 301获取到的资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 其中, N为 正整数;
请求获取单元 303 , 用于在该下一个单位周期内, 从业务请求处理队列中 获取 N个的业务请求;
比如, 如果业务请求处理队列中实际的业务请求数大于等于 N个, 则在 从业务请求处理队列中取出 N个业务请求后, 停止取业务请求, 进入下次调 度, 其中, 这种停止取业务请求的操作, 也可以称为流控反压。 而如果业务请 求处理队列中实际的业务请求数少于 N个, 则以实际的请求数为准, 即从业 务请求处理队列中取出实际数目的业务请求。
提交单元 304, 用于将请求获取单元 303获取到的业务请求提交给业务线 程池, 以进行处理。 其中,在提交单元 304将获取到的业务请求提交给业务线程池以进行处理 之后, 还可以记录获取到的业务请求数, 以便在计算后面的单位周期的 "系统 能够处理的业务请求数 N" 时可以作为一个参考因素 (作为资源负载信息之 一), 即如图 4所示, 该业务流量控制装置还可以包括记录单元 305;
记录单元 305, 用于记录获取到的业务请求数。
其中,信息获取单元 301 , 具体可以用于采集最近 K个单位周期的内存利 用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及采集所处理 的业务请求数。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。
则此时,估算单元 302, 具体可以用于根据采集到的最近 K个单位周期的 内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及所处 理的业务请求数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务 请求数 N。 例如, 具体可以如下:
估算单元 302,具体可以用于将采集到的最近 K个单位周期的内存利用率、
CPU 利用率和存储器利用率中的任意两种以上信息分别转换成各个周期的特 性向量; 分别计算各个周期的特征向量和预置的过载向量之间的距离; 根据计 算出的距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权; 将各 个周期所处理的业务数请求数分别乘以对应的权值后产生的结果进行叠加,并 除以所有权值的和, 得到下一个单位周期内系统能够处理的业务请求数N。
其中, 过载向量可以 ^^据实际应用的需求进行设置, 例如, 若定义内存、 CPU和存储器的系统资源利用率均为 90%时为过载状态, 则过载向量为(90, 90, 90 ); 又例如, 若定义内存的系统资源利用率为 80%时为过载状态、 CPU 的系统资源利用率为 85%时为过载状态、以存储器的系统资源利用率均为 90% 时为过载状态, 则过载向量为 (80, 85, 90 ), 以此类推, 等等。
其中, 两个特征向量之间的距离可以采用欧几里德距离来表示, 比如, 设 有两个特征向量, X= ( xl x2, x3 ), Y= ( yi, y2, y3 ), 则这两个特征向量之 间的 巨离 dis ( X, Y )可以如下:
Figure imgf000020_0001
其中, 该赋权策略满足距离越小赋权越大的条件, 具体可以根据实际应用 的需求而设置,例如,可以设置权值等于本周期的距离与最远距离之间的差值。 当然,还可以采用其他的策略, 该距离的具体计算方法可参见前面的方法实施 例, 在此不再赘述。
其中, 这里的业务请求主要指由客户端发起, 并由协议适配层进行封装后 的业务请求, 即如图 4所示, 该业务流量控制装置还可以包括接收单元 306; 接收单元 306, 用于接收业务请求, 并将该业务请求添加到业务请求处理 队列中, 其中, 该业务请求由协议适配层进行封装。
此后,还可以接收业务线程池返回的关于业务请求的处理结果, 并将该处 理结果发送给协议适配层, 以便返回给用户; 即如图 4所示, 该业务流量控制 装置还可以包括发送单元 307;
接收单元 306, 还可以用于接收业务线程池返回的关于业务请求的处理结 果;
发送单元 307, 用于将该处理结果发送给协议适配层, 以便将该处理结果 返回给用户。
具体实现时, 以上各个单元可以作为独立的实体来实现,也可以进行任意 组合,作为同一或若干个实体来实现, 以上各个的单元的具体实施可参见前面 的方法实施例, 在此不再赘述。
该业务流量控制装置可以是独立的实体,也可以集成在存储服务器等设备 中, 例如, 具体可以集成在存储服务器中的私有文件系统的 QOS, Quality of Service模块中。
由上可知,本发明实施例的业务流量控制装置的信息获取单元 301可以获 取资源负载信息, 然后由估算单元 302根据该资源负载信息, 利用 KNN算法 估算下一个单位周期内系统能够处理的业务请求数 N, 再由请求获取单元 303 在该单位周期内, 从业务请求处理队列中获取 N个的业务请求, 并由提交单 元 304将获取到的业务请求提交给业务线程池, 以进行处理; 由于该方案可以 综合考虑存储系统中各种资源的负载情况,并根据该负载情况来对流量进行控 制, 所以相对于现有技术而言, 可以更加充分地利用系统资源, 有利于提高系 统的整体性能。 实施例四、
相应的, 本发明实施例提供的一种通信系统, 包括本发明实施例提供的任 一种业务流量控制装置, 具体可参见实施例三。该业务流量控制装置具体可以 集成在存储服务器中, 例如, 具体可以如下:
存储服务器, 用于获取资源负载信息, 根据该资源负载信息, 利用 KNN 算法估算下一个单位周期内系统能够处理的业务请求数 N,在该下一个单位周 期内, 从业务请求处理队列中获取 N个的业务请求, 将获取到的业务请求提 交给业务线程池, 以进行处理。
其中,在将获取到的业务请求提交给业务线程池之后,还可以记录获取到 的业务请求数,以便在计算后面的单位周期的"系统能够处理的业务请求数 N" 时可以作为一个参考因素 (作为资源负载信息之一)。
其中,获取资源负载信息的方式和估算下一个单位周期内系统能够处理的 业务请求数 N都可以由多种, 例如, 具体可以如下:
存储服务器, 具体可以用于采集最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息, 以及采集所处理的业务请求 数, 即采集最近 K个单位周期的内存利用率、 最近 K个单位周期的 CPU利用 率和最近 K个单位周期的存储器利用率中的任意两种以上信息, 以及获取最 近 K个单位周期所处理的业务请求数; 根据该最近 K个单位周期的内存利用 率、 CPU 利用率、 存储器利用率中的任意两种以上信息, 以及所处理的业务 请求数, 利用 K最近邻分类算法估算下一个单位周期内系统能够处理的业务 请求数 N。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。
例如, 具体可以将该最近 K个单位周期的内存利用率、 CPU利用率和存储 器利用率中的任意两种以上信息分别转换成各个周期的特性向量,分别计算各 个周期的特征向量和预置的过载向量之间的距离,根据计算出的距离,按照预 置的赋权策略为各个周期所处理的业务请求数赋权,将该各个周期所处理的业 务请求数分别乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和, 得到下一个单位周期内系统能够处理的业务请求数 N。 其中, 过载向量可以根据实际应用的需求进行设置, 而赋权策略则满足距 离越小赋权越大的条件, 具体可参见前面实施例, 在此不再赘述。
其中, 该存储服务器, 还用于在从业务请求处理队列中获取 N个的业务请 求之前, 接收业务请求, 并将该业务请求添加到业务请求处理队列中, 其中, 该业务请求由协议适配层进行封装。
此后,该存储服务器还可以接收业务线程池返回的关于业务请求的处理结 果, 并将该处理结果发送给协议适配层, 以便返回给用户。
此外, 该通信系统还可以包括其他的设备, 比如, 还可以包括客户端; 客户端, 用于发送用户请求给存储服务器, 以及接收存储服务器返回的关 于业务请求的处理结果。
以上各个设备的具体实施可参见前面的实施例, 在此不再赘述。
由于该通信系统包括本发明实施例提供的任一种业务流量控制装置,因此 可以实现本发明实施例提供的任一种业务流量控制装置所能实现的有益效果, 详见前面实施例, 在此不再赘述。 实施例五、
此外, 本发明实施例还提供一种存储系统, 比如可以为存储服务器, 如图 5所示,包括协议适配层 501、私有文件系统 502和用于存储数据的存储器 503, 其中,存储器 503具体可以任意一种非易失性存储介质,比如,可以为磁盘(即 磁盘阵列)、固态硬盘或光盘等,私有文件系统 502可以包括服务质量模块(即 QOS模块) 5021 , 如下:
协议适配层 501 , 用于接收并封装业务请求, 将业务请求发送给私有文件 系统中的服务质量模块;
服务质量模块 5021 , 用于接收业务请求, 将接收到的业务请求添加到业 务请求处理队列中, 获取资源负载信息, 根据该资源负载信息, 利用 K最近 邻分类 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N,其中, N为正整数, 在该下一个单位周期内, 从业务请求处理队列中获取 N个的业 务请求, 将获取到的业务请求提交给业务线程池, 以进行处理。
其中,获取资源负载信息的方式和估算下一个单位周期内系统能够处理的 业务请求数 N都可以有多种, 例如, 具体可以如下:
服务质量模块 5021 ,具体可以用于采集最近 K个单位周期的内存利用率、 CPU利用率和存储器利用率(即存储器 503的利用率) 中的任意两种以上信 息, 以及采集所处理的业务请求数; 根据该最近 K个单位周期的内存利用率、 CPU利用率、 存储器利用率和所处理的业务请求数, 利用 K最近邻分类算法 估算下一个单位周期内系统能够处理的业务请求数N。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。 比如, 具体可以如下:
服务质量模块 5021 ,具体可以用于将该最近 K个单位周期的内存利用率、 CPU 利用率和存储器利用率中的任意两种以上信息分别转换成各个周期的特 性向量; 分别计算各个周期的特征向量和预置的过载向量之间的距离; 根据该 计算出的距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权; 将 各个周期所处理的业务请求数分别乘以对应的权值后产生的结果进行叠加,并 除以所有权值的和, 得到下一个单位周期内系统能够处理的业务请求数N。
其中, 过载向量可以根据实际应用的需求进行设置, 而赋权策略则满足距 离越小赋权越大的条件, 具体可参见前面实施例, 在此不再赘述。
该服务质量模块 5021 , 还可以用于记录获取到的业务请求数, 以便在计 算后面的单位周期的 "系统能够处理的业务请求数 N"时可以作为一个参考因 素 (作为资源负载信息之一)。
此后, 该服务质量模块 5021 , 还可以用于接收业务线程池返回的关于业 务请求的处理结果;将该处理结果发送给协议适配层 501 ,以便协议适配层 501 将该处理结果返回给用户。
此外, 该存储系统还可以包括其他的模块, 比如还可以包括虚拟文件系统 等, 该虚拟文件系统主要用于提供系统的资源负载信息, 比如提供最近 K个 单位周期的存储器利用率给服务质量模块 5021。
以上各个模块的具体实施可参见前面的实施例, 在此不再赘述。
由上可知, 本发明实施例提供的存储系统可以获取资源负载信息,根据该 资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请 求数 N, 在该单位周期内, 从业务请求处理队列中获取 N个的业务请求, 并 将获取到的业务请求提交给业务线程池, 以进行处理; 由于该方案可以综合考 虑存储系统中各种资源的负载情况, 并根据该负载情况来对流量进行控制, 所 以相对于现有技术而言, 可以更加充分地利用系统资源,有利于提高系统的整 体性能。 实施例六、
相应的, 本发明实施例还提供一种存储控制器, 如图 6所示, 该存储控制 器可以包括中央处理器 601和用于存储数据的易失性存储介质 602; 如下: 中央处理器 601 , 用于获取资源负载信息; 根据该资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 其中, N为 正整数; 在该下一个单位周期内, 从业务请求处理队列中获取 N个的业务请 求; 将获取到的业务请求提交给业务线程池, 以进行处理。
其中, 在将获取到的业务请求提交给业务线程池之后, 中央处理器 601 还可以记录获取到的业务请求数, 以便在计算后面的单位周期的 "系统能够处 理的业务请求数 N" 时可以作为一个参考因素 (作为资源负载信息之一)。
其中,获取资源负载信息的方式和估算下一个单位周期内系统能够处理的 业务请求数 N都可以由多种, 例如, 具体可以如下:
中央处理器 601 ,具体可以用于采集最近 K个单位周期的易失性存储介质 602的利用率、 中央处理器 601的利用率和非易失性存储介质的利用率中的任 意两种以上信息, 以及采集所处理的业务请求数; 根据最近 K个单位周期的 易失性存储介质 602的利用率、中央处理器 601的利用率和非易失性存储介质 的利用率中的任意两种以上信息, 以及所处理的业务请求数, 利用 KNN算法 估算下一个单位周期内系统能够处理的业务请求数N。
其中, 易失性存储介质 602具体可以为内存等设备, 而非易失性存储介质 则可以是磁盘、 固态硬盘或光盘等设备。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。
例如, 中央处理器 601具体可以将最近 K个单位周期的所述易失性存储 介质 602的利用率、中央处理器 601的利用率和非易失性存储介质的利用率中 的任意两种以上信息分别转换成各个周期的特性向量;分别计算所述各个周期 的特征向量和预置的过载向量之间的距离; 根据该距离,按照预置的赋权策略 为各个周期所处理的业务请求数赋权;将各个周期所处理的业务请求数分别乘 以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到下一个单位 周期内系统能够处理的业务请求数 N。
其中, 过载向量可以根据实际应用的需求进行设置, 而赋权策略则满足距 离越小赋权越大的条件, 具体可参见前面实施例, 在此不再赘述。
其中, 该中央处理器 601 , 还可以用于接收业务请求, 并将该业务请求添 加到业务请求处理队列中, 其中, 该业务请求由协议适配层进行封装。
此后,该中央处理器 601还可以接收业务线程池返回的关于业务请求的处 理结果, 并将该处理结果发送给协议适配层, 以便返回给用户。
以上各个设备的具体实施可参见前面的实施例, 在此不再赘述。
由上可知, 本发明实施例提供的存储控制器可以获取资源负载信息,根据 该资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务 请求数 N, 在该单位周期内, 从业务请求处理队列中获取 N个的业务请求, 并将获取到的业务请求提交给业务线程池, 以进行处理; 由于该方案可以综合 考虑存储系统中各种资源的负载情况, 并根据该负载情况来对流量进行控制, 所以相对于现有技术而言, 可以更加充分地利用系统资源,有利于提高系统的 整体性能。 实施例七、
相应的, 本发明实施例还提供一种计算机系统, 包括本发明实施例提供的 任一种存储控制器和用于存储数据的非易失性存储介质, 例如, 如图 7所示, 该计算机系统可以包括存储控制器 701和非易失性存储介质 702, 其中, 该存 储控制器 701 可以包括中央处理器 7011 和用于存储数据的易失性存储介质 7012; 如下:
中央处理器 7011 , 用于获取资源负载信息; 根据该资源负载信息, 利用 K 最近邻分类 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 其中, N 为正整数; 在该下一个单位周期内, 从业务请求处理队列中获取 N 个的业务请求; 将获取到的业务请求提交给业务线程池, 以进行处理。
其中, 在将获取到的业务请求提交给业务线程池之后, 中央处理器 7011 还可以记录获取到的业务请求数, 以便在计算后面的单位周期的 "系统能够处 理的业务请求数 N" 时可以作为一个参考因素 (作为资源负载信息之一)。
其中,获取资源负载信息的方式和估算下一个单位周期内系统能够处理的 业务请求数 N都可以由多种, 例如, 具体可以如下:
中央处理器 7011 , 具体可以用于采集最近 K个单位周期的易失性存储介 质 7012的利用率、中央处理器 7011的利用率和非易失性存储介质 702的利用 率中的任意两种以上信息, 以及采集所处理的业务请求数; 根据所述最近 K 个单位周期的易失性存储介质 7012的利用率、中央处理器 7011的利用率和非 易失性存储介质 702的利用率中的任意两种以上信息,以及所处理的业务请求 数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N。
其中, 易失性存储介质 7012具体可以为内存等设备, 而非易失性存储介 质 702则可以是磁盘、 固态硬盘或光盘等设备。
其中, K为正整数, K的具体取值可以根据实际应用的需求进行设置, 比 如, 可以设定 >=5。
例如, 中央处理器 7011具体可以将最近 K个单位周期的所述易失性存储 介质 7012的利用率、中央处理器 7011的利用率和非易失性存储介质 702的利 用率中的任意两种以上信息分别转换成各个周期的特性向量;分别计算所述各 个周期的特征向量和预置的过载向量之间的距离;根据所述距离,按照预置的 赋权策略为各个周期所处理的业务请求数赋权;将各个周期所处理的业务请求 数分别乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到下 一个单位周期内系统能够处理的业务请求数 N。
其中, 过载向量可以根据实际应用的需求进行设置, 而赋权策略则满足距 离越小赋权越大的条件, 具体可参见前面实施例, 在此不再赘述。
其中, 该中央处理器 7011 , 还可以用于接收业务请求, 并将该业务请求 添加到业务请求处理队列中, 其中, 该业务请求由协议适配层进行封装。
其中, 该中央处理器 7011 , 还可以接收业务线程池返回的关于业务请求 的处理结果, 并将该处理结果发送给协议适配层, 以便返回给用户。
以上各个设备的具体实施可参见前面的实施例, 在此不再赘述。
由上可知, 本发明实施例提供的存储控制器可以获取资源负载信息,根据 该资源负载信息, 利用 KNN算法估算下一个单位周期内系统能够处理的业务 请求数 N, 在该单位周期内, 从业务请求处理队列中获取 N个的业务请求, 并将获取到的业务请求提交给业务线程池, 以进行处理; 由于该方案可以综合 考虑存储系统中各种资源的负载情况, 并根据该负载情况来对流量进行控制, 所以相对于现有技术而言, 可以更加充分地利用系统资源,有利于提高系统的 整体性能。 本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: 只读存储器(ROM, Read Only Memory )、 随机存取记忆体(RAM, Random Access Memory ) , 磁盘或光盘等。
以上对本发明实施例所提供的一种业务流量控制方法、装置和系统进行了 上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于本 领域的技术人员,依据本发明的思想, 在具体实施方式及应用范围上均会有改 变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种业务流量控制方法, 其特征在于, 包括:
获取资源负载信息;
根据所述资源负载信息,利用 K最近邻分类 KNN算法估算下一个单位周 期内系统能够处理的业务请求数 N, 所述 N为正整数;
在所述下一个单位周期内, 从业务请求处理队列中获取 N个的业务请求; 将获取到的业务请求提交给业务线程池, 以进行处理。
2、 根据权利要求 1所述的方法, 其特征在于, 所述获取资源负载信息, 包括:
采集最近 K个单位周期的内存利用率、 中央处理器利用率和存储器利用 率中的任意两种以上信息, 以及采集所处理的业务请求数, 所述 K为正整数; 所述根据所述资源负载信息估算下一个单位周期内系统能够处理的业务 请求数 N, 包括:
根据所述最近 K个单位周期的内存利用率、 中央处理器利用率和存储器 利用率中的任意两种以上信息, 以及所处理的业务请求数, 利用 KNN算法估 算下一个单位周期内系统能够处理的业务请求数 N。
3、 根据权利要求 2所述的方法, 其特征在于, 所述根据所述最近 K个单 位周期的内存利用率、中央处理器利用率和存储器利用率中的任意两种以上信 息,以及所处理的业务请求数估算下一个单位周期内系统能够处理的业务请求 数 N, 包括:
将所述最近 K个单位周期的内存利用率、 中央处理器利用率和存储器利 用率中的任意两种以上信息分别转换成各个周期的特性向量;
分别计算所述各个周期的特征向量和预置的过载向量之间的距离; 根据所述距离, 按照预置的赋权策略为各个周期所处理的业务请求数赋 权, 所述赋权策略满足距离越小赋权越大的条件;
将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结果 进行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业务 请求数 N。
4、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 所述将获取到 的业务请求提交给业务线程池, 以进行处理之后, 还包括:
记录获取到的业务请求数。
5、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 所述从业务请 求处理队列中获取 N个的业务请求之前, 还包括:
接收业务请求, 并将所述业务请求添加到业务请求处理队列中, 所述业务 请求由协议适配层进行封装。
6、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 所述将获取到 的业务请求提交给业务线程池, 以进行处理之后, 还包括:
接收业务线程池返回的关于业务请求的处理结果;
将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
7、 一种业务流量控制装置, 其特征在于, 包括:
信息获取单元, 用于获取资源负载信息;
估算单元, 用于根据所述资源负载信息, 利用 K最近邻分类 KNN算法估 算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正整数;
请求获取单元, 用于在所述下一个单位周期内,从业务请求处理队列中获 取 N个的业务请求;
提交单元, 用于将获取到的业务请求提交给业务线程池, 以进行处理。
8、 根据权利要求 7所述的业务流量控制装置, 其特征在于,
所述信息获取单元, 具体用于采集最近 K个单位周期的内存利用率、 中 央处理器利用率、 存储器利用率和所处理的业务请求数, 所述 K为正整数; 所述估算单元, 具体用于根据所述最近 K个单位周期的内存利用率、 中 央处理器利用率和存储器利用率中的任意两种以上信息,以及采集所处理的业 务请求数, 利用 K最近邻分类算法估算下一个单位周期内系统能够处理的业 务请求数 N。
9、 根据权利要求 8所述的业务流量控制装置, 其特征在于,
所述估算单元, 具体用于将所述最近 K个单位周期的内存利用率、 中央 处理器利用率和存储器利用率中的任意两种以上信息分别转换成各个周期的 特性向量; 分别计算所述各个周期的特征向量和预置的过载向量之间的距离; 根据所述距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权, 所 述赋权策略满足距离越小赋权越大的条件;将所述各个周期所处理的业务数请 求数分别乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到 下一个单位周期内系统能够处理的业务请求数 N。
10、 根据权利要求 7至 9任一项所述的业务流量控制装置, 其特征在于, 还包括记录单元;
所述记录单元, 用于记录获取到的业务请求数。
11、 根据权利要求 7至 9任一项所述的业务流量控制装置, 其特征在于, 还包括接收单元;
所述接收单元, 用于接收业务请求, 并将所述业务请求添加到业务请求处 理队列中, 所述业务请求由协议适配层进行封装。
12、 根据权利要求 7至 9任一项所述的业务流量控制装置, 其特征在于, 还包括发送单元;
所述接收单元, 还用于接收业务线程池返回的关于业务请求的处理结果; 所述发送单元, 用于将所述处理结果发送给协议适配层, 以便将所述处理 结果返回给用户。
13、 一种通信系统, 其特征在于, 包括权利要求 7至 12任一项所述的业 务流量控制装置。
14、 一种存储系统, 其特征在于, 包括协议适配层、 私有文件系统和用于 存储数据的存储器, 所述私有文件系统包括服务质量模块;
所述协议适配层, 用于接收并封装业务请求,将业务请求发送给私有文件 系统中的服务质量模块;
所述服务质量模块, 用于接收业务请求,将接收到的业务请求添加到业务 请求处理队列中, 获取资源负载信息, 根据所述资源负载信息, 利用 K最近 邻分类 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正整数, 在所述下一个单位周期内, 从业务请求处理队列中获取 N个的 业务请求, 将获取到的业务请求提交给业务线程池, 以进行处理。
15、 根据权利要求 14所述的存储系统, 其特征在于,
所述服务质量模块, 具体用于采集最近 K个单位周期的内存利用率、 中 央处理器利用率和存储器利用率中的任意两种以上信息,以及采集所处理的业 务请求数, 所述 K为正整数; 根据所述最近 Κ个单位周期的内存利用率、 中 央处理器利用率、存储器利用率中的任意两种以上信息, 以及所处理的业务请 求数, 利用 Κ最近邻分类算法估算下一个单位周期内系统能够处理的业务请 求数 Ν。
16、 根据权利要求 15所述的存储系统, 其特征在于,
所述服务质量模块, 具体用于将所述最近 Κ个单位周期的内存利用率、 中央处理器利用率和存储器利用率中的任意两种以上信息分别转换成各个周 期的特性向量;分别计算所述各个周期的特征向量和预置的过载向量之间的距 离;根据所述距离,按照预置的赋权策略为各个周期所处理的业务请求数赋权, 所述赋权策略满足距离越小赋权越大的条件;将所述各个周期所处理的业务请 求数分别乘以对应的权值后产生的结果进行叠加, 并除以所有权值的和,得到 下一个单位周期内系统能够处理的业务请求数 Ν。
17、 根据权利要求 14至 16任一项所述的存储系统, 其特征在于, 所述服务质量模块, 还用于记录获取到的业务请求数。
18、 根据权利要求 14至 16任一项所述的存储系统, 其特征在于, 所述服务质量模块,还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
19、 一种存储控制器, 其特征在于, 包括中央处理器和用于存储数据的易 失性存储介质;
所述中央处理器, 用于获取资源负载信息; 才艮据所述资源负载信息, 利用
Κ最近邻分类 ΚΝΝ算法估算下一个单位周期内系统能够处理的业务请求数 Ν, 所述 Ν为正整数; 在所述下一个单位周期内, 从业务请求处理队列中获取 Ν 个的业务请求; 将获取到的业务请求提交给业务线程池, 以进行处理。
20、 根据权利要求 19所述的存储控制器, 其特征在于,
所述中央处理器, 具体用于采集最近 Κ个单位周期的所述易失性存储介 质的利用率、所述中央处理器的利用率和非易失性存储介质的利用率中的任意 两种以上信息, 以及采集所处理的业务请求数, 所述 Κ为正整数; 根据所述 最近 Κ个单位周期的所述易失性存储介质的利用率、 所述中央处理器的利用 率和非易失性存储介质的利用率中的任意两种以上信息,以及所处理的业务请 求数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N。
21、 根据权利要求 20所述的存储控制器, 其特征在于,
所述中央处理器, 具体用于将所述最近 K个单位周期的所述易失性存储 介质的利用率、所述中央处理器的利用率和非易失性存储介质的利用率中的任 意两种以上信息分别转换成各个周期的特性向量;分别计算所述各个周期的特 征向量和预置的过载向量之间的距离; 根据所述距离,按照预置的赋权策略为 各个周期所处理的业务请求数赋权,所述赋权策略满足距离越小赋权越大的条 件;将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结果进 行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业务请 求数 N。
22、 根据权利要求 19至 21任一项所述的存储控制器, 其特征在于, 所述中央处理器, 还用于记录获取到的业务请求数。
23、 根据权利要求 19至 21任一项所述的存储控制器, 其特征在于, 所述中央处理器,还用于接收业务请求, 并将所述业务请求添加到业务请 求处理队列中, 所述业务请求由协议适配层进行封装。
24、 根据权利要求 19至 21任一项所述的存储控制器, 其特征在于, 所述中央处理器, 还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
25、一种计算机系统, 包括存储控制器和用于存储数据的非易失性存储介 质,其中,所述存储控制器包括中央处理器和用于存储数据的易失性存储介质; 所述中央处理器, 用于获取资源负载信息; 才艮据所述资源负载信息, 利用 K最近邻分类 KNN算法估算下一个单位周期内系统能够处理的业务请求数 N, 所述 N为正整数; 在所述下一个单位周期内, 从业务请求处理队列中获取 N 个的业务请求; 将获取到的业务请求提交给业务线程池, 以进行处理。
26、 根据权利要求 25所述的计算机系统, 其特征在于,
所述中央处理器, 具体用于采集最近 K个单位周期的所述易失性存储介 质的利用率、所述中央处理器的利用率和所述非易失性存储介质的利用率中的 任意两种以上信息, 以及采集所处理的业务请求数, 所述 K为正整数; 根据 所述最近 K个单位周期的所述易失性存储介质的利用率、 所述中央处理器的 利用率和所述非易失性存储介质的利用率中的任意两种以上信息,以及所处理 的业务请求数, 利用 KNN算法估算下一个单位周期内系统能够处理的业务请 求数 N。
27、 根据权利要求 26所述的计算机系统, 其特征在于,
所述中央处理器, 具体用于将所述最近 K个单位周期的所述易失性存储 介质的利用率、所述中央处理器的利用率和所述非易失性存储介质的利用率中 的任意两种以上信息分别转换成各个周期的特性向量;分别计算所述各个周期 的特征向量和预置的过载向量之间的距离; 根据所述距离,按照预置的赋权策 略为各个周期所处理的业务请求数赋权,所述赋权策略满足距离越小赋权越大 的条件;将所述各个周期所处理的业务请求数分别乘以对应的权值后产生的结 果进行叠加, 并除以所有权值的和,得到下一个单位周期内系统能够处理的业 务请求数 N。
28、 根据权利要求 25至 27任一项所述的计算机系统, 其特征在于, 所述中央处理器, 还用于记录获取到的业务请求数。
29、 根据权利要求 25至 27任一项所述的计算机系统, 其特征在于, 所述中央处理器,还用于接收业务请求, 并将所述业务请求添加到业务请 求处理队列中, 所述业务请求由协议适配层进行封装。
30、 根据权利要求 25至 27任一项所述的计算机系统, 其特征在于, 所述中央处理器, 还用于接收业务线程池返回的关于业务请求的处理结 果; 将所述处理结果发送给协议适配层, 以便将所述处理结果返回给用户。
PCT/CN2013/088051 2013-11-28 2013-11-28 一种业务流量控制方法、装置和系统 WO2015077958A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201380002465.4A CN103842955B (zh) 2013-11-28 2013-11-28 一种业务流量控制方法、装置和系统
PCT/CN2013/088051 WO2015077958A1 (zh) 2013-11-28 2013-11-28 一种业务流量控制方法、装置和系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/088051 WO2015077958A1 (zh) 2013-11-28 2013-11-28 一种业务流量控制方法、装置和系统

Publications (1)

Publication Number Publication Date
WO2015077958A1 true WO2015077958A1 (zh) 2015-06-04

Family

ID=50804806

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/088051 WO2015077958A1 (zh) 2013-11-28 2013-11-28 一种业务流量控制方法、装置和系统

Country Status (2)

Country Link
CN (1) CN103842955B (zh)
WO (1) WO2015077958A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959175B (zh) * 2016-04-21 2019-10-22 南开大学 基于GPU加速的kNN算法的网络流量分类方法
CN110278160B (zh) * 2018-03-15 2023-02-28 阿里巴巴集团控股有限公司 速率控制方法、装置及电子设备
CN108965154A (zh) * 2018-06-29 2018-12-07 华为技术有限公司 对象存储系统中的业务流量控制方法及装置
CN115080253B (zh) * 2022-08-23 2022-11-22 小米汽车科技有限公司 Gpu任务的分配方法、装置、电子设备和存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152389A (zh) * 2013-02-01 2013-06-12 华南师范大学 应用于云计算机系统中应对高峰访问的方法和装置
CN103279392A (zh) * 2013-06-14 2013-09-04 浙江大学 一种云计算环境下虚拟机上运行的负载分类方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7600229B1 (en) * 2003-09-30 2009-10-06 Emc Corporation Methods and apparatus for load balancing processing of management information
CN101593133B (zh) * 2009-06-29 2012-07-04 北京航空航天大学 虚拟机资源负载均衡方法及装置
CN101715003B (zh) * 2009-11-12 2012-06-20 北京交通大学 互操作平台的负载控制优化方法
CN101753461B (zh) * 2010-01-14 2012-07-25 中国建设银行股份有限公司 实现负载均衡的方法、负载均衡服务器以及集群系统
CN103067297B (zh) * 2013-01-25 2015-10-07 中国科学院声学研究所 一种基于资源消耗预测的动态负载均衡方法及装置
CN103327118B (zh) * 2013-07-09 2016-10-05 南京大学 一种针对云计算中web应用的智能虚拟机集群缩放方法及系统

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152389A (zh) * 2013-02-01 2013-06-12 华南师范大学 应用于云计算机系统中应对高峰访问的方法和装置
CN103279392A (zh) * 2013-06-14 2013-09-04 浙江大学 一种云计算环境下虚拟机上运行的负载分类方法

Also Published As

Publication number Publication date
CN103842955A (zh) 2014-06-04
CN103842955B (zh) 2016-08-31

Similar Documents

Publication Publication Date Title
WO2017133351A1 (zh) 一种资源分配方法及资源管理器
US9537773B2 (en) Ensuring predictable and quantifiable networking performance
US10623787B1 (en) Optimizing adaptive bit rate streaming for content delivery
CN110602156A (zh) 一种负载均衡调度方法及装置
US10397131B2 (en) Method and system for determining bandwidth demand
WO2015077958A1 (zh) 一种业务流量控制方法、装置和系统
US11784931B2 (en) Network burst load evacuation method for edge servers
WO2012155628A1 (zh) 任务管理方法及装置
CN116018790A (zh) 基于接收方的精密拥塞控制
JP2009503686A5 (zh)
WO2014194869A1 (zh) 一种请求处理方法、装置及系统
US10277509B2 (en) Data processing method executed by network apparatus, and related device
TW201931145A (zh) 動態工作移轉方法及伺服器
CN115174432B (zh) Rdma网络状态监测方法、装置、设备及可读存储介质
Sanaj et al. An enhanced Round robin (ERR) algorithm for effective and efficient task scheduling in cloud environment
CN108491255B (zh) 自助式MapReduce数据优化分配方法及系统
US11539636B1 (en) Quota-based resource scheduling
Govindarajan et al. An intelligent load balancer for software defined networking (SDN) based cloud infrastructure
US8959224B2 (en) Network data packet processing
CN115729864A (zh) 存储装置、电子装置以及电子装置的操作方法
US11528187B1 (en) Dynamically configurable networking device interfaces for directional capacity modifications
WO2023207424A1 (zh) 一种业务容量负荷参数的上报方法及装置
Karamoozian et al. QoS-aware resource allocation for mobile media services in cloud environment
WO2015176289A1 (zh) 片上网络NoC的流量控制方法及装置
Cao et al. Delay sensitive large-scale parked vehicular computing via software defined blockchain

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13898101

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13898101

Country of ref document: EP

Kind code of ref document: A1