CN116382900A - Load balancing processing method, device, equipment, medium and computer program product - Google Patents

Load balancing processing method, device, equipment, medium and computer program product Download PDF

Info

Publication number
CN116382900A
CN116382900A CN202310299128.1A CN202310299128A CN116382900A CN 116382900 A CN116382900 A CN 116382900A CN 202310299128 A CN202310299128 A CN 202310299128A CN 116382900 A CN116382900 A CN 116382900A
Authority
CN
China
Prior art keywords
request
resource consumption
processing resource
processed
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310299128.1A
Other languages
Chinese (zh)
Inventor
张宏根
胡凯乐
刘金凤
雷琼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310299128.1A priority Critical patent/CN116382900A/en
Publication of CN116382900A publication Critical patent/CN116382900A/en
Pending legal-status Critical Current

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
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • 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/5083Techniques for rebalancing the load in a distributed system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application relates to a load balancing processing method, a device, equipment, a medium and a program product, and relates to the field of big data. The method and the device can improve the balance of each server to the service of each request and the accuracy and convenience of request grouping. The method comprises the following steps: in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption grouping is detected and the construction condition is met, triggering the construction processing of the corresponding relation, and constructing the corresponding relation based on the processing resource consumption information of each processed historical request and a plurality of processing resource consumption groupings; for a received request to be processed, determining a target packet to which the request to be processed belongs from a plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to a target group in respective current connection information sets of each server; and determining a server for processing the pending request in each server according to the current connection information of each server.

Description

Load balancing processing method, device, equipment, medium and computer program product
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a load balancing processing method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
Load balancing (loadbalancing) is a technology for uniformly distributing resources among multiple computer devices to improve resource utilization, and the use of load balancing can maximize service throughput and minimize response time, and simultaneously, multiple server nodes can be used for replacing single-point service, so that service availability is improved. In the load balancing algorithm, the minimum connection number algorithm is used for judging according to the number of the current requests of each server, and forwarding the requests to the server with the minimum current processing task number.
However, regarding the minimum connection number load balancing processing scheme provided by the prior art, the inventor finds that each pending request reaching the load balancing device is equally distributed to each server, and this causes abnormal situations such as that a part of servers trigger QPS (query per second) current limiting or CPU usage rate is high, and there is a problem that the uniformity of services of each server to each pending request is insufficient.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a load balancing processing method, apparatus, computer device, storage medium, and computer program product.
In a first aspect, the present application provides a load balancing processing method. The method comprises the following steps:
in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption group is detected and the construction condition of the corresponding relation is met, triggering the construction processing of the corresponding relation;
according to the construction processing of the corresponding relation, the corresponding relation between the request and the processing resource consumption grouping is constructed and obtained based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings;
for the received request to be processed, determining a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed corresponding relation;
acquiring current connection information corresponding to the target group in respective current connection information sets of each server;
and determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
In one embodiment, the triggering the construction process of the corresponding relationship if the corresponding relationship between the non-constructed request and the processing resource consumption packet is detected and the construction condition of the corresponding relationship is satisfied includes: if the corresponding relation between the unstructured request and the processing resource consumption packet is detected, determining the number of each processed historical request; and if the number of the processed historical requests reaches a construction number threshold, triggering construction processing of the corresponding relation.
In one embodiment, the method further comprises: and if the number of the processed historical requests does not reach the construction number threshold, determining a server for processing the request to be processed in each server according to the current connection information of each server for the received request to be processed.
In one embodiment, before the building the corresponding relationship between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance, the method further includes: obtaining corresponding processing resource consumption distribution information according to the respective processing resource consumption information of each history request; and determining a partition interval of the processing resource consumption groups according to the corresponding processing resource consumption distribution information, and dividing a plurality of processing resource consumption groups in the partition interval so as to balance the number of history requests contained in each processing resource consumption group.
In one embodiment, before the building the corresponding relationship between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance, the method further includes: determining first processing resource consumption information representing minimum processing resource consumption according to the respective processing resource consumption information of each history request, and attributing the history request with the first processing resource consumption information to a processing resource consumption group with a starting group number; and for each other history request in the history requests, attributing the other history request to a processing resource consumption packet with a packet number corresponding to the ratio according to the ratio of the second processing resource consumption information and the first processing resource consumption information of the other history request.
In one embodiment, before the corresponding relationship between the request and the processing resource consumption packet is constructed based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance, the method further includes: acquiring the time consumption of each request execution of each history request; and obtaining the respective processing resource consumption information of each history request according to the time consumption of the respective request execution of each history request.
In one embodiment, the constructing, based on the processed respective processing resource consumption information of each history request and the plurality of processing resource consumption packets created in advance, a corresponding relationship between the request and the processing resource consumption packet includes: determining respective request characteristic identification information of each history request, and determining respective packet identification information of each of the plurality of processing resource consumption packets; and constructing the corresponding relation by utilizing the request characteristic identification information of each history request and the packet identification information of each processing resource consumption packet based on the processing resource consumption information of each history request and the pre-established processing resource consumption packets.
In one embodiment, after the correspondence between the request and the processing resource consumption packet is constructed, the method further includes: updating the corresponding relation according to the processed historical requests and the processed new requests according to a preset time period; or if the number of the processed new requests is detected to reach the update number threshold, updating the corresponding relation according to each processed new request.
In one embodiment, the method further comprises: if the received request to be processed is a mismatched request in the processing resource consumption groups, attributing the request to be processed to a preset processing resource consumption group in the processing resource consumption groups, or attributing the request to be processed to a processing resource consumption group in the processing resource consumption groups randomly, or attributing the request to be processed to an added processing resource consumption group; the method further comprises the steps of: if the target packet of the to-be-processed request is an added processing resource consumption packet, determining a server for processing the to-be-processed request in each server according to current connection information corresponding to the added processing resource consumption packet in respective current connection information sets of each server.
In a second aspect, the present application further provides a load balancing processing apparatus. The device comprises:
the construction triggering module is used for triggering construction processing of the corresponding relation if the corresponding relation between the unstructured request and the processing resource consumption grouping is detected and the construction condition of the corresponding relation is met in the processing of the request;
The relation construction module is used for constructing and obtaining the corresponding relation between the requests and the processing resource consumption groups based on the processed respective processing resource consumption information of each history request and the pre-established multiple processing resource consumption groups according to the construction processing of the corresponding relation;
the grouping determining module is used for determining a target grouping to which the to-be-processed request belongs from the plurality of processing resource consumption groupings according to the constructed corresponding relation for the received to-be-processed request;
the connection acquisition module is used for acquiring current connection information corresponding to the target group in the current connection information set of each server;
and the server determining module is used for determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption group is detected and the construction condition of the corresponding relation is met, triggering the construction processing of the corresponding relation; according to the construction processing of the corresponding relation, the corresponding relation between the request and the processing resource consumption grouping is constructed and obtained based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings; for the received request to be processed, determining a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to the target group in respective current connection information sets of each server; and determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption group is detected and the construction condition of the corresponding relation is met, triggering the construction processing of the corresponding relation; according to the construction processing of the corresponding relation, the corresponding relation between the request and the processing resource consumption grouping is constructed and obtained based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings; for the received request to be processed, determining a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to the target group in respective current connection information sets of each server; and determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption group is detected and the construction condition of the corresponding relation is met, triggering the construction processing of the corresponding relation; according to the construction processing of the corresponding relation, the corresponding relation between the request and the processing resource consumption grouping is constructed and obtained based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings; for the received request to be processed, determining a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to the target group in respective current connection information sets of each server; and determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
In the load balancing processing method, the device, the equipment, the storage medium and the program product, if the corresponding relation between the unstructured request and the processing resource consumption packet is detected and the construction condition of the corresponding relation is met in the request processing, triggering the construction processing of the corresponding relation; constructing and obtaining the corresponding relation between the request and the processing resource consumption grouping based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings according to the construction processing of the corresponding relation; for a received request to be processed, determining a target packet to which the request to be processed belongs from a plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to a target group in respective current connection information sets of each server; and determining a server for processing the pending request in each server according to the current connection information of each server. The scheme can be implemented in the process of the request, and the construction process of the corresponding relation can be triggered under the condition that the corresponding relation between the request and the processing resource consumption grouping is not constructed and the construction condition of the corresponding relation is met, wherein the corresponding relation between the request and the processing resource consumption grouping can be accurately established in real time according to the processed actual processing resource consumption information of each historical request, the received request to be processed can be attributed to the corresponding grouping based on the corresponding relation, and then the server for processing the request to be processed in each server can be determined according to the respective current connection information of each server corresponding to the grouping to which the request to be processed belongs, so that the requests needing to consume different resources can be uniformly distributed to each server, the service performance of each server to each request can be balanced, the service performance of each server can be provided for the outside, the service balance of each server to each request can be improved, the corresponding relation between the request and the processing resource consumption grouping can be accurately established according to the actual processing resource consumption information of each historical request, and the accuracy and convenience of the request grouping can be improved.
Drawings
Fig. 1 is an application environment diagram of a load balancing processing method in an embodiment of the present application;
FIG. 2 is a schematic diagram for aiding in the explanation of the problems in the prior art;
fig. 3 is a flow chart of a load balancing processing method in an embodiment of the present application;
fig. 4 is a flow chart of a process of triggering the establishment of the correspondence in the embodiment of the present application;
FIG. 5 (a) is a flow chart illustrating the partitioning of multiple processing resource consumption packets according to one embodiment of the present application;
FIG. 5 (b) is a flow chart illustrating the partitioning of multiple processing resource consumption packets according to another embodiment of the present application;
fig. 6 is a block diagram of a load balancing processing apparatus according to an embodiment of the present application;
fig. 7 is an internal structural diagram of a computer device in the embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The load balancing processing method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. The terminal, the load balancing device and the servers can be connected through the network in sequence. The terminal can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things equipment and portable wearable equipment, and the internet of things equipment can be smart speakers, smart televisions, smart air conditioners, smart vehicle-mounted equipment and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. Each server may be implemented as a separate server or as a server cluster composed of a plurality of servers.
In order to clearly illustrate the load balancing processing method and the technical effects achieved by the load balancing processing method, a minimum connection number load balancing processing scheme provided in the prior art and the technical problems thereof are described with reference to fig. 2. One premise underlying the minimum connection number load balancing policy is that all pending requests arriving at the server through the load balancing device are basically equivalent, for example, processing resources required to be consumed by the server (or processing resources required to occupy the server) are basically equivalent in terms of execution time and the like, but in actual production operation, requests provided by each server for the outside are generally not equivalent in terms of service performance, so that the execution time of the requests is time consuming, the simple request time consuming may be several milliseconds, the complex request time consuming may be several hundred milliseconds or even several thousand milliseconds, and the order of each request arriving at the load balancing device is not fixed, so that it is difficult to ensure the equality of the requests QPS arriving at the server from the time consuming execution of the requests, as shown in fig. 2, the server 1 may be allocated light-weight requests more, process more requests in unit time, and then trigger QPS current limit alarm preferentially, while the server 2 may be allocated weight requests more, process more requests with higher consumption of resources at the same time, resulting in high CPU usage of the requests, the fact that the CPU may trigger the QPS part or the current limit alarm rate is not high, the quality of service is not monitored, and the current problem of waiting for the service is not triggered. In this regard, the load balancing processing method provided by the present application may be implemented in the processing of the request by the load balancing device, where the load balancing device may trigger the construction processing of the corresponding relation when detecting that the corresponding relation between the request and the processing resource consumption packet is not constructed and the construction condition of the corresponding relation has been satisfied, in the construction processing of the corresponding relation, the load balancing device may accurately establish the corresponding relation between the request and the processing resource consumption packet in real time according to the processed current connection information of each historical request, based on this, the load balancing device may attribute the received request to be processed to the corresponding packet, and then may determine the server for processing the request in each server according to the respective current connection information corresponding to the packet to which the request to be processed belongs, that is, the load balancing processing method provided by the present application may divide the request to the corresponding packet of the processing resource required by the request and perform load balancing control in the corresponding packet according to the minimum connection number, thereby being able to allocate the different connection information to the corresponding connection information corresponding to each server to the current connection information corresponding to each corresponding to the packet, and thus providing the request with a higher performance of the current connection information to the various requests to the various servers, thereby further solve the problems of the performance requirements of the request being more stable, and the performance of the present application can be automatically established to the request to the various requests in a higher performance than the actual performance of the request can be balanced, and the accuracy and convenience of the request packet are improved.
The load balancing processing method provided by the application is further described below with reference to various embodiments and corresponding drawings.
In one embodiment, as shown in fig. 3, a load balancing processing method is provided, which may be performed by a load balancing device as shown in fig. 1, and may include the steps of:
in step S301, in the processing of the request, if it is detected that the correspondence between the request and the processing resource consumption packet is not established and the establishment condition of the correspondence is satisfied, the establishment processing of the correspondence is triggered.
Step S302, according to the construction process of the correspondence, the correspondence between the request and the processing resource consumption packet is constructed based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance.
Step S303, for the received request to be processed, determining a target packet to which the request to be processed belongs from a plurality of processing resource consumption packets according to the constructed corresponding relation.
Step S304, current connection information corresponding to the target group in the current connection information sets of the servers is obtained.
Step S305, determining a server for processing the pending request from the servers according to the current connection information of each server.
The load balancing processing method of the present embodiment may be divided into two parts, where the steps S301 and S302 form a first part, and the steps S303 to S305 form a second part, and the first part mainly refers to construction processing of a correspondence relation between a request and a processing resource consumption packet, and the second part mainly refers to processing of a received request to be processed based on the constructed correspondence relation. In the first part, the method and the device can automatically and accurately establish the corresponding relation between the request and the processing resource consumption grouping in real time according to the actual processing resource consumption information of each processed historical request, and in the second part, the received request to be processed can be attributed to the corresponding grouping based on the corresponding relation, and then the server for processing the request to be processed in each server is determined according to the current connection information corresponding to the grouping to which the request to be processed belongs, so that the service balance of each server to each request can be improved, and the accuracy and convenience of the grouping of the request are improved.
Specifically, for step S301, the load balancing device may receive requests from the terminal, and these requests may be used as requests to be processed, where the requests to be processed are forwarded to the server for processing in a certain manner in a subsequent step. The request to be processed may be a request for processing a corresponding service in the related art, for example, in the field of financial technology, the request to be processed may be a transaction request, etc., according to the difference in the related art. When a request to be processed arrives, the load balancing device may detect whether a corresponding relationship between the request and the processing resource consumption packet has been constructed, where the information included in the corresponding relationship between the request and the processing resource consumption packet may include a corresponding relationship between each request that has been processed by the load balancing device and the processing resource consumption packet corresponding thereto, where the corresponding relationship is used in the present application to group the request to be processed received by the load balancing device and then forward the request to a corresponding server according to related information of the group to process the request, and if the load balancing device detects that the corresponding relationship has been constructed, steps S303 to S305 as described above, that is, the second part of content, where the part of content will be described in detail in a subsequent paragraph, may be executed; if the load balancing device detects that the corresponding relation is not constructed, the load balancing device may trigger construction processing of the corresponding relation when judging that the construction condition of the corresponding relation is currently met, where the construction condition of the corresponding relation may be a time-related condition or a quantity-related condition, and for the time-and quantity-related condition, an exemplary case may trigger when the accumulated duration of processing requests by the load balancing device reaches a certain duration threshold, or trigger when the quantity of requests processed by the load balancing device reaches a certain quantity threshold.
After triggering the construction process of the correspondence, in step S302, according to the construction process of the correspondence, the load balancing device may construct and obtain the correspondence between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance. In the case of triggering the construction process of the corresponding relationship, the load balancing device already processes some requests, and the processed requests are recorded as processed history requests, and the number of the processed history requests is a plurality of; and the processing resource consumption information can be quantization information used for representing the processing resource consumed by the server required by the corresponding request, such as CPU utilization rate, time consumption of request execution and the like, and the processing resource consumption information of each historical request can be counted or recorded when the load balancing device processes the processing resource consumption information; a plurality of processing resource consumption groups may be created in advance, for example, manually, and may correspond to different processing resource consumption information, such as may be time consuming for different requests to be performed, or time consuming for different ranges of requests to be performed, so that the processing resource consumption information of the historical requests may be categorized into the corresponding processing resource consumption groups. Thus, for the construction of the correspondence in step S302, specifically, according to the construction process of the correspondence, the load balancing device may obtain the respective processing resource consumption information of each history request, determine, according to the respective processing resource consumption information of each history request, a packet corresponding to each history request in the plurality of processing resource consumption packets created in advance, and then construct the correspondence according to each history request and its corresponding packet. In addition, if the corresponding relation is pre-configured under a specific environment and then used in the actual environment, the load balancing equipment can possibly have very many requests required to be processed, so that the allocation and configuration are time and labor consuming for each request, the grouping setting between different requests needs to be relatively accurate, the situation of the equipment can only be simulated as much as possible under the specific environment, and the equipment condition is difficult to completely target the actual environment, so that certain errors can exist, the step can also solve the problems of complicated configuration and error existing in the complicated configuration, and the implementation complexity and the implementation cost are reduced.
Based on this, in the second portion, if the load balancing device has constructed the correspondence, for the received pending request, the load balancing device may determine, first, a target packet to which the pending request belongs, and then determine, according to current connection information corresponding to the target packet to which the pending request belongs, each server, a server for processing the pending request from among the servers, so as to complete forwarding processing of the pending request.
Specifically, in step S303, the target packet to which the received pending request belongs is determined from the multiple processing resource consumption packets according to the constructed correspondence, in this application, the load balancing device needs to perform grouping on the pending request and then forward the pending request to the corresponding server according to the relevant information of the grouping to perform processing, where the grouping does not need to divide the pending request into a certain group, but only needs to determine the target packet to which the pending request belongs, for example, the load balancing device determines that the pending request a belongs to the group 1 or the group 3. Specifically, in this step, the basis of the grouping is that the processing resource consumed by the server is required by the request to be processed, and the corresponding relationship between the request and the processing resource consumption grouping has been constructed in the foregoing step, and the corresponding relationship may be stored in the load balancing device, so that when the load balancing device receives the request to be processed, the load balancing device may find, according to the corresponding relationship, the processing resource consumption grouping to which the request to be processed belongs from the foregoing multiple processing resource consumption groupings, where the processing resource consumption grouping to which the request to be processed belongs is the target grouping.
After determining the target packet, in step S304, the load balancing device may maintain information including the respective current connection information sets of the servers, which is called a current connection information set, because for each server, for each processing resource consumption packet, corresponding current connection information may be generated, such as the current connection number, etc., for example, the current connection information set of the server 1 may include the corresponding current connection number of the processing resource consumption packet 1, the corresponding current connection number of the processing resource consumption packet 2, etc., the current connection information corresponding to the server 1 in different processing resource consumption packets may form the current connection information set of the server 1, and the current connection information corresponding to the server 1 in different processing resource consumption packets may be different, so that each server may provide the corresponding connection number for each processing resource consumption packet as a basis for load balancing processing, so, after determining the target packet to which the request to be processed belongs, the load balancing device may obtain, according to the locally maintained information, the current connection information corresponding to the target packet in the respective current connection information set of the servers.
After obtaining the current connection information of each server, in step S305, a server for processing the pending request in each server is determined according to the current connection information. Specifically, in this step, for each packet, the to-be-processed request in the group may be forwarded in the same manner, and in this application, for the to-be-processed request belonging to the target packet, the load balancing device may determine, according to current connection information corresponding to the target packet, a server for processing the to-be-processed request in each server, where in a specific implementation, the load balancing device may determine, according to the current connection number corresponding to the target packet in each server, a server with the smallest current connection number in each server as a server for processing the to-be-processed request, and forward the to-be-processed request, and may update current connection information corresponding to the target packet, where after the server responds or times out, the server may update current connection information corresponding to the target packet, such as a clear-related count.
In the load balancing processing method of the embodiment, if the corresponding relation between the unstructured request and the processing resource consumption packet is detected and the construction condition of the corresponding relation is satisfied in the processing of the request, the construction processing of the corresponding relation is triggered; constructing and obtaining the corresponding relation between the request and the processing resource consumption grouping based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings according to the construction processing of the corresponding relation; for a received request to be processed, determining a target packet to which the request to be processed belongs from a plurality of processing resource consumption packets according to the constructed corresponding relation; acquiring current connection information corresponding to a target group in respective current connection information sets of each server; and determining a server for processing the pending request in each server according to the current connection information of each server. The scheme can be implemented in the process of the request, and the construction process of the corresponding relation can be triggered under the condition that the corresponding relation between the request and the processing resource consumption grouping is not constructed and the construction condition of the corresponding relation is met, wherein the corresponding relation between the request and the processing resource consumption grouping can be accurately established in real time according to the processed actual processing resource consumption information of each historical request, the received request to be processed can be attributed to the corresponding grouping based on the corresponding relation, and then the server for processing the request to be processed in each server can be determined according to the respective current connection information of each server corresponding to the grouping to which the request to be processed belongs, so that the requests needing to consume different resources can be uniformly distributed to each server, the service performance of each server to each request can be balanced, the service performance of each server can be provided for the outside, the service balance of each server to each request can be improved, the corresponding relation between the request and the processing resource consumption grouping can be accurately established according to the actual processing resource consumption information of each historical request, and the accuracy and convenience of the request grouping can be improved.
For triggering the construction process of the correspondence, in some embodiments, as shown in fig. 4, if it is detected in step S301 that the correspondence between the unstructured request and the processing resource consumption packet is not constructed and the construction condition of the correspondence is satisfied, triggering the construction process of the correspondence specifically includes:
in step S401, if the correspondence between the unstructured request and the processing resource consumption packet is detected, the number of processed history requests is determined.
In step S402, if the number of the processed history requests reaches the construction number threshold, the construction process of the correspondence is triggered.
In this embodiment, after the load balancing device detects the correspondence between the unstructured request and the processing resource consumption packet, the number of the processed history requests is further determined, and whether to trigger the construction processing of the correspondence is determined according to the number of the processed history requests. In step S401, when detecting the correspondence between the unstructured request and the processing resource consumption packet, the load balancing device may acquire the number of history requests processed by the load balancing device, and the starting time may be the number of history requests processed after the load balancing device is put into operation, and then determine whether the number of history requests processed reaches a construction number threshold, where the construction number threshold is a threshold for indicating the number of history requests that should be processed by the load balancing device to satisfy the construction requirement of the correspondence, and the threshold may be preset by a relevant person. In step S402, if the number of the history requests processed by the load balancing device reaches the construction number threshold, which indicates that the construction requirement of the correspondence has been satisfied, the construction process of the correspondence is triggered.
In the scheme of the embodiment, when the number of the processed history requests reaches a certain threshold, the corresponding relationship is constructed, and compared with the scheme of triggering the corresponding relationship construction according to the time related information such as the processing duration, the method can substantially accumulate a sufficient number of history requests to construct the corresponding relationship, and more types of requests are more likely to be included in the corresponding relationship construction, so that the constructed corresponding relationship can be more accurate and reliable and has wider applicability.
Further, in some embodiments, the method of the present application may thus further comprise the steps of:
if the number of the processed historical requests does not reach the construction number threshold, determining a server for processing the request to be processed in each server according to the current connection information of each server for the received request to be processed.
Specifically, in the case that the corresponding relationship is not yet constructed but the number of the processed history requests does not yet reach the construction number threshold, the load balancing device cannot temporarily group the received requests to be processed, and this embodiment determines, according to the current connection information of each server, a server for processing the requests to be processed in each server, where the current connection information may be the current connection number, that is, in a specific implementation, the load balancing device may directly process the requests to be processed in this case by using the minimum connection number algorithm, and may record the processing resource consumption information of the requests to be processed, so that the processed history requests and the processing resource consumption information thereof may be continuously accumulated on the premise of maintaining forwarding the requests to be processed, and the construction processing of the corresponding relationship is accurate.
The aforementioned plurality of processing resource consumption groups may be created automatically by a computer device such as a load balancing device, in addition to being created manually.
In one embodiment, as shown in fig. 5 (a), before constructing the correspondence relationship between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance in step S302, the method may further include the steps of:
step S511, obtaining corresponding processing resource consumption distribution information according to the processing resource consumption information of each history request.
Step S512, determining a partition interval of the processing resource consumption groups according to the corresponding processing resource consumption distribution information, and dividing a plurality of processing resource consumption groups in the partition interval to balance the number of history requests contained in each processing resource consumption group.
In this embodiment, a plurality of processing resource consumption packets are divided in corresponding division intervals according to the processing resource consumption distribution information, so that the number of history requests included in each processing resource consumption packet is balanced. Taking the request execution time as the processing resource consumption information as an example, in step S511, the corresponding processing resource consumption distribution information, which is the distribution information of the corresponding request execution time, is obtained according to the respective request execution time of each history request, the distribution information of the request execution time may include the distribution information of the request execution time of all history requests in a time interval (e.g., 0 to 100 ms) capable of enclosing the request execution time of all history requests, so that in step S512, a partition interval of the processing resource consumption packet is determined according to the distribution information of the request execution time, the partition interval needs to be capable of enclosing the request execution time of all history requests, e.g., the partition interval may include 0 to 100 ms, and then a plurality of processing resource consumption packets are partitioned in the partition interval, so that the number of history requests included in each processing resource consumption packet is balanced, e.g., 0 to 10 ms are partitioned into one processing resource consumption packet, 10 to 30 ms are partitioned into one processing resource consumption packet, 30 to 60 ms are partitioned into one processing resource consumption packet, etc., so that the number of processing resource consumption packets included in each processing resource consumption packet is substantially equal to the number of the history requests included in each processing resource consumption packet can be included in the partition interval, so that the number of the history requests can be substantially equal to provide the service.
In another embodiment, as shown in fig. 5 (b), before constructing the correspondence between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance in step S302, the method may further include the following steps:
step S521, determining first processing resource consumption information representing the minimum processing resource consumption according to the respective processing resource consumption information of each history request, and attributing the history request with the first processing resource consumption information to the processing resource consumption packet with the start packet number.
Step S522, for each other history request in the history requests, attributing the other history request to the processing resource consumption packet having the packet number corresponding to the ratio according to the ratio of the second processing resource consumption information to the first processing resource consumption information of the other history request.
The method mainly comprises the steps of firstly determining that a history request with first processing resource consumption information representing minimum processing resource consumption belongs to a processing resource consumption packet with a starting packet number, and then automatically grouping other history requests according to related ratio information of second processing resource consumption information of the other history requests. Specifically, as described above, the processing resource consumption information may be quantization information for characterizing the processing resource consumed by the server required for the request, and the corresponding packet number may be conveniently formed based on the ratio of the processing resource consumption information for each history request, so that each history request can be conveniently grouped. Taking the request execution time as the processing resource consumption information still as an example, in step S521, a minimum request execution time may be determined according to the respective request execution time of each history request, and then the history request with the minimum request execution time may be attributed to the processing resource consumption packet with a start packet number, which may be set to 1 for the convenience of the packet. Then, in step S522, for each other history request in the history requests, the other history requests may include history requests that have not completed the grouping, and for each other history request, the request execution time of the other history request may be compared with the minimum request execution time to obtain a corresponding ratio, that is, the ratio of the second processing resource consumption information to the first processing resource consumption information of the other history request, which should be greater than 1, so that a corresponding ratio of each other history request may be obtained, then a corresponding packet number may be calculated according to the ratio, specifically, the ratio may be rounded up or down or rounded up to obtain a corresponding packet number, and then each other history request may be attributed to a processing resource consumption packet having its corresponding packet number, so that each history request may be conveniently grouped.
For the processing resource consumption information, in some embodiments, before constructing the corresponding relationship between the request and the processing resource consumption packet based on the processed respective processing resource consumption information of each history request and the plurality of processing resource consumption packets created in advance in step S302, the method further includes the steps of:
acquiring the time consumption of each request execution of each history request; and executing time consumption according to the respective request of each history request to obtain the respective processing resource consumption information of each history request.
In the embodiment, mainly in the construction of the correspondence, the time consumption of executing each history request can be obtained according to the respective request of each history request, so as to obtain the respective processing resource consumption information of each history request. Specifically, for each history request, the time consumption of the request execution (may also be an average value of the time consumption of the request execution) may be obtained, the time consumption of the request execution may be information for indicating the time consumption required by the server to execute the request, the starting time and the ending time of the time consumption of the request execution may be preset, for example, the time sent to the server may be set as the starting time, the time when the response of the server is received as the ending time, and the like, and the foregoing correspondence relationship may be accurately constructed by uniformly setting the starting time and the ending time of the time consumption of the request execution. After obtaining the respective request execution time consumption of each history request, the respective request execution time consumption of each history request can be used as the respective processing resource consumption information of each history request, and compared with parameter information such as CPU utilization rate, the embodiment selects the request execution time consumption as the processing resource consumption information, has higher operability, and can accurately measure the processing resource consumed by the server required by each request.
For the building of the correspondence, as an embodiment, the building of the correspondence between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance in step S302 may include:
determining respective request characteristic identification information of each history request, and determining respective packet identification information of a plurality of processing resource consumption packets; based on the respective processing resource consumption information of each history request and the plurality of processing resource consumption groups created in advance, a corresponding relation is constructed by utilizing the respective request characteristic identification information of each history request and the respective group identification information of the plurality of processing resource consumption groups.
In this embodiment, a corresponding relationship between a request and a processing resource consumption packet may be constructed by using request feature identification information of a history request and packet identification information of a corresponding packet, where the request feature identification information may be a URL (uniform resource locator) corresponding to the request, or may be more refined feature identification information to distinguish more requests, for example, one or more parameters included in the URL are used as request feature identification information, etc., the packet identification information is identification information for characterizing each processing resource consumption packet and distinguishing it from other processing resource consumption packets, and the packet expression information may be a manually set packet number, etc., so that a corresponding relationship may be constructed by using the request feature identification information and the packet identification information according to each history request and its corresponding packet, and each request feature identification information and its corresponding packet identification information may be recorded in the corresponding relationship, so as to implement correspondence between each request and its corresponding packet.
For the update process after the correspondence is constructed, as some possible embodiments, after the correspondence between the request and the processing resource consumption packet is constructed, the method of the present application may further include the following steps:
updating the corresponding relation according to the processed historical requests and the processed new requests according to a preset time period; or if the number of the processed new requests is detected to reach the update number threshold, updating the corresponding relation according to each processed new request.
In this embodiment, the correspondence may be dynamically updated by the load balancing device, that is, in the application process of the correspondence, when a certain condition is met, the load balancing device may update the correspondence to dynamically adapt to the current environment, so as to avoid uncertainty and variability of factors such as execution time consumption in an environment where the server may depend on a third party service during operation. Specifically, the load balancing device may update the corresponding relationship according to a certain time period, and in a preset time period, the load balancing device may also continuously process new requests, and for the history requests, these new requests may be referred to as processed new requests, so as to continuously accumulate the number of the processed requests, and when the preset time period is reached, the load balancing device may update the corresponding relationship according to the processed history requests and the new requests. As another updating manner, the load balancing device may also continuously count the number of the processed new requests, and update the corresponding relationship according to each processed new request when detecting that the number of the processed new requests reaches an update number threshold, where the update number threshold is a threshold for indicating the number of new requests that should be processed by the load balancing device to satisfy the update requirement of the corresponding relationship, and the threshold may be preset by a relevant person, and when reaching the update number threshold, the load balancing device may update the corresponding relationship directly according to each processed new request, so that the data volume according to which the corresponding relationship is updated can be reduced, so that the corresponding relationship is updated more quickly to adapt to the current environment.
For the packet and forwarding processing of the request to be processed by the load balancing device in practical application, in some embodiments, the method of the present application may further include the following steps:
and if the received request to be processed is a mismatched request in the plurality of processing resource consumption groups, attributing the request to be processed to a preset processing resource consumption group in the plurality of processing resource consumption groups, or attributing the request to be processed to a processing resource consumption group in the plurality of processing resource consumption groups at random, or attributing the request to be processed to an added processing resource consumption group.
Specifically, in practical application, after the correspondence is constructed, when the load balancing device receives a request to be processed, the load balancing device determines a target packet to which the request belongs from a plurality of processing resource consumption packets, but the load balancing device may not be able to successfully match the request to be processed with the target packet to which the request belongs from the processing resource consumption packets, where the request to be processed is a request mismatched from the plurality of processing resource consumption packets.
The first method is that the request to be processed can be assigned to one of the processing resource consumption groups, such as the group corresponding to the smallest processing resource consumption, and then forwarded to the corresponding server for processing according to the minimum connection number method.
The second is that the pending request may be randomly assigned to a processing resource consumption packet of the plurality of processing resource consumption packets, i.e. the pending request may be randomly assigned to one of the groups, and may be forwarded in the group according to the minimum number of connections.
And thirdly, attributing the to-be-processed request to an added processing resource consumption packet, namely, the load balancing device can add one processing resource consumption packet to accommodate the mismatched request on the basis of a plurality of processing resource consumption packets, and then, the target packet of the to-be-processed request is the added processing resource consumption packet. For request forwarding processing of this packet, the method of the present application may include: and determining a server for processing the to-be-processed request in each server according to the current connection information corresponding to the added processing resource consumption group in the current connection information set of each server. That is, for the added processing resource consumption packet, each server may have current connection information corresponding to the server, so for the added processing resource consumption packet, the load balancing device may forward the group of pending requests to the corresponding server according to the current connection information and the minimum connection number algorithm for processing, thereby also facilitating statistics and management of mismatched pending requests.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a load balancing processing device for realizing the above related load balancing processing method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the load balancing processing device provided below may refer to the limitation of the load balancing processing method hereinabove, and will not be described herein.
In one embodiment, as shown in fig. 6, a load balancing processing apparatus is provided, the apparatus 600 may include:
a construction triggering module 601, configured to trigger construction processing of a corresponding relation if a corresponding relation between an unstructured request and a processing resource consumption packet is detected and a construction condition of the corresponding relation is satisfied during processing of the request;
the relationship construction module 602 is configured to construct a corresponding relationship between the request and the processing resource consumption packet based on the processed processing resource consumption information of each history request and a plurality of processing resource consumption packets created in advance according to the construction process of the corresponding relationship;
a packet determining module 603, configured to determine, for a received request to be processed, a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed correspondence;
a connection obtaining module 604, configured to obtain current connection information corresponding to the target packet in respective current connection information sets of each server;
and a server determining module 605, configured to determine, according to the current connection information of each server, a server for processing the pending request from the servers.
In one embodiment, the construction triggering module 601 is configured to determine the number of each history request that has been processed if a correspondence between an unstructured request and a processing resource consumption packet is detected; and if the number of the processed historical requests reaches a construction number threshold, triggering construction processing of the corresponding relation.
In one embodiment, the apparatus 600 may further include: and the construction preprocessing module is used for determining a server for processing the to-be-processed request in each server according to the current connection information of each server for the received to-be-processed request if the number of the processed history requests does not reach the construction number threshold.
In one embodiment, the relationship construction module 602 is further configured to obtain corresponding processing resource consumption distribution information according to the respective processing resource consumption information of each history request; and determining a partition interval of the processing resource consumption groups according to the corresponding processing resource consumption distribution information, and dividing a plurality of processing resource consumption groups in the partition interval so as to balance the number of history requests contained in each processing resource consumption group.
In one embodiment, the relationship construction module 602 is further configured to determine, according to the respective processing resource consumption information of each history request, first processing resource consumption information that characterizes minimum processing resource consumption, and attribute the history request with the first processing resource consumption information to a processing resource consumption packet with a start packet number; and for each other history request in the history requests, attributing the other history request to a processing resource consumption packet with a packet number corresponding to the ratio according to the ratio of the second processing resource consumption information and the first processing resource consumption information of the other history request.
In one embodiment, the relationship construction module 602 is further configured to obtain a time consumption for executing the respective request of the history requests; and obtaining the respective processing resource consumption information of each history request according to the time consumption of the respective request execution of each history request.
In one embodiment, the relationship construction module 602 is specifically configured to determine respective request feature identification information of each of the historical requests, and determine respective packet identification information of the plurality of processing resource consumption packets; and constructing the corresponding relation by utilizing the request characteristic identification information of each history request and the packet identification information of each processing resource consumption packet based on the processing resource consumption information of each history request and the pre-established processing resource consumption packets.
In one embodiment, the apparatus 600 may further include: the relation updating module is used for updating the corresponding relation according to the processed historical requests and the processed new requests according to a preset time period; or if the number of the processed new requests is detected to reach the update number threshold, updating the corresponding relation according to each processed new request.
In one embodiment, the packet determining module 603 is further configured to, for a received pending request, if the pending request is a request mismatched among the plurality of processing resource consumption packets, assign the pending request to a preset processing resource consumption packet among the plurality of processing resource consumption packets, or randomly assign the pending request to a processing resource consumption packet among the plurality of processing resource consumption packets, or assign the pending request to an added processing resource consumption packet; the server determining module 605 is further configured to determine, if the target packet of the to-be-processed request is an added processing resource consumption packet, a server for processing the to-be-processed request from the servers according to current connection information corresponding to the added processing resource consumption packet in the respective current connection information sets of the servers.
The respective modules in the load balancing processing apparatus described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may act as a load balancing device, and the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as the corresponding relation between the request and the processing resource consumption grouping. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external device through a network connection. The computer program, when executed by a processor, implements a load balancing processing method.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile memory may include Read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high density embedded nonvolatile memory, resistive memory (ReRAM), magnetic memory (MagnetoresistiveRandomAccessMemory, MRAM), ferroelectric memory (FerroelectricRandomAccessMemory, FRAM), phase change memory (PhaseChange Memory, PCM), graphene memory, and the like. Volatile memory may include random access memory (RandomAccessMemory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can take many forms, such as static random access memory (StaticRandomAccess Memory, SRAM) or dynamic random access memory (DynamicRandomAccessMemory, DRAM), among others. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (13)

1. A method of load balancing processing, the method comprising:
in the processing of the request, if the corresponding relation between the unstructured request and the processing resource consumption group is detected and the construction condition of the corresponding relation is met, triggering the construction processing of the corresponding relation;
according to the construction processing of the corresponding relation, the corresponding relation between the request and the processing resource consumption grouping is constructed and obtained based on the processed respective processing resource consumption information of each history request and a plurality of pre-established processing resource consumption groupings;
For the received request to be processed, determining a target packet to which the request to be processed belongs from the plurality of processing resource consumption packets according to the constructed corresponding relation;
acquiring current connection information corresponding to the target group in respective current connection information sets of each server;
and determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
2. The method according to claim 1, wherein triggering the building process of the correspondence if the correspondence between the non-built request and the processing resource consumption packet is detected and the building condition of the correspondence has been satisfied, comprises:
if the corresponding relation between the unstructured request and the processing resource consumption packet is detected, determining the number of each processed historical request;
and if the number of the processed historical requests reaches a construction number threshold, triggering construction processing of the corresponding relation.
3. The method according to claim 2, wherein the method further comprises:
and if the number of the processed historical requests does not reach the construction number threshold, determining a server for processing the request to be processed in each server according to the current connection information of each server for the received request to be processed.
4. The method of claim 1, further comprising, prior to constructing the correspondence between the requests and the processing resource consumption packets based on the processing resource consumption information of each of the processed historical requests and the plurality of processing resource consumption packets created in advance:
obtaining corresponding processing resource consumption distribution information according to the respective processing resource consumption information of each history request;
and determining a partition interval of the processing resource consumption groups according to the corresponding processing resource consumption distribution information, and dividing a plurality of processing resource consumption groups in the partition interval so as to balance the number of history requests contained in each processing resource consumption group.
5. The method of claim 1, further comprising, prior to constructing the correspondence between the requests and the processing resource consumption packets based on the processing resource consumption information of each of the processed historical requests and the plurality of processing resource consumption packets created in advance:
determining first processing resource consumption information representing minimum processing resource consumption according to the respective processing resource consumption information of each history request, and attributing the history request with the first processing resource consumption information to a processing resource consumption group with a starting group number;
And for each other history request in the history requests, attributing the other history request to a processing resource consumption packet with a packet number corresponding to the ratio according to the ratio of the second processing resource consumption information and the first processing resource consumption information of the other history request.
6. The method according to claim 1, 4 or 5, wherein before the constructing the correspondence between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance, the method further comprises:
acquiring the time consumption of each request execution of each history request;
and obtaining the respective processing resource consumption information of each history request according to the time consumption of the respective request execution of each history request.
7. The method according to claim 1, 4 or 5, wherein the constructing the correspondence between the request and the processing resource consumption packet based on the processing resource consumption information of each processed history request and the plurality of processing resource consumption packets created in advance includes:
determining respective request characteristic identification information of each history request, and determining respective packet identification information of each of the plurality of processing resource consumption packets;
And constructing the corresponding relation by utilizing the request characteristic identification information of each history request and the packet identification information of each processing resource consumption packet based on the processing resource consumption information of each history request and the pre-established processing resource consumption packets.
8. The method of claim 1, wherein after constructing the correspondence of the request to the processing resource consumption packet, the method further comprises:
updating the corresponding relation according to the processed historical requests and the processed new requests according to a preset time period;
or alternatively, the process may be performed,
and if the number of the processed new requests is detected to reach the update number threshold, updating the corresponding relation according to each processed new request.
9. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the method further comprises the steps of:
if the received request to be processed is a mismatched request in the processing resource consumption groups, attributing the request to be processed to a preset processing resource consumption group in the processing resource consumption groups, or attributing the request to be processed to a processing resource consumption group in the processing resource consumption groups randomly, or attributing the request to be processed to an added processing resource consumption group;
The method further comprises the steps of:
if the target packet of the to-be-processed request is an added processing resource consumption packet, determining a server for processing the to-be-processed request in each server according to current connection information corresponding to the added processing resource consumption packet in respective current connection information sets of each server.
10. A load balancing processing apparatus, the apparatus comprising:
the construction triggering module is used for triggering construction processing of the corresponding relation if the corresponding relation between the unstructured request and the processing resource consumption grouping is detected and the construction condition of the corresponding relation is met in the processing of the request;
the relation construction module is used for constructing and obtaining the corresponding relation between the requests and the processing resource consumption groups based on the processed respective processing resource consumption information of each history request and the pre-established multiple processing resource consumption groups according to the construction processing of the corresponding relation;
the grouping determining module is used for determining a target grouping to which the to-be-processed request belongs from the plurality of processing resource consumption groupings according to the constructed corresponding relation for the received to-be-processed request;
The connection acquisition module is used for acquiring current connection information corresponding to the target group in the current connection information set of each server;
and the server determining module is used for determining a server for processing the to-be-processed request in each server according to the current connection information of each server.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 9 when the computer program is executed.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 9.
CN202310299128.1A 2023-03-24 2023-03-24 Load balancing processing method, device, equipment, medium and computer program product Pending CN116382900A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310299128.1A CN116382900A (en) 2023-03-24 2023-03-24 Load balancing processing method, device, equipment, medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310299128.1A CN116382900A (en) 2023-03-24 2023-03-24 Load balancing processing method, device, equipment, medium and computer program product

Publications (1)

Publication Number Publication Date
CN116382900A true CN116382900A (en) 2023-07-04

Family

ID=86974362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310299128.1A Pending CN116382900A (en) 2023-03-24 2023-03-24 Load balancing processing method, device, equipment, medium and computer program product

Country Status (1)

Country Link
CN (1) CN116382900A (en)

Similar Documents

Publication Publication Date Title
US11888756B2 (en) Software load balancer to maximize utilization
CN108920272B (en) Data processing method, device, computer equipment and storage medium
CN109800204B (en) Data distribution method and related product
US20120284384A1 (en) Computer processing method and system for network data
US10002075B1 (en) Managing memory resources in a network environment in order to handle querying of logical data structures
WO2014052758A1 (en) Reducing wireless reconnection time of a computing device
US9736235B2 (en) Computer system, computer, and load balancing method
CN113873017B (en) Heartbeat cycle adjusting method, device, client and server
CN112689007A (en) Resource allocation method, device, computer equipment and storage medium
CN115334082A (en) Load balancing method, device, computer equipment, storage medium and product
CN109462646B (en) Abnormal response method and equipment
CN111159131A (en) Performance optimization method, device, equipment and computer readable storage medium
CN116382900A (en) Load balancing processing method, device, equipment, medium and computer program product
CN108255704B (en) Abnormal response method of script calling event and terminal thereof
CN112003900B (en) Method and system for realizing high service availability under high-load scene in distributed system
CN116302547A (en) Load balancing processing method, device, equipment, medium and computer program product
US9479579B2 (en) Grouping processing method and system
CN111190728A (en) Resource adjusting method and device
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium
CN114584625B (en) Message processing method and device, electronic equipment and storage medium
CN115102784B (en) Rights information management method, device, computer equipment and storage medium
CN117453759B (en) Service data processing method, device, computer equipment and storage medium
WO2016197839A2 (en) Information processing method and device
CN114466079B (en) Request processing method, device, proxy server and storage medium
CN117149382A (en) Virtual machine scheduling method, device, computer equipment and storage medium

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