CN111090516B - Request distribution method, device and equipment - Google Patents

Request distribution method, device and equipment Download PDF

Info

Publication number
CN111090516B
CN111090516B CN201911169271.9A CN201911169271A CN111090516B CN 111090516 B CN111090516 B CN 111090516B CN 201911169271 A CN201911169271 A CN 201911169271A CN 111090516 B CN111090516 B CN 111090516B
Authority
CN
China
Prior art keywords
server
weight
returning
calculating
ratio
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
CN201911169271.9A
Other languages
Chinese (zh)
Other versions
CN111090516A (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.)
Shanghai Ant Chuangjiang Information Technology Co ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN201911169271.9A priority Critical patent/CN111090516B/en
Publication of CN111090516A publication Critical patent/CN111090516A/en
Application granted granted Critical
Publication of CN111090516B publication Critical patent/CN111090516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/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/5013Request control

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The specification provides a request distribution method, a request distribution device and request distribution equipment, wherein the method comprises the following steps: determining parameters of a plurality of service terminals; determining the capture weight of each server; wherein, the capturing weight is the weight of the server participating redistribution; calculating the return weight of each server according to the parameters of each server and the weight of each server in the previous distribution; the returning weight is obtained by the service end through redistribution, and the sum of the returning weights of the service ends is equal to the sum of the capturing weights of the service ends; calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution; and allocating the request for each server according to the weight of each server in the current allocation.

Description

Request distribution method, device and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for request allocation.
Background
In a practical application scenario, requests are generally reasonably distributed to different servers to improve the request processing capability.
In the prior art, the weight of each server is determined according to the number of idle threads in the server, and the request is distributed to each server according to the weight. For example, the numbers of idle threads in the servers 1-3 are 20, 10, and 10, respectively, and the corresponding weights are 0.5, 0.25, and 0.25, respectively.
However, as the number of requests increases, how to further improve the request processing capability becomes an issue to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present specification provide a request distribution method, apparatus, and device, which can improve request processing speed.
In a first aspect, an embodiment of the present specification provides a request allocation method, including:
determining parameters of a plurality of service terminals;
determining the grabbing weight of each server; wherein, the capturing weight is the weight of the server participating in redistribution;
calculating the return weight of each server according to the parameters of each server and the weight of each server in the previous distribution; the returning weight is obtained by the server through redistribution, and the sum of the returning weights of the servers is equal to the sum of the capturing weights of the servers;
calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution;
and allocating a request for each server according to the weight of each server in the current allocation.
In a second aspect, an embodiment of the present specification provides a request distribution apparatus, including:
the determining unit is configured to determine parameters of a plurality of service terminals; determining the grabbing weight of each server; wherein, the capturing weight is the weight of the server participating in redistribution;
the calculating unit is configured to calculate the return weight of each server according to the parameter of each server and the weight of each server in the previous distribution; calculating the weight of each server in the current distribution according to the capturing weight and the returning weight of each server and the weight of each server in the previous distribution; the returning weight is obtained by the server through redistribution, and the sum of the returning weights of the servers is equal to the sum of the capturing weights of the servers;
and the distribution unit is configured to distribute the request to each server according to the weight of each server in the current distribution.
In a third aspect, an embodiment of the present specification provides a request distribution apparatus, including: a processor and a memory;
the memory is used for storing execution instructions, and the processor is used for executing the execution instructions stored by the memory to realize the method of any one of the above embodiments.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: the method allocates the requests based on the parameters of the server and the weight of each server in the previous allocation. In an actual application scenario, a time difference exists between the two steps of "determining parameters of a plurality of servers" and "allocating requests to each server", so that the determined parameters of the servers may not be the same as the parameters of the servers when "allocating requests to each server". Considering that the weight of the server in the previous distribution influences the parameters of the server in the current distribution, the method introduces the weight of each server in the previous distribution in the distribution process to adjust the parameters of each server, so as to distribute the requests more reasonably and improve the request processing speed.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a request distribution method provided in one embodiment of the present specification;
FIG. 2 is a flow diagram of another method for request distribution provided by one embodiment of the present description;
fig. 3 is a schematic structural diagram of a request distribution apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure more clear, the technical solution in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are a part of the embodiments of the present disclosure, but not all embodiments, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts based on the embodiments of the present disclosure belong to the protection scope of the present disclosure.
As shown in fig. 1, an embodiment of the present specification provides a request allocation method, which may include the following steps:
step 101: parameters of a plurality of service terminals are determined.
The method is applied to a gateway side, and the gateway is connected with at least one server side.
Specifically, the parameters may be obtained from each server, and may also be obtained from the gateway.
The parameters of the server include but are not limited to: the number of idle threads and the number of the requests distributed in a preset time period. The preset time period may be from the starting time to the determining time, where the determining time may be a time when the parameter is obtained from the server or a time when the parameter is obtained from the gateway. In addition, the number of idle threads is used for representing the real-time processing capacity of the server, and the number of the requests distributed in the preset time period is used for representing the interval processing capacity of the server.
Step 102: and determining the capture weight of each server.
The capturing weight is the weight of the server participating in redistribution, and the capturing weight of the server is not more than the weight of the server in the previous distribution.
The capturing weight is the weight of the server side participating in redistribution, and is not more than the weight corresponding to the previous distribution.
The grabbing weight is part or all of the weight of the server in the previous allocation. For example, if the weight of the server x in the previous allocation is 0.5, the capture weight of the server x may be [0,0.5], and if the capture weight of the server x is 0.1, the weight of the server x participating in the reallocation is 0.1, and the weight of the server x not participating in the reallocation is 0.4.
Preferably, the grabbing weights of the respective servers are equal.
Step 103: and calculating the return weight of each server according to the parameters of each server and the weight of each server in the previous distribution.
The returning weight is obtained by the service end through redistribution, and the sum of the returning weights of the service ends is equal to the sum of the capturing weights of the service ends.
Step 104: and calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution.
The weight change of the server = the return weight of the server-the capture weight of the server. The weight of the server in the current allocation = the weight of the server + the weight variation of the server in the previous allocation. That is, the weight of the server in the current allocation = the weight of the server in the previous allocation + the return weight of the server-the grabbing weight of the server.
In this step, the parameter participating in the calculation may be only the number of idle threads, may be only the number of requests allocated in the preset time period, and may also include both the number of idle threads and the number of requests allocated in the preset time period.
It should be noted that, step 103 is directed to a case that the current allocation is not the first allocation, and if the current allocation is the first allocation, the method further includes: and calculating the weight of each server in the current distribution according to the parameters of each server and the weight preset for each server.
Step 105: and allocating the request for each server according to the weight of each server in the current allocation.
In an actual application scenario, because there is a time difference between step 101 and step 105, the parameters of the server obtained in step 101 may not be the same as the parameters of the server corresponding to step 105. Considering that the weight of the server in the previous distribution influences the parameters of the server corresponding to the current distribution, the method introduces the weight of each server in the previous distribution in the distribution process to adjust the parameters of each server, so as to distribute the request more reasonably and improve the request processing speed.
For example, 10. In particular, in high concurrency scenarios, the effect of the time difference is amplified.
The method reduces the risks of overload and downtime of each server according to the parameter allocation requests of the servers.
It should be noted that, the steps 101 to 105 are only one allocation process, and when there is no request to be allocated, the steps 101 to 105 are repeated.
In an actual application scenario, steps 101 to 104 are implemented by one thread, and step 105 is implemented by another thread, at this time, the reallocation process corresponding to steps 101 to 104 does not affect the request allocation process corresponding to step 105.
The method can redistribute part or all of the weights previously distributed by the server based on the parameters of the server, so that the weights of the server in the current distribution can adapt to the processing capacity of the server. When the method is executed once, the weight of the server is adjusted once, and when the method is repeatedly executed, the weight variation approaches to 0.
In an embodiment of the present specification, step 103 specifically includes:
a1: and calculating the return ratio of each server according to the parameters of each server and the weight of each server in the previous distribution.
The return duty ratio is used for measuring the duty ratio of the return weight of the server in the sum of the grabbing weights of the servers, that is, the return duty ratio = the sum of the return weight of the server/the grabbing weight of each server.
a2: and calculating the returning weight of each server according to the returning proportion and the capturing weight of each server.
Specifically, the return weight of the server can be calculated by the following equation (7). In one embodiment of the present specification, a1 specifically includes:
b1: and calculating the proportional relation of the adjustment coefficients of the service ends according to the weight of each service end in the previous distribution.
The adjusting coefficient of the server is used for adjusting the parameter of the server. In the embodiment of the present specification, the proportional relationship of the adjustment coefficients of the respective servers is calculated according to the equations (1) and (2).
Figure BDA0002287212640000061
Figure BDA0002287212640000062
Wherein, w m The product of the weights used to characterize the server m in the previous assignment, W used to characterize the weights of the various servers in the previous assignment, A m The method is used for representing the adjustment coefficient of the server m, and the value of m is 1-n.
b2: and calculating the return ratio of each server according to the proportional relation of the parameters and the adjustment coefficients of each server.
The method can enable the adjusted parameters of the server to be the same as or similar to the parameters of the server corresponding to the step 105, reduce or avoid the influence caused by the time difference, further reasonably distribute the requests, effectively improve the overall throughput of the server and improve the processing speed of the requests.
In one embodiment of the present description, the parameters include: the number of idle threads and the number of requests distributed in a preset time period;
b2 specifically comprises:
c1: and calculating the thread return ratio of each server according to the number of idle threads of each server and the proportional relation of the adjustment coefficients. And the thread return duty ratio is used for measuring the duty ratio of the number of the idle threads of the adjusted server to the sum of the number of the idle threads of each adjusted server.
Namely, according to the formula (3), the thread return occupation ratio of each server is calculated.
Figure BDA0002287212640000071
Wherein p is km Thread return ratio, K, for characterizing server m m And the number of idle threads used for representing the server m.
c2: and calculating the flow return ratio of each service end according to the quantity of the requests distributed by each service end in a preset time period and the proportional relation of the adjustment coefficients. And the flow return ratio is used for measuring the ratio of the number of the requests distributed by the adjusted service end in the preset time period to the sum of the number of the requests distributed by each adjusted service end in the preset time period.
Namely, according to the equation (4), the thread return occupation ratio of each server is calculated.
Figure BDA0002287212640000072
Wherein p is om Traffic Return ratio, O, for characterizing Server m m The method is used for characterizing the number of the requests distributed by the server m in a preset time period.
c3: and calculating the returning occupation ratio of each server according to the thread returning occupation ratio and the flow returning occupation ratio of each server.
That is, the return-to-occupation ratio of each server is calculated according to equation (5).
Figure BDA0002287212640000073
And if the parameter is only the number of idle threads, the returning ratio is a thread returning ratio, and if the parameter is only the number of the requests distributed in the preset time period, the returning ratio is a flow returning ratio.
In one embodiment of the present specification, c3 specifically includes:
e1: a thread impact factor and a traffic impact factor are determined.
The thread influence factor is used for measuring the influence degree of the number of idle threads on the return ratio; the flow influence factor is used for measuring the influence degree of the quantity of the requests distributed in the preset time period on the return ratio.
Specifically, the sum of the thread impact factor and the flow impact factor is 1. For example, the thread impact factor is 0.7 and the traffic impact factor is 0.3.
e2: and calculating the returning occupation ratio of each server according to the thread returning occupation ratio of each server and the thread influence factor corresponding to the thread returning occupation ratio, and the flow returning occupation ratio of each server and the flow influence factor corresponding to the flow returning occupation ratio.
That is, the return ratio of each server is calculated according to equation (6) in consideration of the thread influence factor and the traffic influence factor.
Figure BDA0002287212640000081
Wherein, alpha is used for characterizing the thread influence factor, and beta is used for characterizing the flow influence factor.
In one embodiment of the present specification, when the deprivation weights of the respective servers are equal, the return weight of the server is calculated according to equation (7).
q m =n×D×P m (7)
Wherein q is m The return weight is used for representing the server m, n is used for representing the number of the servers, and D is used for representing the grabbing weight of the server m.
In one embodiment of the present specification, formula (1) may be derived in any of the following ways.
Mode 1, from K 1 :K 2 :...:K n =1:1: ...:1 and A 1 K 1 :A 2 K 2 :...:
Figure BDA0002287212640000082
Figure BDA0002287212640000083
Deriving to obtain;
mode 2: from K 1 :K 2 :...:K n =w 1 ;w 2 :...:w n And A 1 K 1 :A 2 K 2 :...:A n K n =1:1: ...:1 is derived.
The number of idle threads in the manner 1 and the manner 2 may be replaced by the number of requests allocated in a preset time period.
As shown in fig. 2, in the embodiment of this specification, a request distribution method is described in detail by taking 3 servers as an example, and the method includes:
step 201: and respectively acquiring the number of idle threads and the number of the requests distributed in a preset time period from the 3 service terminals.
Step 202: and determining the capture weight of each server.
The capturing weights of the respective servers may be the same or different, and in the embodiment of the present specification, the capturing weights are all equal to the same preset value.
Wherein, the capturing weight is the weight of the server participating in redistribution, and the capturing weight is not more than the weight corresponding to the previous distribution;
step 203: and calculating the proportional relation of the adjustment coefficients of the service ends according to the weight of each service end in the previous distribution.
And determining the proportional relation of the adjustment coefficients of the service ends according to the formula (1) and the formula (2).
The adjusting coefficient of the server is used for adjusting the parameter of the server;
step 204: and calculating the thread return ratio of each server according to the number of idle threads of each server and the proportional relation of the adjustment coefficients.
Step 205: and calculating the flow return ratio of each service end according to the quantity of the requests distributed by each service end in a preset time period and the proportional relation of the adjustment coefficients.
Step 206: a thread impact factor and a traffic impact factor are determined.
The thread influence factor is used for measuring the influence degree of the number of idle threads on the return ratio; the flow influence factor is used for measuring the influence degree of the quantity of the requests distributed in the preset time period on the return ratio.
Step 207: and calculating the returning occupation ratio of each server according to the thread returning occupation ratio of each server and the thread influence factor corresponding to the thread returning occupation ratio, and the flow returning occupation ratio of each server and the flow influence factor corresponding to the flow returning occupation ratio.
Step 208: and calculating the returning weight of each server according to the returning proportion and the capturing weight of each server.
Wherein the return weight is a weight obtained by the reallocation.
Step 209: and calculating the weight variation of each server according to the capturing weight and the returning weight of each server.
Step 210: and calculating the weight of each server in the current distribution according to the weight of each server in the previous distribution and the weight variation of each server.
Step 211: and allocating the request for each server according to the weight of each server in the current allocation.
In an actual application scenario, the method may be repeatedly executed, that is, the weight of each server is continuously adjusted according to the change of the parameter of the server, so that the weight variation of each server approaches 0.
As shown in fig. 3, an embodiment of the present specification provides a request distribution apparatus, including:
a determining unit 301 configured to determine parameters of a plurality of servers; determining the capture weight of each server; wherein, the capture weight is the weight of the server participating in redistribution, and the capture weight of the server is not more than the weight of the server in the previous distribution
A calculating unit 302, configured to calculate a return weight of each server according to the parameter of each server and the weight of each server in the previous distribution; calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution; the returning weight is obtained by the service end through redistribution, and the sum of the returning weights of the service ends is equal to the sum of the capturing weights of the service ends;
the allocating unit 303 is configured to allocate the request to each server according to the weight of each server in the current allocation.
The request distribution device may be deployed in a gateway. Specifically, the gateway layer may be a Dubbo high concurrency environment gateway layer.
In an embodiment of the present specification, the calculating unit 302 is configured to calculate a weight change amount of the server according to the returning weight and the capturing weight of the server; and calculating the weight of the server in the current distribution according to the weight variation of the server and the weight of the server in the previous distribution.
In an embodiment of the present specification, the calculating unit 302 is configured to calculate a return ratio of each server according to the parameter of each server and the weight of each server in the previous allocation; calculating the returning weight of each server according to the returning ratio and the capturing weight of each server; wherein, the return occupation ratio is used for measuring the occupation ratio of the return weight of the service end in the sum of the capture weights of the service ends.
In an embodiment of the present specification, the calculating unit 302 is configured to calculate a proportional relationship of the adjustment coefficients of the respective servers according to the weights of the respective servers in the previous allocation; the adjusting coefficient of the server is used for adjusting the parameter of the server; and calculating the return ratio of each server according to the proportional relation of the parameters and the adjustment coefficients of each server.
In one embodiment of the present description, the parameters include: the number of idle threads and the number of requests distributed in a preset time period;
a calculating unit 302, configured to calculate a thread return ratio of each server according to the number of idle threads of each server and a proportional relationship of the adjustment coefficients; calculating the flow return ratio of each service end according to the quantity of the requests distributed by each service end in a preset time period and the proportional relation of the adjustment coefficients; and calculating the returning occupation ratio of each server according to the thread returning occupation ratio and the flow returning occupation ratio of each server.
In one embodiment of the present description, the computing unit 302 is configured to determine a thread impact factor and a traffic impact factor; the thread influence factor is used for measuring the influence degree of the number of idle threads on the return ratio; the flow influence factor is used for measuring the influence degree of the quantity of the requests distributed in the preset time period on the return ratio; and calculating the returning occupation ratio of each server according to the thread returning occupation ratio of each server and the thread influence factor corresponding to the thread returning occupation ratio, and the flow returning occupation ratio of each server and the flow influence factor corresponding to the flow returning occupation ratio.
In an embodiment of the present specification, the determining unit 301 is configured to obtain parameters from each server and/or obtain parameters from a gateway.
An embodiment of the present specification provides a request distribution apparatus, including: a processor and a memory;
the memory is used for storing execution instructions, and the processor is used for executing the execution instructions stored by the memory to realize the method of any one of the above embodiments.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field programmable gate array (Field programmable GBte BrrBy, FPGB), is an integrated circuit whose Logic function is determined by the user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an integrated Circuit chip, such programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is written by a specific programming language, which is called hardware Description language (hbrdbre Description lbngage, HDL), and HDL is not only one kind but many kinds, such as BBEL (bdvbved boolean Expression lbngage), BHDL (blrdbre Description lbngage), confluence, CUPL (com University progress lbngage), HDCBl, jbdb hbrde Description lbngage, intvbb, HDL, pbm (hrbrwh), and lbbtjbtjbtl (lbbtjbte Description lbble), lbbtlbjbse, lbbtlbg, lbg, pbm, and lbg. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application Specific integrated circuits (BSICs), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: BRC 625D, btmel BT91SBM, microchip PIC18F26K20, and Silicone LBbs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random access memory (RBM) and/or non-volatile memory such as Read Only Memory (ROM) or flash memory (f 1Bsh RBM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRBM), static random access memory (SRBM), dynamic random access memory (DRBM), other types of random access memory (RBM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium (trbnvary medium) such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The use of the phrase "including a" does not exclude the presence of other, identical elements in the process, method, article, or apparatus that comprises the same element, whether or not the same element is present in all of the same element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims (15)

1. A request distribution method, comprising:
determining parameters of a plurality of service terminals;
determining the capture weight of each server; wherein, the capturing weight is the weight of the server participating in redistribution;
calculating the return weight of each server according to the parameters of each server and the weight of each server in the previous distribution; the returning weight is obtained by the server through redistribution, and the sum of the returning weights of the servers is equal to the sum of the capturing weights of the servers;
calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution;
and allocating a request to each server according to the weight of each server in the current allocation.
2. The method of claim 1, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
calculating the weight of each server in the current distribution according to the capturing weight and the returning weight of each server and the weight of each server in the previous distribution, wherein the weight comprises the following steps:
calculating the weight variation of the server according to the return weight and the capture weight of the server;
and calculating the weight of the server in the current distribution according to the weight variation of the server and the weight of the server in the previous distribution.
3. The method of claim 1, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
calculating the return weight of each server according to the parameters of each server and the weight of each server in the previous distribution, wherein the return weight of each server comprises the following steps:
calculating the returning ratio of each server according to the parameters of each server and the weight of each server in the previous distribution; the return duty ratio is used for measuring the duty ratio of the return weight of the server in the sum of the capture weights of the servers;
and calculating the returning weight of each service end according to the returning ratio and the capturing weight of each service end.
4. The method of claim 3, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
calculating a returning ratio of each server according to the parameters of each server and the weight of each server in the previous distribution, wherein the calculating comprises the following steps:
calculating the proportional relation of the adjustment coefficients of the service ends according to the weight of each service end in the previous distribution; the adjustment coefficient of the server is used for adjusting the parameters of the server;
and calculating the return ratio of each server according to the proportional relation between the parameters and the adjustment coefficients of each server.
5. The method of claim 4, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
the parameters include: the number of idle threads and the number of requests distributed in a preset time period;
calculating the return ratio of each server according to the proportional relation between the parameters and the adjustment coefficients of each server, wherein the calculation comprises the following steps:
calculating the thread return ratio of each server according to the number of idle threads of each server and the proportional relation of the adjustment coefficients;
calculating the flow return ratio of each service end according to the quantity of the requests distributed by each service end in a preset time period and the proportional relation of the adjustment coefficients;
and calculating the returning occupation ratio of each server according to the thread returning occupation ratio and the flow returning occupation ratio of each server.
6. The method of claim 5, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
calculating the returning occupation ratio of each server according to the thread returning occupation ratio and the flow returning occupation ratio of each server, wherein the calculating comprises the following steps:
determining a thread influence factor and a flow influence factor; the thread influence factor is used for measuring the influence degree of the number of idle threads on the return ratio; the flow influence factor is used for measuring the influence degree of the quantity of the requests distributed in a preset time period on the return ratio;
and calculating the returning occupation ratio of each server according to the thread returning occupation ratio of each server and the thread influence factor corresponding to the thread returning occupation ratio, and the flow returning occupation ratio of each server and the flow influence factor corresponding to the flow returning occupation ratio.
7. The method according to claim 1 to 6,
determining parameters of a plurality of service terminals, including: and acquiring the parameters from each server side and/or acquiring the parameters from a gateway.
8. A request distribution device, comprising:
the determining unit is configured to determine parameters of a plurality of service terminals; determining the capture weight of each server; wherein, the capturing weight is the weight of the server participating in redistribution;
the calculating unit is configured to calculate the return weight of each server according to the parameter of each server and the weight of each server in the previous distribution; calculating the weight of each service end in the current distribution according to the capturing weight and the returning weight of each service end and the weight of each service end in the previous distribution; the returning weight is obtained by the server through redistribution, and the sum of the returning weights of the servers is equal to the sum of the capturing weights of the servers;
and the distribution unit is configured to distribute the request for each server according to the weight of each server in the current distribution.
9. The apparatus as set forth in claim 8,
the calculating unit is configured to calculate the weight variation of the server according to the return weight and the capture weight of the server; and calculating the weight of the server in the current distribution according to the weight variable quantity of the server and the weight of the server in the previous distribution.
10. The apparatus as set forth in claim 8, wherein,
the calculating unit is configured to calculate a returning ratio of each server according to the parameter of each server and the weight of each server in the previous distribution; calculating the returning weight of each service end according to the returning ratio and the capturing weight of each service end; wherein the return proportion is used for measuring the proportion of the return weight of the server in the sum of the capture weights of the servers.
11. The apparatus as set forth in claim 10, wherein,
the calculating unit is configured to calculate a proportional relation of the adjustment coefficients of the service ends according to the weight of each service end in the previous distribution; the adjusting coefficient of the server is used for adjusting the parameter of the server; and calculating the return ratio of each server according to the proportional relation between the parameters and the adjustment coefficients of each server.
12. The apparatus as set forth in claim 11, wherein,
the parameters include: the number of idle threads and the number of the requests distributed in a preset time period;
the computing unit is configured to compute the thread return occupation ratio of each server according to the number of idle threads of each server and the proportional relation of the adjustment coefficients; calculating the flow returning ratio of each service end according to the quantity of the requests distributed by each service end in a preset time period and the proportional relation of the adjustment coefficients; and calculating the returning occupation ratio of each server according to the thread returning occupation ratio and the flow returning occupation ratio of each server.
13. The apparatus as set forth in claim 12,
the computing unit is configured to determine a thread influence factor and a flow influence factor; the thread influence factor is used for measuring the influence degree of the number of idle threads on the return ratio; the flow influence factor is used for measuring the influence degree of the quantity of the requests distributed in a preset time period on the return ratio; and calculating the returning occupation ratio of each server according to the thread returning occupation ratio of each server and the thread influence factor corresponding to the thread returning occupation ratio, and the flow returning occupation ratio of each server and the flow influence factor corresponding to the flow returning occupation ratio.
14. The apparatus of any one of claims 8-13,
the determining unit is configured to obtain the parameters from each of the servers, and/or obtain the parameters from a gateway.
15. A request distribution device comprising: a processor and a memory;
the memory is configured to store execution instructions, and the processor is configured to execute the execution instructions stored by the memory to implement the method of any of claims 1-7.
CN201911169271.9A 2019-11-25 2019-11-25 Request distribution method, device and equipment Active CN111090516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911169271.9A CN111090516B (en) 2019-11-25 2019-11-25 Request distribution method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911169271.9A CN111090516B (en) 2019-11-25 2019-11-25 Request distribution method, device and equipment

Publications (2)

Publication Number Publication Date
CN111090516A CN111090516A (en) 2020-05-01
CN111090516B true CN111090516B (en) 2023-03-31

Family

ID=70393839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911169271.9A Active CN111090516B (en) 2019-11-25 2019-11-25 Request distribution method, device and equipment

Country Status (1)

Country Link
CN (1) CN111090516B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9116752B1 (en) * 2009-03-25 2015-08-25 8X8, Inc. Systems, methods, devices and arrangements for server load distribution
CN106959894A (en) * 2016-01-11 2017-07-18 北京京东尚科信息技术有限公司 Resource allocation methods and device
CN108845876A (en) * 2018-04-09 2018-11-20 阿里巴巴集团控股有限公司 A kind of method and device of traffic assignments
CN109117279A (en) * 2018-06-29 2019-01-01 Oppo(重庆)智能科技有限公司 The method that is communicated between electronic device and its limiting process, storage medium
CN109254845A (en) * 2018-07-27 2019-01-22 苏州橘猫网络科技有限公司 A kind of linear expansion implementation method calculating server-side applied to distributed communication

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070143460A1 (en) * 2005-12-19 2007-06-21 International Business Machines Corporation Load-balancing metrics for adaptive dispatching of long asynchronous network requests

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9116752B1 (en) * 2009-03-25 2015-08-25 8X8, Inc. Systems, methods, devices and arrangements for server load distribution
CN106959894A (en) * 2016-01-11 2017-07-18 北京京东尚科信息技术有限公司 Resource allocation methods and device
CN108845876A (en) * 2018-04-09 2018-11-20 阿里巴巴集团控股有限公司 A kind of method and device of traffic assignments
CN109117279A (en) * 2018-06-29 2019-01-01 Oppo(重庆)智能科技有限公司 The method that is communicated between electronic device and its limiting process, storage medium
CN109254845A (en) * 2018-07-27 2019-01-22 苏州橘猫网络科技有限公司 A kind of linear expansion implementation method calculating server-side applied to distributed communication

Also Published As

Publication number Publication date
CN111090516A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN109005125B (en) Dynamic current limiting method, device and system
CN107577523B (en) Task execution method and device
CN109391680B (en) Timed task data processing method, device and system
CN117076453A (en) Batch task processing method, device and equipment
CN107578338B (en) Service publishing method, device and equipment
CN109739627B (en) Task scheduling method, electronic device and medium
CN107291720B (en) Method, system and computer cluster for realizing batch data processing
CN110635962B (en) Abnormity analysis method and device for distributed system
CN114416360A (en) Resource allocation method and device and Internet of things system
CN116225669B (en) Task execution method and device, storage medium and electronic equipment
CN111177984B (en) Resource utilization of heterogeneous computing units in electronic design automation
CN110245978B (en) Method and device for evaluating and selecting policies in policy group
CN110276637B (en) Resource allocation method and device, and coupon allocation method and device
CN111090516B (en) Request distribution method, device and equipment
CN110008386B (en) Data generation, processing and evaluation method, device, equipment and medium
CN116304212A (en) Data processing system, method, equipment and storage medium
CN115729714A (en) Resource allocation method, device, storage medium and electronic equipment
CN116384505A (en) Data processing method and device, storage medium and electronic equipment
CN110008112B (en) Model training method and device, service testing method and device
CN108921375A (en) A kind of data processing method and device
CN110019187A (en) A kind of data distributing method, device and equipment
CN110009237B (en) Resource allocation method, device, equipment and medium
CN109614388B (en) Budget deduction method and device
CN107645541B (en) Data storage method and device and server
CN109615234B (en) Resource change condition determining method and device

Legal Events

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

Effective date of registration: 20240228

Address after: Room 1408, No. 447 Nanquan North Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Patentee after: Shanghai Ant Chuangjiang Information Technology Co.,Ltd.

Country or region after: China

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee before: Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right