CN113535530B - Method and device for predicting server load, electronic equipment and storage medium - Google Patents

Method and device for predicting server load, electronic equipment and storage medium Download PDF

Info

Publication number
CN113535530B
CN113535530B CN202110931861.1A CN202110931861A CN113535530B CN 113535530 B CN113535530 B CN 113535530B CN 202110931861 A CN202110931861 A CN 202110931861A CN 113535530 B CN113535530 B CN 113535530B
Authority
CN
China
Prior art keywords
fluctuation
queue
current
processing request
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110931861.1A
Other languages
Chinese (zh)
Other versions
CN113535530A (en
Inventor
于洋子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110931861.1A priority Critical patent/CN113535530B/en
Publication of CN113535530A publication Critical patent/CN113535530A/en
Application granted granted Critical
Publication of CN113535530B publication Critical patent/CN113535530B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3433Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment for load management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a method and a device for predicting server load, electronic equipment and a storage medium, and relates to the technical field of server load. The method comprises the following steps: collecting current operation parameters and determining a current average load coefficient; wherein the operating parameters include a current number of processing requests; determining the current processing request variable quantity according to the current processing request quantity and the historical processing request quantity; comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue; and extracting an extremum of the processing request change quantity in the second fluctuation queue, and predicting the server load according to the extremum of the processing request change quantity, the current average load coefficient and the current processing request number. The technical scheme of the application can realize the technical purposes of predicting and judging the server load in real time and controlling the cost.

Description

Method and device for predicting server load, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, embodiments of the present application relate to a method, an apparatus, an electronic device, and a storage medium for predicting a server load.
Background
For the web site of the internet, the online user access amount is a state that exhibits fluctuation. When a busy period, especially a website starts a large-scale activity, if a large amount of user access exists in a shopping festival or a large-scale competition period, the server is easy to crash due to the sudden user access.
In view of the above, the existing solution is to predict the load of each server manually in advance before the activity. In order to ensure stable operation of the server, redundant resources are usually reserved excessively, and more manpower maintenance and operation cost are required due to higher storage cost of big data; and the prediction error tolerance is lower, the error is larger, and if the prediction load is lower than the actual load, the stability of the access data processing can be affected.
Therefore, in the prior art, it is difficult to combine both cost and stability requirements for load prediction of a server.
Disclosure of Invention
In order to solve the technical problem that the existing load prediction of the server is difficult to meet the two requirements of cost and stability, the application provides a method and device for predicting the load of the server, electronic equipment and a storage medium.
In a first aspect, the present application provides a method for predicting a server load, including the steps of:
collecting current operation parameters and determining a current average load coefficient; wherein the operating parameters include a current number of processing requests;
determining the current processing request variable quantity according to the current processing request quantity and the historical processing request quantity;
comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue;
and extracting an extremum of the processing request change quantity in the second fluctuation queue, and predicting the server load according to the extremum of the processing request change quantity, the current average load coefficient and the current processing request number.
In an alternative embodiment of the first aspect, the operating parameters further include CPU utilization;
the step of collecting the current operation parameters and determining the current average load factor comprises the following steps:
and determining the average load coefficient of the current acquisition unit time according to the CPU utilization rate and the processing request number of the current acquisition unit time and the average load coefficient determined in the previous acquisition unit time.
In an optional embodiment of the first aspect, the processing request variation is a request variation amplitude;
the determining the current processing request change amount according to the current processing request number and the historical processing request number comprises the following steps:
calculating to obtain the fluctuation amplitude of the request quantity in the current acquisition unit time according to the processing request quantity in the current acquisition unit time and the processing request quantity in the historical acquisition unit time;
the step of comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue comprises the following steps:
acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
when the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is taken out until the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
In an optional embodiment of the first aspect, the method for predicting a server load further includes:
when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the current acquisition unit time is added to the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
In an optional embodiment of the first aspect, the method for predicting a server load further includes:
and taking the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue as the maximum value of the change quantity of the processing request.
In an optional embodiment of the first aspect, the step of comparing the current processing request variation with the historical processing request variation, and updating a first wave queue for storing the processing request variation, to obtain an updated second wave queue includes:
acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
and when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, taking out the request quantity fluctuation amplitude of the tail end of the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
In an optional embodiment of the first aspect, the method for predicting a server load further includes:
when the request quantity fluctuation amplitude of the current acquisition unit time is larger than that of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the current acquisition unit time is added to the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
In an optional embodiment of the first aspect, the method for predicting a server load further includes:
and taking the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue as the minimum value of the change quantity of the processing request.
In an optional embodiment of the first aspect, the step of predicting a server load according to the extremum of the processing request variation, the average load factor, and the number of processing requests includes:
and obtaining the maximum value and the minimum value of the processing request variable quantity, and respectively calculating the maximum value and the minimum value of the processing request variable quantity with the current processing request number and the current average load coefficient to obtain the prediction range of the server load in the preset statistical time length.
In a second aspect, an embodiment of the present application provides a device for predicting a server load, including:
The parameter acquisition module is used for acquiring current operation parameters and determining a current average load coefficient; wherein the operating parameters include a current number of processing requests;
the request change determining module is used for determining the current processing request change amount according to the current processing request number and the historical processing request number;
the queue updating module is used for comparing the current processing request variable quantity with the historical processing request variable quantity, updating a first fluctuation queue for storing the processing request variable quantity and obtaining an updated second fluctuation queue;
and the load prediction module is used for extracting the extreme value of the processing request change quantity in the second fluctuation queue and predicting the server load according to the extreme value of the processing request change quantity, the current average load coefficient and the current processing request number.
In a third aspect, an electronic device is provided, the electronic device comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: the method for predicting the server load provided by the first aspect of the embodiment of the application is performed.
In a fourth aspect, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method for predicting a server load provided in the first aspect of the embodiment of the present application.
The beneficial effects that technical scheme that this application embodiment provided brought are:
based on the prediction method of the server load, which is provided by the application, the current average load coefficient can be determined according to the current operation parameters acquired from the server. And the current processing request number is obtained from the operation parameters, and the current processing request change amount is obtained by the historical processing request number. And then comparing the current processing request variable quantity with the historical processing request variable quantity stored in the first fluctuation queue for load change, and obtaining an updated second fluctuation queue. And extracting an extremum of the processing request change quantity from the second fluctuation queue, and predicting the current load of the server according to the current average load coefficient and the current processing request number. Based on the prediction method provided by the application, the current load change data of the server can be obtained by comparing the current load change data with the historical data in real time according to the operation parameters and the data processing results acquired in real time, so that the current load of the server can be accurately predicted according to the result obtained by the real-time monitoring, and inaccurate load prediction and resource waste caused by reservation of redundant resources due to approximate judgment of the load of the server according to the historical data and experience in the prior art are avoided.
Additional aspects and advantages of embodiments of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the application.
Drawings
The foregoing and/or additional aspects and advantages of embodiments of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, wherein:
FIG. 1 is an architecture diagram of a prediction scheme for a server load implementing the present application;
FIG. 2 is another architecture diagram of a prediction scheme for server load implementing the present application;
fig. 3 is a flowchart of a method for predicting a server load according to an embodiment of the disclosure;
FIG. 4 is a detailed step diagram of step 130;
FIG. 5 is a schematic diagram of element updates of a wave queue;
FIG. 6 is a schematic diagram of another detailed step of step 130;
FIG. 7 is another schematic diagram of element updates of a wave queue;
fig. 8 is a schematic flow chart of another method for predicting server load of the present application.
FIG. 9 is a schematic structural diagram of a server load prediction apparatus according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device for predicting a server load according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The Internet brings convenience, in part, because users can access corresponding websites or platforms at any time according to own needs to finish acquiring or uploading information. Thus, for network platforms, and particularly for large internet sites, the users that are used are of a certain scale. If the access is busy or large online activities are held, the size of the access request data to be processed in a short period of time increases dramatically if large votes, large game plays or shopping malls are made a year. If the prediction and the corresponding measures are not made for the load of the server, the situation of the server breakdown is easy to cause.
The existing processing method for solving the above situation is to predict the load of each server manually in advance according to historical access processing data before busy period or online activity. Redundant resources are usually reserved in excess in order to ensure the normal operation of the server. However, the storage cost of big data is relatively high, and more personnel are required to carry out technical maintenance and operation cost in the running process of the server; moreover, as the stability of the operation of the server is affected once the prediction of the server load is lower than the actual load, the tolerance of the prediction error on the server load is also lower.
In view of the above problems, in the prior art, it is difficult to satisfy both the requirements of cost control and operation stability in the server load prediction method.
The above-mentioned problem of accessing busy periods, or holding large online activities, which can affect server load, can be reflected in the operating parameters of the server. The operation parameters may include parameters representing the response amount and response speed of the server corresponding to the access request, and the processing amount and processing speed of the access request, such as the concurrency number and the processing request number. The operation parameters may also include parameters such as resources occupied by the server itself when processing the access request data. For example, the server uses 10ms in processing the access process A1 corresponding to the current access request of the user a; the method comprises the steps that 20ms is used in the process of processing an access process B1 corresponding to a current access request of a user B; and is idle for 60ms, if the time is all the same, the occupancy rate of the running resources of the server in the time period is 40%.
Based on the present situation of the server load prediction scheme, the present application provides a server load prediction scheme.
The architecture diagram of the prediction scheme includes execution in a predicted server. Specific execution environments may be as shown with reference to fig. 1, including: the server O1 to be predicted includes a prediction device Y1. When the server to be predicted receives access request data generated by a plurality of clients K through web pages or operations of specific application programs, the prediction device Y1 may perform data collection according to the identifier of the data type, and predict the load of the server to be predicted O1. For a network platform or an internet company, in consideration of the problems of large user quantity and data equalization processing, generally, a data processing task will be processed by using multiple servers, and in this embodiment, multiple servers for processing the same data processing task may be used as a server cluster J1. The server O1 to be predicted is a simple description of predicting the load of one server O1 to be predicted in the server cluster J1. In the server cluster J1, the prediction device Y1 executes the prediction scheme provided in the present application, and adjusts the load of the server cluster J1 and each server O1 to be predicted according to the prediction result of each server O1 to be predicted on the load.
In addition to the architecture diagram of the execution server load prediction scheme as in fig. 1, reference may be made to the architecture diagram of another execution server load prediction scheme shown in fig. 2. In the architecture diagram of fig. 2, for a data processing task, a server cluster J2 composed of a plurality of servers O2 to be predicted is also used for processing, where each server O2 to be predicted receives access request data generated by a plurality of clients K through operation of a web page or a specific application program, and provides data support for load prediction of the server O2 to be predicted. Unlike the execution environment of fig. 1, in this execution environment, the server load is predicted by the prediction server S independent of the server cluster J2. According to the prediction scheme provided by the application, the prediction server S acquires respective operation parameters from each server O2 to be predicted in the server cluster J2, and predicts the load of the server cluster J2 and each server O2 to be predicted.
In order to make it possible to clearly describe this server load prediction method later in the present application, the description is made based on the execution environment corresponding to fig. 2. The main execution body of the server load prediction method described in this embodiment is the prediction server S, and the collected operation parameters are derived from the server O2 to be predicted. In the following description, the server O2 to be predicted is simply referred to as a server.
Referring to fig. 3, fig. 3 is a flowchart of a method for predicting a server load according to an embodiment of the disclosure.
The data processing method provided by the embodiment of the application comprises the following steps:
s110, collecting current operation parameters and determining a current average load factor; wherein the operating parameter includes a current number of processing requests.
In the present embodiment, the setting of the collected operation parameters is the operation parameters collected from the prediction server S for processing a login access request of a specified game for the server.
Before logging in the game, the user sends access request information for logging in the account to the server according to the account information through a web browser of the respective client device (hereinafter referred to as a client) or the game application, and the server obtains the access request information. A client can issue a connection to the server's site in an access request. At this time, the server obtains the number of access requests from different clients, and responds to the access request information to form the current number of processing requests.
The number of access request information processing requests may be a number k of connections for the server to access the server site by acquiring the number of access requests from the client.
After the server obtains the access request information, a process may be established, and the process may respond to the access request information according to the account information. The average response time for the process to respond to the access request information is t. For response processing of a server, it is generally in units of milliseconds, and therefore, the number of processing requests r for the server per second satisfies the following formula:
in this embodiment, the current operation parameters collected from the server include the current number of processing requests, and the statistical unit of the number of processing requests may be counted in seconds.
Therefore, the number of processing requests can also be calculated by using the above formula 1.
The average load factor may be obtained by averaging the current server load factor acquired from the server with the historical server load factor. Or, determining the current average load factor according to the load balance of the server.
S120, determining the current processing request change amount according to the current processing request number and the historical processing request number.
Based on the step S110, the current processing request number of the server and the history collection processing request number are obtained. According to the current and the historical processing request numbers, the change amount of the processing request number in the time period formed by the collected current time point relative to the historical time point corresponding to the historical processing request number can be determined, and in the embodiment, the change amount of the processing request number is set as the current processing request change amount.
S130, comparing the current processing request variable quantity with the historical processing request variable quantity, updating a first fluctuation queue for storing the processing request variable quantity, and obtaining an updated second fluctuation queue.
Based on the corresponding processing request variable quantity obtained by the processing request quantity acquired by the data acquisition of the server in the steps S110-S120, the processing request variable quantity is stored in a queue form, and the processing request variable quantity is accumulated and arranged from the head end to the tail end of the queue according to the forming time sequence of the processing request variable quantity to form a first fluctuation queue.
When the current processing request variation is determined according to step S120, a historical processing request variation is obtained from the first wave queue, and the current processing request variation and the historical processing request variation are subjected to load comparison between the current load variation and the historical load variation. Specifically, according to the set comparison form, the current processing request variable quantity is utilized to update the processing request variable quantity stored at the tail end of the first fluctuation queue, and the updated fluctuation queue is used as the second fluctuation queue.
S140, extracting the extreme value of the processing request change quantity in the second fluctuation queue, and predicting the server load according to the extreme value of the processing request change quantity, the current average load coefficient and the current processing request number.
And comparing the current processing request variable quantity with the processing request variable quantity of the second fluctuation queue based on the second fluctuation queue obtained by collecting the current operation parameters and the corresponding data processing, and obtaining the extremum in the second fluctuation queue obtained currently. And based on the extremum and the current average load coefficient in the second fluctuation queue and the current processing request number, predicting the current server load through data processing methods such as balanced load, load assessment model or load calculation.
Based on the prediction method of the server load, which is provided by the application, the current average load coefficient can be determined according to the current operation parameters acquired from the server. And the current processing request number is obtained from the operation parameters, and the current processing request change amount is obtained by the historical processing request number. And then comparing the current processing request variable quantity with the historical processing request variable quantity stored in the first fluctuation queue for load change, and obtaining an updated second fluctuation queue. And extracting an extremum of the processing request change quantity from the second fluctuation queue, and predicting the current load of the server according to the current average load coefficient and the current processing request number. Based on the prediction method provided by the application, the current load change data of the server can be obtained by comparing the current load change data with the historical data in real time according to the operation parameters and the data processing results acquired in real time, so that the current load of the server can be accurately predicted according to the result obtained by the real-time monitoring, and inaccurate load prediction and resource waste caused by reservation of redundant resources due to approximate judgment of the load of the server according to the historical data and experience in the prior art are avoided.
On the basis of the embodiments provided above, the operating parameters may also include CPU utilization.
The CPU utilization rate is CPU resources occupied by the running program and is used for representing the condition of the running program of the server at a certain time point. The higher the utilization rate, the more data tasks the server runs at the time point, and the fewer the data tasks the server runs at the time point.
On this basis, the step S110 described above can further include:
and determining the average load coefficient of the current acquisition unit time according to the CPU utilization rate and the processing request number of the current acquisition unit time and the average load coefficient determined in the previous acquisition unit time.
In the operation of the server, the CPU usage varies in real time based on the data task currently handled by itself. In this embodiment, the current operation parameter may be understood as the current operation parameter of the unit time of collection, and the historical operation parameter is the operation parameter of the specific unit time of collection. Accordingly, the current processing request number and CPU usage rate, in this embodiment, the current acquisition unit time processing request number and CPU usage rate. In this embodiment, for the value of the operation parameter of the specific collection unit time, the value of the operation parameter of the previous collection unit time of the current collection unit time is determined, that is, the current load of the server is predicted based on the operation parameters of the two times that are acquired recently.
Specifically, the average load factor of the current acquisition unit time is determined by using the CPU usage and the processing request number of the current acquisition unit time and the stored CPU usage and processing request number of the previous acquisition unit time of the current acquisition unit time. The average load factor of the current acquisition unit time is determined by the running parameter of the current acquisition unit time and the average load factor of the current latest stored historical acquisition unit time.
Based on the acquisition and processing of the operation parameters, the average load coefficient with the minimum change interval time period and the latest can be obtained, the latest prediction data base is provided for the prediction of the server load, and the obtained real-time prediction result of the current server load is more accurate.
Based on the principle of determining the average load factor of the current acquisition unit time, the obtained average load factor of the current acquisition unit time meets the following formula:
wherein a+b=1, and a > b;
AL is the average load factor of the current acquisition unit time, AL 0 The average load factor of the previous acquisition unit time is C is the CPU utilization rate of the current acquisition unit time, and R is the processing request number of the current acquisition unit time; a and b are both empirical coefficients of deviation.
In the formula 2, the first half part after the equal sign is a data part of the average load factor of the previous acquisition unit time, which affects the average load factor of the current acquisition unit time, and the second half part is a data part of the average load factor of the current acquisition unit time, which affects the CPU utilization rate and the processing request number of the current acquisition unit time. And (3) evaluating the influence of the historical load data on the current load data to obtain deviation experience coefficients a and b of the first half part and the second half part in the formula 2, and calculating to obtain the average load coefficient of the current acquisition unit time.
Since the average load coefficient of the current acquisition unit time is obtained by using the deviation empirical coefficients a and b, the current load data is subjected to coefficient distribution for the historical load data, a+b=1 is satisfied between a and b, and a > b. Therefore, besides the fact that the obtained average load coefficient of the current acquisition unit time does not deviate, the fact that the current acquired data deviate greatly from the data acquired by the history can be guaranteed, the deviation is controlled within a certain range, the fact that the current load data deviate greatly from the load data of the history is prevented, the average load coefficient of the current acquisition unit time is greatly influenced, and stability of data access processing is not facilitated is guaranteed.
With statistics on historical acquisition and processing data, the values of a and b can be 0.75 and 0.25, respectively. Namely, the specific formula 2 is obtained:
similarly, the current processing request number and the historical processing request number are respectively the current processing request number of the unit time and the historical processing request number of the unit time.
For step S120, it may further include:
and calculating to obtain the fluctuation amplitude of the request quantity in the current acquisition unit time according to the processing request quantity in the current acquisition unit time and the processing request quantity in the historical acquisition unit time.
Wherein the processing request change amount in step S120 is the request amount fluctuation amplitude.
And obtaining the change condition of the processing request number in the time period formed between the two time points based on the processing request number acquired at the two time points of the current acquisition unit time and the historical acquisition unit time. In the present embodiment, in order to be able to provide a clearer change in the number of processing requests, the change in the number of processing requests is measured by the request amount fluctuation amplitude. The change in the number of processing requests is actually the amplitude of the change in the number of processing requests for the current acquisition unit time compared to the historical acquisition unit time. The current load of the server is predicted by using the historical load of the server based on the fluctuation amplitude of the request quantity of the current acquisition unit time. And adjusting the prediction accuracy of the load by using the time interval of the current acquisition unit time compared with the historical acquisition unit time. Therefore, the fine adjustment of the load of the server can be realized through the adjustment of the event interval, and the larger adjustment amplitude of the load of the server is avoided.
Based on the principle of data processing of the request amount fluctuation amplitude described above, the request amount fluctuation amplitude satisfies the following formula:
wherein V is the fluctuation amplitude of the request quantity in the current acquisition unit time, R is the processing request quantity in the current acquisition unit time, and R 0 The number of processing requests for the previous acquisition unit time.
The processing request number of the historical acquisition unit time is limited to the processing request number of the previous acquisition unit time of the current acquisition unit time. According to the data processing method of the formula 4, the obtained request quantity fluctuation amplitude of the current acquisition unit time is a proportional value of the request quantity obtained in the two latest prediction time periods, and the request quantity fluctuation amplitude of the current acquisition unit time is obtained.
Referring to fig. 4, fig. 4 is a detailed step diagram of step 130.
Also based on the principle of the data processing of the request amount fluctuation amplitude described above, step S130 may further include:
s131, acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
and S132, when the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, taking out the request quantity fluctuation amplitude of the tail end of the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
When the request quantity fluctuation amplitude of the current acquisition unit time is obtained according to the processing request quantity of the current acquisition unit time and the processing request quantity of the historical acquisition unit time, the current latest stored request quantity fluctuation amplitude is obtained from a first fluctuation queue storing the request quantity fluctuation amplitude of the historical acquisition unit time. In the present application, since the first wave queue is arranged from the head to the tail of the queue according to the time of formation, the currently latest stored request quantity wave amplitude is located at the tail of the first wave queue.
And acquiring the latest stored request quantity fluctuation amplitude from the tail end of the first fluctuation queue, and comparing the latest stored request quantity fluctuation amplitude with the request quantity fluctuation amplitude of the current acquisition unit time. The comparison mode can be proportional comparison, such as the method of formula 4, or differential comparison, so as to obtain the size comparison result of the two. If the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is taken out from the first fluctuation queue, and then the request quantity fluctuation amplitude of the current acquisition unit time is compared with the request quantity fluctuation amplitude of the current tail end in the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time which is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is obtained. Based on the processing procedure of comparing and taking out the first fluctuation ends one by one, the constituent elements and the arrangement mode of the first fluctuation queue are updated to form an updated second fluctuation queue.
On this basis, step S130 further includes:
s133, when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, adding the request quantity fluctuation amplitude of the current acquisition unit time to the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
This step S133 is just opposite to the comparison method of steps S131 to S132 described above and the processing method between the request amount fluctuation amplitude of the current acquisition unit time and the request amount fluctuation amplitude at the end of the first fluctuation queue. And if the value of the fluctuation amplitude of the request quantity in the current acquisition unit time meets the condition of being smaller than or equal to the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue, adding the fluctuation amplitude of the request quantity in the current acquisition unit time to the tail end of the first fluctuation queue to obtain an updated queue of the first fluctuation queue, wherein the updated queue is a second fluctuation queue.
The element size of the second wave queue obtained according to the operations of steps S131 to S133 described above gradually decreases from the head end to the end, and therefore, the element from the head end of the second wave queue is the maximum value of the processing request variation amount in the second wave queue.
The method for obtaining the maximum value of the processing request variation can be applied to a prediction method of the current load of the server and the operation parameter collected each time, and the method is repeatedly executed, so that the head end of the second fluctuation queue obtained by each time and the historical load data is the maximum value.
For clarity of illustration, the second wave queue update procedure is illustrated:
referring to fig. 5, the upper queue in fig. 5 is a first wave queue, in which the arrangement from the head end to the tail end is the arrangement from the left to the right, and elements of the first wave queue arranged from the head end to the tail end have 7, 6, 5, 4, and 3. And if the fluctuation amplitude of the request quantity in the current acquisition unit time is 5, taking out the 4 and 3 of the first fluctuation queue because the 5 is larger than the 4 and 3, and sequentially forming 7, 6 and 5 elements of the second fluctuation queue after the first updating. And because the fluctuation amplitude of the request quantity in the current acquisition unit time is 5, and the value of the fluctuation amplitude is equal to the fluctuation amplitude 5 of the request quantity at the tail end of the first fluctuation queue, after the second fluctuation queue is further updated, the elements of the second fluctuation queue obtained through the second update are arranged to be 7, 6, 5 and 5.
And according to the second fluctuation queue with the size of the obtained element decreasing from the head end to the tail end after the data processing of comparing, taking out and adding the size of the request quantity fluctuation amplitude of 5 according to the current acquisition unit time and the tail end element in the first fluctuation queue is respectively carried out, so that the maximum value of the request quantity fluctuation amplitude of the second fluctuation queue is 7 at the head end.
The method for obtaining the maximum value of the processing request variation can be applied to a prediction method of the current load of the server and the operation parameter collected each time, and the method is repeatedly executed, so that the head end of the second fluctuation queue obtained according to the current and historical data is the maximum value.
Referring to fig. 6, fig. 6 is another detailed step diagram of step S130.
Similarly, based on the principle of the data processing of the request amount fluctuation amplitude or the processing method of obtaining the maximum value of the processing request amount, step S130 may further include:
s134, acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
and S135, when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, taking out the request quantity fluctuation amplitude of the tail end of the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
When the request quantity fluctuation amplitude of the current acquisition unit time is obtained according to the processing request quantity of the current acquisition unit time and the processing request quantity of the historical acquisition unit time, the current latest stored request quantity fluctuation amplitude is obtained from a first fluctuation queue storing the request quantity fluctuation amplitude of the historical acquisition unit time. In the present application, since the first wave queue is arranged from the head to the tail of the queue according to the time of formation, the currently latest stored request quantity wave amplitude is located at the tail of the first wave queue.
And acquiring the latest stored request quantity fluctuation amplitude from the tail end of the first fluctuation queue, and comparing the latest stored request quantity fluctuation amplitude with the request quantity fluctuation amplitude of the current acquisition unit time. The comparison mode can be proportional comparison, such as the method of formula 4, or differential comparison, so as to obtain the size comparison result of the two. If the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is taken out from the first fluctuation queue, and then the request quantity fluctuation amplitude of the current acquisition unit time is compared with the request quantity fluctuation amplitude of the current tail end in the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time which is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is obtained. Based on the processing procedure of comparing and taking out the first fluctuation ends one by one, the constituent elements and the arrangement mode of the first fluctuation queue are updated to form an updated second fluctuation queue.
On this basis, step S130 further includes:
s136, when the request quantity fluctuation amplitude of the current acquisition unit time is larger than that of the tail end of the first fluctuation queue, adding the request quantity fluctuation amplitude of the current acquisition unit time to the tail end of the first fluctuation queue to obtain an updated second fluctuation queue.
This step S136 is just opposite to the comparison method of steps S134 to S135 described above and the processing method between the request amount fluctuation amplitude of the current acquisition unit time and the request amount fluctuation amplitude at the end of the first fluctuation queue. And if the value of the fluctuation amplitude of the request quantity in the current acquisition unit time meets the condition that the value is larger than the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue, adding the fluctuation amplitude of the request quantity in the current acquisition unit time to the tail end of the first fluctuation queue to obtain an updated queue of the first fluctuation queue, wherein the updated queue is a second fluctuation queue.
The element size of the second wave queue obtained according to the operations of steps S134 to S136 described above gradually increases from the head end to the end, and therefore, the element from the head end of the second wave queue is the minimum value of the processing request variation amount in the second wave queue.
The method for obtaining the minimum value of the processing request variable quantity can be applied to a prediction method of the current load of the server and the operation parameters collected each time, and the method is repeatedly executed, so that the head end of the second fluctuation queue obtained according to the current and historical data is the minimum value.
For clarity of illustration, the second wave queue update procedure is illustrated:
referring to fig. 7, the upper queue in fig. 7 is a first wave queue, and the arrangement manner from the head end to the tail end is a left-to-right arrangement manner, and 3, 4, 5, 6 and 7 are arranged from the head end to the tail end of the first wave queue. And if the fluctuation amplitude of the request quantity in the current acquisition unit time is 6, taking out the 6 and 7 of the first fluctuation queue as 6 is smaller than 7 and equal to 7, and updating for the first time to form a second fluctuation queue which is 3, 4 and 5. And because the current request quantity fluctuation amplitude of the unit time is 6, and the value of the current request quantity fluctuation amplitude is larger than the request quantity fluctuation amplitude 5 at the tail end of the first fluctuation queue, after the second fluctuation queue is further updated, the elements of the second fluctuation queue obtained through the second update are arranged to be 3, 4, 5 and 6.
And after the data processing of size comparison, taking out and adding is respectively carried out according to the requirement fluctuation amplitude of 6 in the current acquisition unit time and the tail end element in the first fluctuation queue, the obtained second fluctuation queue is gradually increased from the head end to the tail end, so that the minimum value of the requirement fluctuation amplitude of the second fluctuation queue is 3 at the head end.
The second wave queue for the maximum value and the minimum value of the obtained request quantity wave amplitude is a double-end queue. Elements in the double-ended queue may pop out from both ends, i.e., the head end and the end.
And after determining the maximum value and/or the minimum value of the request amount fluctuation amplitude, further comprising:
acquiring the generation time of the corresponding current processing request number at the head end of the second fluctuation queue;
and if the time interval between the generation time and the current time exceeds the preset statistical duration, deleting the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue.
The second fluctuation queue is arranged from the head end to the tail end according to the formation time of the request quantity fluctuation amplitude, so that the generation time of the current processing request number corresponding to the request quantity fluctuation amplitude acquired from the head end is earlier than that of other request quantity fluctuation amplitudes arranged in the second fluctuation queue. Comparing the generation time of the current processing request number corresponding to the head end of the second fluctuation queue with the current time according to the preset statistical time set for the second fluctuation queue, and deleting the fluctuation amplitude of the request quantity of the head end element of the second fluctuation queue if the obtained time interval is larger than the preset statistical time until the time interval between the generation time of the current processing request number corresponding to the head end of the second fluctuation queue and the current time meets the preset statistical time.
For example, the time interval between two neighboring execution servers collecting the operation parameters is 1 second, and the preset statistical time period is set to 1 minute. If the number of the head element of the second wave queue is set to be 1, when the element with the number 61 is generated in the second wave queue, the time interval between the element with the number 1 and the current time exceeds the preset statistical time length of 1 minute, so that the element with the number 1 at the head end of the second wave queue is deleted, the length of the second wave queue is ensured to be controlled within the set range, the processing amount of data is reduced, and the operation load of the data is reduced.
For step S140, it may further include:
and obtaining the maximum value and the minimum value of the processing request variable quantity, and respectively calculating the maximum value and the minimum value of the processing request variable quantity with the current processing request number and the average load coefficient to obtain a prediction range of the server load in the preset statistical time length.
In the embodiment, after the maximum value and the minimum value of the processing request variable quantity are obtained after the data of the operation data and the historical processing request quantity which are collected in the preset statistical time period are processed, calculating according to the maximum value of the processing request variable quantity and the current processing request quantity and the average load coefficient, and predicting to obtain the maximum value of the server load; and if the minimum value of the processing request variation is calculated according to the current processing request number and the average load coefficient, predicting to obtain the minimum value of the server load. Therefore, according to the data processing process, the prediction range of the server load in the preset statistical time duration is obtained.
The prediction range of the server load provided according to the above embodiment satisfies the following formula:
AL×R×TL 1 ≤L≤AL×R×TL 2 (equation 5)
Wherein L is the predicted result of the server load, AL is the average load coefficient of the current acquisition unit time, R is the processing request number of the current acquisition unit time, TL 1 To handle minima of request variation, TL 2 To handle the maximum value of the request variation.
For the extreme value of the change quantity of the processing request, the preset statistical time length can be two extreme values which are required to be calculated in each time dimension of each minute, each hour, each day, each week and the like according to the statistical requirement of the data.
According to the description of the other embodiments described above, the processing request variation amount is the request amount fluctuation amplitude.
In order to more fully and clearly explain the scheme of the server load prediction method, the server load prediction method provided by the application is explained based on the application scene of the online viewing game. Referring to fig. 8, fig. 8 is a schematic flow chart of another method for predicting server load according to the present application. The execution process is as follows:
s1, determining an average load coefficient AL according to the current CPU utilization rate C, the processing request number R and the previous second 0 Determining an average load factor AL of the last second; wherein the average load factor of the last second satisfies the formula:and a+b=1, and a>b;
S2, determining the fluctuation amplitude V of the request quantity in the last second according to the current processing request number R and the processing request number Ro of the previous second; wherein the request quantity fluctuation amplitude V satisfies the formula
S3, acquiring the current fluctuation amplitude V of the request quantity, and comparing the current fluctuation amplitude V of the request quantity with the fluctuation amplitude V of the request quantity at the tail end of the first fluctuation queue 0 Comparing;
s31, when V>V 0 When V is to 0 Taking out until V is smaller than or equal to the fluctuation amplitude of the request quantity at the current tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue;
s32, when V<V 0 Or v=v 0 In the time-course of which the first and second contact surfaces,adding V to the tail end of the first fluctuation queue to obtain a second fluctuation queue updated again, and updating the head end V of the obtained second fluctuation queue at the moment 1 TL as processing request variable Extremely large
Or,
s33, when V<V 0 Or v=v 0 When V is to 0 Taking out until V is larger than the fluctuation amplitude of the request quantity at the current tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue;
s34, when V>V 0 When the V is added to the tail end of the first fluctuation queue, a second fluctuation queue updated again is obtained, and the head end V of the second fluctuation queue obtained by updating at the moment is obtained 1 TL as processing request variable Extremely small
S4, acquiring the head end V of the second fluctuation queue updated in the step S32 or the step S34 1 The generation time t of the corresponding current processing request number 0 Time interval t-t from current time t 0 >T, deleting the head end V of the second fluctuation queue 1 The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is a preset statistical time length;
s5, according to AL x R x TL Extremely small ≤L≤AL×R×TL Extremely large
And calculating to obtain the prediction range of the load of the server in the preset statistical time length.
Based on the same application concept as the method for predicting the server load, the embodiment of the application further provides a device 200 for predicting the server load. Referring to fig. 9, fig. 9 is a schematic structural diagram of a server load prediction apparatus according to an embodiment of the present application.
The server load prediction apparatus 200 includes:
the parameter acquisition module 210 is configured to acquire a current operation parameter and determine a current average load factor; wherein the operating parameters include a current number of processing requests;
a request change determining module 220, configured to determine a current processing request change amount according to the current processing request number and the historical processing request number;
a queue updating module 230, configured to compare the current processing request variation with the historical processing request variation, and update a first fluctuation queue for storing the processing request variation, to obtain an updated second fluctuation queue;
The load prediction module 240 is configured to extract an extremum of the processing request variation in the second wave queue, and predict a server load according to the extremum of the processing request variation, the current average load coefficient, and the current processing request number.
Based on the prediction apparatus 200 for server load provided in the present application, the current average load factor can be determined according to the current operation parameter collected from the server. And the current processing request number is obtained from the operation parameters, and the current processing request change amount is obtained by the historical processing request number. And then comparing the current processing request variable quantity with the historical processing request variable quantity stored in the first fluctuation queue for load change, and obtaining an updated second fluctuation queue. And extracting an extremum of the processing request change quantity from the second fluctuation queue, and predicting the current load of the server according to the current average load coefficient and the current processing request number. Based on the prediction method provided by the application, the current load change data of the server can be obtained by comparing the current load change data with the historical data in real time according to the operation parameters and the data processing results acquired in real time, so that the current load of the server can be accurately predicted according to the result obtained by the real-time monitoring, and inaccurate load prediction and resource waste caused by reservation of redundant resources due to approximate judgment of the load of the server according to the historical data and experience in the prior art are avoided.
Optionally, the operation parameters further include CPU utilization;
the parameter acquisition module 210 is configured to determine an average load factor of the current acquisition unit time according to the CPU usage and the processing request number of the current acquisition unit time and the average load factor determined in the previous acquisition unit time.
Wherein, the average load factor of the current acquisition unit time satisfies the following formula:
wherein a+b=1, and a > b;
AL is the average load factor of the current acquisition unit time, AL 0 The average load factor of the previous acquisition unit time is C is the CPU utilization rate of the current acquisition unit time, and R is the processing request number of the current acquisition unit time; a and b are both empirical coefficients of deviation.
Wherein, the step of collecting the current operation parameters comprises the following steps:
aiming at a target task, each server in a server cluster corresponding to the target task is used as a server to be predicted, and current operation parameters are collected for each server to be predicted.
Optionally, the processing request variable is a request quantity fluctuation amplitude;
the request change determining module 220 is configured to calculate, according to the number of processing requests in the current acquisition unit time and the number of processing requests in the historical acquisition unit time, a request amount fluctuation amplitude in the current acquisition unit time.
Wherein the request amount fluctuation amplitude satisfies the following formula:
wherein V is the fluctuation amplitude of the request quantity in the current acquisition unit time, R is the processing request quantity in the current acquisition unit time, and R 0 The number of processing requests for the previous acquisition unit time.
Optionally, the queue updating module 230 is configured to obtain a request quantity fluctuation amplitude of a current acquisition unit time, and compare the request quantity fluctuation amplitude of the current acquisition unit time with a request quantity fluctuation amplitude at the end of the first fluctuation queue;
when the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is taken out until the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
Optionally, the queue updating module 230 is further configured to add the request amount fluctuation amplitude of the current acquisition unit time to the end of the first fluctuation queue to obtain an updated second fluctuation queue when the request amount fluctuation amplitude of the current acquisition unit time is less than or equal to the request amount fluctuation amplitude of the end of the first fluctuation queue.
Optionally, the queue updating module 230 is further configured to take the request quantity fluctuation amplitude at the head end of the second fluctuation queue as a maximum value of the processing request change quantity.
Optionally, the queue updating module 230 is configured to compare the current processing request variation with the historical processing request variation, and update a first fluctuation queue for storing the processing request variation, to obtain an updated second fluctuation queue, where the step includes:
acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
and when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, taking out the request quantity fluctuation amplitude of the tail end of the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
Optionally, the queue updating module 230 is further configured to add the request amount fluctuation amplitude of the current acquisition unit time to the end of the first fluctuation queue to obtain an updated second fluctuation queue when the request amount fluctuation amplitude of the current acquisition unit time is greater than the request amount fluctuation amplitude of the end of the first fluctuation queue.
Optionally, the queue updating module 230 is further configured to use the request amount fluctuation amplitude at the head end of the second fluctuation queue as a minimum value of the processing request change amount.
Optionally, the queue updating module 230 is further configured to obtain a generation time of the corresponding current processing request number at the head end of the second fluctuation queue;
if the time interval between the generation time and the current time exceeds the preset statistical duration, deleting the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue;
wherein the second wave queue is a double-ended queue.
Optionally, the load prediction module 240 is configured to obtain a maximum value and a minimum value of the processing request variable, and calculate the maximum value and the minimum value of the processing request variable with the current processing request number and the current average load coefficient, respectively, to obtain a prediction range of the server load in a preset statistical duration.
Wherein the predicted range of server load satisfies the following formula:
AL×R×TL 1 ≤L≤AL×R×TL 2
wherein L is the predicted result of the server load, AL is the average load coefficient of the current acquisition unit time, R is the processing request number of the current acquisition unit time, TL 1 To handle minima of request variation, TL 2 To handle the maximum value of the request variation.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device for predicting server load according to an embodiment of the present application.
In an alternative embodiment, an electronic device is provided, as shown in fig. 10, the electronic device 300 shown in fig. 10 includes: a processor 301 and a memory 303. Wherein the processor 301 is coupled to the memory 303, such as via a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that, in practical applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 is not limited to the embodiment of the present application.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 10 is only an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
The present application provides a computer readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above. Compared with the prior art, the computer readable storage medium in the embodiment of the application can compare the real-time acquired running parameters and data processing results with historical data in real time to obtain the change data of the current load of the server, so that the load change of the server can be monitored in real time, the current load of the server can be accurately predicted according to the result obtained by the real-time monitoring, and inaccurate load prediction caused by roughly judging the load of the server according to the historical data and experience and resource waste caused by reserving redundant resources in the prior art are avoided.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above-described embodiments.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing description is only of the preferred embodiments of the present application and is presented as a description of the principles of the technology being utilized. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this application is not limited to the specific combinations of features described above, but it is intended to cover other embodiments in which any combination of features described above or equivalents thereof is possible without departing from the spirit of the disclosure. Such as the above-described features and technical features having similar functions (but not limited to) disclosed in the present application are replaced with each other.

Claims (12)

1. A method for predicting server load, comprising the steps of:
collecting current operation parameters and determining a current average load coefficient; wherein the operating parameters include a current number of processing requests;
determining the current processing request variable quantity according to the current processing request quantity and the historical processing request quantity;
comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue, wherein the mode for updating the first fluctuation queue comprises the following steps: if the change amount of the processing request at the tail end of the first fluctuation queue is smaller than or equal to the current change amount of the processing request, or the change amount of the processing request at the tail end of the first fluctuation queue is larger than the current change amount of the processing request, storing the current change amount of the processing request at the tail end of the first fluctuation queue;
and extracting an extremum of the processing request change quantity in the second fluctuation queue, and predicting the server load according to the extremum of the processing request change quantity, the current average load coefficient and the current processing request number.
2. The method for predicting server load according to claim 1, wherein: the operation parameters also comprise CPU utilization rate;
The step of collecting the current operation parameters and determining the current average load factor comprises the following steps:
and determining the average load coefficient of the current acquisition unit time according to the CPU utilization rate and the processing request number of the current acquisition unit time and the average load coefficient determined in the previous acquisition unit time.
3. The method for predicting server load according to claim 1, wherein:
the processing request variable quantity is the fluctuation amplitude of the request quantity;
the determining the current processing request change amount according to the current processing request number and the historical processing request number comprises the following steps:
calculating to obtain the fluctuation amplitude of the request quantity in the current acquisition unit time according to the processing request quantity in the current acquisition unit time and the processing request quantity in the historical acquisition unit time;
the step of comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue comprises the following steps:
acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
When the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the tail end of the first fluctuation queue is taken out until the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
4. A method of predicting server load as claimed in claim 3, further comprising:
when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the current acquisition unit time is added to the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
5. The method for predicting server load of claim 4, further comprising:
and taking the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue as the maximum value of the change quantity of the processing request.
6. The method for predicting server load according to claim 1, wherein:
the step of comparing the current processing request variable quantity with the historical processing request variable quantity, and updating a first fluctuation queue for storing the processing request variable quantity to obtain an updated second fluctuation queue comprises the following steps:
Acquiring the fluctuation amplitude of the request quantity in the current acquisition unit time, and comparing the fluctuation amplitude of the request quantity in the current acquisition unit time with the fluctuation amplitude of the request quantity at the tail end of the first fluctuation queue;
and when the request quantity fluctuation amplitude of the current acquisition unit time is smaller than or equal to the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, taking out the request quantity fluctuation amplitude of the tail end of the first fluctuation queue until the request quantity fluctuation amplitude of the current acquisition unit time is larger than the request quantity fluctuation amplitude of the tail end of the first fluctuation queue, and obtaining an updated second fluctuation queue.
7. The method of predicting server load of claim 6, further comprising:
when the request quantity fluctuation amplitude of the current acquisition unit time is larger than that of the tail end of the first fluctuation queue, the request quantity fluctuation amplitude of the current acquisition unit time is added to the tail end of the first fluctuation queue, and an updated second fluctuation queue is obtained.
8. The method for predicting server load of claim 7, further comprising:
and taking the fluctuation amplitude of the request quantity at the head end of the second fluctuation queue as the minimum value of the change quantity of the processing request.
9. The method according to claim 1, wherein the step of predicting the server load based on the extremum of the processing request variation amount, the average load factor, and the processing request number comprises:
and obtaining the maximum value and the minimum value of the processing request variable quantity, and respectively calculating the maximum value and the minimum value of the processing request variable quantity with the current processing request number and the current average load coefficient to obtain the prediction range of the server load in the preset statistical time length.
10. A server load predicting apparatus, comprising:
the parameter acquisition module is used for acquiring current operation parameters and determining a current average load coefficient; wherein the operating parameters include a current number of processing requests;
the request change determining module is used for determining the current processing request change amount according to the current processing request number and the historical processing request number;
the queue updating module is configured to compare the current processing request variation with the historical processing request variation, update a first fluctuation queue for storing the processing request variation, obtain an updated second fluctuation queue, and update the first fluctuation queue, where the method includes: if the change amount of the processing request at the tail end of the first fluctuation queue is smaller than or equal to the current change amount of the processing request, or the change amount of the processing request at the tail end of the first fluctuation queue is larger than the current change amount of the processing request, storing the current change amount of the processing request at the tail end of the first fluctuation queue;
And the load prediction module is used for extracting the extreme value of the processing request change quantity in the second fluctuation queue and predicting the server load according to the extreme value of the processing request change quantity, the current average load coefficient and the current processing request number.
11. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: a method of predicting server load according to any one of claims 1-9.
12. A computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the server load prediction method of any of claims 1-9.
CN202110931861.1A 2021-08-13 2021-08-13 Method and device for predicting server load, electronic equipment and storage medium Active CN113535530B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110931861.1A CN113535530B (en) 2021-08-13 2021-08-13 Method and device for predicting server load, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110931861.1A CN113535530B (en) 2021-08-13 2021-08-13 Method and device for predicting server load, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113535530A CN113535530A (en) 2021-10-22
CN113535530B true CN113535530B (en) 2024-03-01

Family

ID=78091564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110931861.1A Active CN113535530B (en) 2021-08-13 2021-08-13 Method and device for predicting server load, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113535530B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117081996B (en) * 2023-10-16 2024-01-05 北京乐讯科技有限公司 Flow control method based on server-side real-time feedback and soft threshold and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664812A (en) * 2012-05-14 2012-09-12 山东大学 Two-stage service system load forecast and balancing method integrating service forecast and real-time load
CN108632384A (en) * 2018-05-15 2018-10-09 西安电子科技大学 Load-balancing method based on the prediction of video request number

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1135746C (en) * 2000-10-19 2004-01-21 华为技术有限公司 Multiple-job load monitoring and forecasting device in CDMA cellular communication system and its calculation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664812A (en) * 2012-05-14 2012-09-12 山东大学 Two-stage service system load forecast and balancing method integrating service forecast and real-time load
CN108632384A (en) * 2018-05-15 2018-10-09 西安电子科技大学 Load-balancing method based on the prediction of video request number

Also Published As

Publication number Publication date
CN113535530A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN112162865B (en) Scheduling method and device of server and server
CN108710540B (en) Resource scheduling method, device and equipment in distributed cluster
US20070214261A1 (en) Analysis method and apparatus
CN107911399B (en) Elastic expansion method and system based on load prediction
CN108604194B (en) Probabilistic adjustment
US9152919B2 (en) Method and system for recommending tasks to crowdworker
JP5847361B2 (en) Method and apparatus for acquiring dynamic information
CN113535530B (en) Method and device for predicting server load, electronic equipment and storage medium
CN112819576A (en) Training method and device for charging station recommendation model and recommendation method for charging station
CN114500339B (en) Node bandwidth monitoring method and device, electronic equipment and storage medium
US20220245495A1 (en) Information processing method and apparatus, and computer-readable storage medium
CN110083518B (en) AdaBoost-Elman-based virtual machine software aging prediction method
US20110208854A1 (en) Dynamic traffic control using feedback loop
JP6764302B2 (en) Power demand forecasting system, power demand forecasting method and power demand forecasting program
CN112187870B (en) Bandwidth smoothing method and device
US9501321B1 (en) Weighted service requests throttling
CN110377427B (en) Task monitoring method, device and system
CN111784173A (en) AB experiment data processing method, device, server and medium
CN112669091B (en) Data processing method, device and storage medium
CN113722177B (en) Timing index anomaly detection method, apparatus, system, device and storage medium
CN116107741A (en) Load balancing scheduling method, system, electronic equipment and readable storage medium
Singh et al. Apply AHP for resource allocation problem in cloud
CN113904940A (en) Resource adjusting method and device, electronic equipment and computer readable storage medium
US11275797B2 (en) Information processing apparatus correcting access frequency of shared information, information processing system, and non-transitory computer readable medium
CN116339932A (en) Resource scheduling method, device and server

Legal Events

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