Service request allocation method, device, computer equipment and storage medium

By dividing the business equipment set into multiple sets of service equipment subsets and determining the target service equipment subset based on the allocation weight, the problem of low service request allocation efficiency in the prior art is solved, and load balancing and efficient service request allocation are achieved.

CN112131006BActive Publication Date: 2025-02-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011030599.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2025-02-18
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

In the prior art, service request allocation is inefficient, and the load information of service equipment needs to be counted and updated in real time to achieve load balancing.

Method used

By dividing the business device set into multiple sets of service device subsets, dividing them based on idle resources, and determining the target service device subset based on the allocation weight of each set of service device subsets, the service requests are efficiently allocated.

Benefits of technology

It realizes that while ensuring load balancing, efficient allocation of service requests is reduced, and the allocation efficiency of service requests is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131006B_ABST
    Figure CN112131006B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for allocating business requests, which can be specifically implemented through a cloud server. The method includes: obtaining a pending business request; determining multiple groups of business device subsets obtained by dividing a business device set, wherein the multiple groups of business device subsets are obtained by dividing based on the idle resources of each business device in the business device set; determining a target business device subset that matches the business request according to the allocation weights corresponding to each group of business device subsets; screening target business devices from the target business device subset; allocating business requests to target business devices; the target business devices are used to perform business operations corresponding to the allocated business requests. This method can reasonably schedule business devices in the network, and improve the efficiency of business request allocation while achieving load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment and storage medium for allocating service requests. Background Art

[0002] With the development of computer technology, service equipment sets that provide services often need to process a large number of service requests. In order to avoid the situation where service equipment (such as servers) in the service equipment set cannot respond due to heavy load, it is often necessary to reasonably distribute service requests to different service equipment to achieve basic load balancing between the service equipment.

[0003] However, there are many ways of allocating service requests in the prior art, such as allocating service requests to different service devices in a round-robin manner, or allocating service requests to the service device with the smallest load.

[0004] However, in actual use, each time a service request is allocated, these existing service request allocation methods need to collect real-time statistics on the load information of each service device in the service device set and update the load information to ensure that the service request access is load balanced. In this case, a large amount of calculation is often required in real time, resulting in low efficiency in service request allocation. Summary of the invention

[0005] Based on this, it is necessary to provide a service request allocation method, device, computer equipment and storage medium that can efficiently allocate service requests to corresponding service devices while ensuring load balancing in order to address the technical problem of low efficiency in the above-mentioned service request allocation.

[0006] A service request allocation method, the method comprising:

[0007] Get pending business requests;

[0008] Determine a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set;

[0009] Determine a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets;

[0010] Filter the target business device from the target business device subset;

[0011] The service request is allocated to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

[0012] A service request allocation device, comprising:

[0013] An acquisition module is used to obtain pending business requests;

[0014] A first determination module is used to determine a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set;

[0015] A second determination module is used to determine a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets;

[0016] A screening module, used for screening target business devices from a subset of target business devices;

[0017] The allocation module is used to allocate the service request to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

[0018] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0019] Get pending business requests;

[0020] Determine a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set;

[0021] Determine a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets;

[0022] Filter the target business device from the target business device subset;

[0023] The service request is allocated to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

[0024] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0025] Get pending business requests;

[0026] Determine a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set;

[0027] Determine a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets;

[0028] Filter the target business device from the target business device subset;

[0029] The service request is allocated to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

[0030] The above-mentioned service request allocation method, device, computer equipment and storage medium determine multiple groups of service equipment subsets obtained by dividing the service equipment set, wherein the multiple groups of service equipment subsets are divided based on the idle resources of more than one service equipment in the service equipment set, so that each group of service equipment subsets includes one or more service equipment with similar load conditions. When the service request to be processed is obtained, the target service equipment subset matching the service request can be determined according to the allocation weights corresponding to each group of service equipment subsets. Then the service request is allocated to the target service equipment in the target service equipment subset to perform the corresponding service operation. Since the target service subset includes multiple service equipment, the number of service equipment subsets is much smaller than the number of service equipment. By first allocating the service request to the target service equipment subset instead of directly allocating it to a specific service equipment, the amount of calculation in the allocation process is reduced, and the allocation efficiency of the service request is improved. And the service request is allocated to the corresponding target service equipment subset according to the allocation weight corresponding to each service equipment subset, so as to achieve reasonable allocation of service requests, so that load balancing is satisfied between each service equipment subset. In this way, the business requests are first allocated to the target business device subset in a coarse-grained manner according to the direction of load balancing, and then the business requests are allocated to a target business device in the target business device subset. This can not only meet the load balancing when allocating business requests, but also does not require a large amount of load update calculations in real time, greatly reducing the amount of calculation and greatly improving the efficiency of business request allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 An application environment diagram of a service request allocation method in an embodiment;

[0032] Figure 2 A schematic diagram of a flow chart of a service request allocation method in an embodiment;

[0033] Figure 3 A schematic flow chart of the steps of determining a plurality of service device subsets obtained by dividing a service device set in one embodiment;

[0034] Figure 4 A schematic flow chart of a service request allocation method in another embodiment;

[0035] Figure 5A flowchart of a step of determining a target service device subset matching a service request according to the allocation weights corresponding to each group of service device subsets provided in an embodiment;

[0036] Figure 6 A schematic flow chart of a step of determining a target allocation code subset to which a target allocation code belongs provided in one embodiment;

[0037] Figure 7 A schematic diagram of a flow chart of steps for allocating a service request to a target service device provided in an embodiment;

[0038] Figure 8 A schematic diagram of allocating service requests according to IP addresses provided in one embodiment;

[0039] Fig. 9 A schematic diagram of resource usage rates corresponding to various service devices when service request allocation is performed according to a service request allocation method in an embodiment;

[0040] Fig.10 It is a structural block diagram of a service request allocation device in one embodiment;

[0041] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] The service request allocation method provided in this application can be applied to Figure 1 In the application environment shown. The computer device 110 communicates with the terminal 130 and the service device set 120 through the network. The service device set 120 includes more than one set of service device subsets, and each service device subset includes one or more service devices. Specifically, the computer device 110 obtains the service request sent by the terminal 130, determines the target service device matching the service request in the service device set 120, and then distributes the service request to the corresponding target service device through the network, so that the target service device performs service processing on the distributed service request.

[0044] It should be noted that the above-mentioned computer device can specifically be a terminal or server that implements the routing function, such as a routing device, a distribution device, or a central server. The business device can be implemented specifically with an independent server or a server cluster composed of multiple servers. It should be noted that the above-mentioned server can specifically be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal 130 and the computer device 110 can be directly or indirectly connected by wired or wireless communication, and the computer device 110 and the business device set can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.

[0045] In one embodiment, Figure 2 As shown, a flow chart of a business request allocation method is provided, and the method is applied to Figure 1 Taking the computer device 110 in the example as an example, the service request allocation method includes the following steps:

[0046] Step S202: Obtain the service request to be processed.

[0047] Among them, the service request can be a communication connection request or a service processing request, etc. The types of service requests can be different or the same in different service scenarios, which is not limited in this application. The sender of the service request can be the user end or the computer device end, that is, the service request can be a request sent by the user end to the computer device, or it can be a request automatically generated in the computer device. It should be noted that the computer device can be a physical server or a virtual server, specifically a gateway routing server, which is not limited in this application.

[0048] Specifically, when the service request is a request sent by the user end, the user end with the service processing request can send the service request to be processed to the computer device in real time, or a timer task can be set in advance on the user end, and when the preset time is reached, the service request is sent to the computer device through the user end at a scheduled time. When the service request is a request generated in the computer device, a timer task can be set in advance in the computer device, and when the time corresponding to the timer task is reached, the service request to be processed is automatically generated in the computer device. When the computer device receives the service request to be processed, the service request is processed according to the preset processing logic corresponding to the service request.

[0049] In one embodiment, a user terminal sends a service request to a computer device, and the service request corresponds to a communication connection request. When the user terminal sends a communication connection request, when the computer device receives the communication connection request sent by the user terminal, the computer device matches a target service device for the communication connection request in a service device cluster composed of multiple service devices, and allocates the communication connection request to the corresponding target service device to instruct the target service device to perform service processing on the allocated communication connection request.

[0050] Step S204 , determining a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set.

[0051] Among them, the business equipment set includes more than one business equipment, and in a specific business scenario, multiple business equipment collaborates to complete the work tasks corresponding to the business request. The business equipment can be different types of equipment, such as FTP servers, Web servers, enterprise core application servers, and other main task servers, etc., which are not limited here. Moreover, in specific applications, the business request allocation method provided by the present application can support the scheduling of business equipment of different types and processing capabilities to serve at the same time, and can distribute and deploy each business equipment, add or delete business equipment according to specific business needs, and has strong scalability, which improves the applicability to business scenarios and the efficiency of business processing.

[0052] A service equipment subset is obtained by dividing multiple service equipment in a service equipment set into groups according to certain division rules. The number of service equipment subsets is multiple groups, and multiple groups can be understood as more than one group, and each service equipment subset includes one or more service equipment. It should be noted that the "multiple groups" and "multiple" mentioned in the embodiments of the present application all mean "more than one group" and "more than one". Idle resources are performance indicators used to measure the services that service equipment can still carry. Specifically, the more idle resources corresponding to a service equipment, the more services the service equipment can carry. For example, performance indicators used to measure idle resources of service equipment may include network bandwidth, the number of virtual rooms, and the number of accessible users.

[0053] It is understood that in the present application, the idle resources of the business equipment can be measured by a single performance indicator alone, or by a combination of multiple performance indicators. In one embodiment, the idle resources of the business equipment can be measured by the network bandwidth alone, or by the number of virtual rooms alone, or by the number of accessible users alone. In other embodiments, the idle resources of the business equipment can also be measured by a comprehensive value of the network bandwidth, the number of virtual rooms, and the number of accessible users, etc., which is not limited here. It is understood that the more available (unoccupied) network bandwidth a business device has, or the more virtual rooms that can be connected, or the more accessible users, the more idle resources the business device has.

[0054] In one embodiment, the division rules for grouping the service devices in the service device set include grouping according to the idle resources of each service device. For example, service devices with similar idle resources can be divided into the same group, so that the service devices belonging to the same group form a service device subset, and the idle resources of the service devices in the same service device subset are roughly the same or differ within a certain range, that is, the service devices belonging to the same service device subset have similar (almost the same level) service processing capabilities. It should be noted that before the service devices are grouped, service devices with idle resources less than a preset value can also be selected, and these service devices are regarded as devices with a relatively large current load pressure, and do not participate in the grouping and subsequent steps of receiving service requests, so as to prevent the service devices with a relatively large current load pressure from crashing due to excessive load. In other embodiments, these service devices with a relatively large current load pressure can also be divided into the same group, and the service devices in the group do not receive new service requests.

[0055] Specifically, the step of grouping the service devices to obtain multiple service device subsets may be determined after the computer device obtains the service request in step S202, or may be determined before the computer device obtains the service request in step S202, which is not limited in the present application.

[0056] In one embodiment, after the computer device obtains the service request in step S202, the specific steps further include: grouping the service devices to obtain multiple groups of service device subsets. Specifically, when the computer device obtains the service request to be processed, the computer device counts the idle resources corresponding to each service device in the service device set in real time, and groups the service devices according to the size of the idle resources to obtain multiple groups of service device subsets.

[0057] In another embodiment, the specific steps before the computer device obtains the service request in step S202 also include: grouping the service devices to obtain multiple groups of service device subsets. Specifically, the computer device counts the idle resources corresponding to each service device in the service device set, groups the service devices according to the size of the idle resources, obtains multiple groups of service device subsets, and stores them. When the computer device obtains the service request to be processed, the computer device directly obtains the pre-stored multiple groups of service device subsets. It can be understood that the computer device can perform the subset division of the service devices at a fixed time point, such as performing the division step of the service device subset once at 0:00 and 3:00 in the morning every day. The computer device can also predetermine a time period, and then perform the group division step of the service devices once in each time period, such as the computer device can perform the group division step of the service devices once every 5 seconds. This is not limited in the present application.

[0058] Step S206: determining a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets.

[0059] The allocation weight is a relative value used to measure the ability of each service device subset in the service device set to load tasks. Specifically, the allocation weight can correspond to a specific value. Generally speaking, the larger the value corresponding to the allocation weight, the more idle resources corresponding to the service device subset, that is, the current load rate of the service device subset is small, and the service device has a stronger executable capability at the current time.

[0060] Specifically, the computer device calculates the total idle resources based on the idle resources corresponding to each business device in the business device set, and then calculates the subset idle resources corresponding to the business devices in each group of business device subsets, and determines the allocation weight corresponding to each group of business device subsets based on the relative value of each subset idle resource and the total idle resources. The relative value can be the ratio of each subset idle resource to the total idle resource, or the difference between each subset idle resource and the total idle resource, etc., which is not limited here. It can be understood that the larger the relative value, the greater the proportion of the business device subset in the business device set, and the stronger the load capacity of the business device subset.

[0061] Specifically, the computer device extracts a subset from each business device subset according to the allocation weight corresponding to each business device subset, determines the subset as the target business device subset, and allocates the currently acquired pending business request to the target business device subset. It should be noted that within a time period (that is, within a period in which the allocation weight of each business device subset remains unchanged), the ratio of the number of business requests allocated to each business device subset is consistent with the ratio of the allocation weight corresponding to each business device. The purpose of evenly allocating business requests to each business device subset within a time period is achieved, and load balancing of the business device subsets is achieved.

[0062] Step S208: Filter the target service devices from the target service device subset.

[0063] Since the target business device subset includes more than one business device, when the computer device matches the business request to the corresponding target business device subset, it also includes screening a business device from the target business device subset again, and uses the screened business device as the target business device to process the pending business request obtained this time.

[0064] There are many ways for the computer device to select target business devices from the target business device subset, such as polling screening algorithm, idle resource principle screening algorithm, random screening algorithm, etc., which are not specifically limited in this application.

[0065] In one embodiment, the step of a computer device screening target business devices from a target business device subset according to a polling screening algorithm includes: the computer device first queues each business device according to the idle resources corresponding to each business device in the target business device subset, and determines the queuing order of each business device, and then uses the queuing order as the polling order, extracts the business device polled in this time as the target business device for the business request, and uses the target business device to perform business processing on the business request.

[0066] In one embodiment, the step of selecting target business devices from the target business device subset according to the idle resource principle selection algorithm includes: the computer device determines the idle resources corresponding to each business device in the target business device subset, and then selects the business device with the largest idle resources as the target business device.

[0067] In one embodiment, the step of selecting a target business device from a target business device subset according to a random screening algorithm by a computer device includes: the computer device randomly selects a business device from the target business device subset, and determines the randomly selected business device as the target business device. It should be noted that in other embodiments of the present application, the target business device can also be selected from the target business devices according to other algorithms, which is not limited here.

[0068] Step S210: Allocate the service request to a target service device, and the target service device is used to execute a service operation corresponding to the allocated service request.

[0069] Specifically, after the computer device matches the target business device corresponding to the business request to be processed, the business request to be processed is assigned to the corresponding target business device to instruct the target business device to perform the corresponding business operation on the assigned business request. The business operation corresponds to the type of the business request. When the type of the business request is a communication connection request, the corresponding business operation is a communication connection operation. When the type of the business request is a business processing request, the corresponding business operation is a business processing operation.

[0070] In a specific embodiment, the computer device obtains the idle resources of all the service devices in the service device set within the corresponding time period, and then divides each service device into groups according to the idle resources to obtain multiple service device subsets, and determines the corresponding allocation weight of each service device subset within the current time period according to the idle resources corresponding to the service devices included in each service device subset. The computer device allocates a corresponding number of service requests to the corresponding service device subset according to the allocation weight corresponding to each service device subset within the current time period (within the current 5 seconds) to ensure load balancing of each service device subset within the time period. Then, according to the preset rules, a target service device is selected from the target service subset, and the service request is allocated to the target service device again, and the service request is processed using the target service device. In this embodiment, since the allocation weight of each service device subset represents the load capacity of the service device subset, the corresponding number of service requests are allocated to the corresponding service device subset according to the allocation weight of each service device, so as to achieve the balance of resource allocation between each service device subset in the service device set, and avoid the disadvantages such as overload of the service device subset caused by uneven distribution of service requests, which in turn causes downtime of the service devices in the service device subset. It can be understood that in the next time period, the computer device needs to re-count the latest idle resources of each service device in the service device set, and re-divide the service device subset according to the latest idle resources, and calculate the allocation weight of each service device subset, and then when the service device receives the service request, it executes the step of re-determining the target service device subset and the target service device according to the latest allocation weight.

[0071] In this way, business devices with similar idle resources are placed in the same business device subset, and the allocation weights corresponding to each business device subset are determined. Business requests are allocated to the target business device subset according to the allocation weights, and then the target business devices are screened out from the target business device subset and the business requests are allocated to the target business devices. By placing business devices with similar idle resources in the same business device subset, allocating them between different business device subsets according to the allocation weights, and performing round-robin allocation within the same business device subset, the computational complexity of the algorithm is reduced, while taking into account the different allocation probabilities of business device subsets with different allocation weights, and achieving reasonable allocation of business requests and load balancing of business devices.

[0072] The above-mentioned service request allocation method determines multiple groups of service device subsets obtained by dividing the service device set, wherein the multiple groups of service device subsets are divided based on the idle resources of more than one service device in the service device set, so that each group of service device subsets includes one or more service devices with similar load conditions. When the service request to be processed is obtained, the target service device subset matching the service request can be determined according to the allocation weights corresponding to each group of service device subsets. Then the service request is allocated to the target service device in the target service device subset to perform the corresponding service operation. Since the target service subset includes multiple service devices, the number of service device subsets is much smaller than the number of service devices. By first allocating the service request to the target service device subset instead of directly allocating it to a specific service device, the amount of calculation in the allocation process is reduced, and the allocation efficiency of the service request is improved. And the service request is allocated to the corresponding target service device subset according to the allocation weight corresponding to each service device subset, so as to achieve reasonable allocation of service requests, so that load balancing is satisfied between each service device subset. In this way, the business requests are first allocated to the target business device subset in a coarse-grained manner according to the direction of load balancing, and then the business requests are allocated to a target business device in the target business device subset. This can not only meet the load balancing when allocating business requests, but also does not require a large amount of load update calculations in real time, greatly reducing the amount of calculation and greatly improving the efficiency of business request allocation.

[0073] refer to Figure 3 In one embodiment, step S204, i.e., the step of determining a plurality of service device subsets obtained by dividing the service device set, specifically includes:

[0074] Step S302: Determine available resource information corresponding to more than one service devices in the service device set in the current time period.

[0075] The current time period is a period determined according to a predefined time interval. For example, if the predefined time interval is 5 seconds, the current time period corresponds to the current 5-second time interval. That is to say, every 5-second time range is regarded as a time period, and the available resource information of each service device in the service device set is counted and updated once within a time period, and each service device is sorted according to the latest updated available resource information. Available resource information is information that measures the current load level or the current resource idle level, which can be specifically the load rate or resource idle rate, etc.

[0076] In one embodiment, the computer device may calculate the available resource information corresponding to each service device according to the comparison value between the current idle resource information and the effective resource information. The current idle resource information is the quantitative information obtained by quantifying the current idle resources of the service device, and may be a quantitative value. The effective resource information is the quantitative information obtained by quantifying the effective resources, and may be a quantitative value. The computer device may use the comparison value between the current idle resource information and the effective resource information as the available resource information corresponding to the service device. The comparison value is the difference between the two values, and may be the quotient of the current idle resource information and the effective resource information.

[0077] In another embodiment, the computer device may directly use the current idle resource information of the service device as the available resource information.

[0078] Step S304: sort each service device according to the available resource information.

[0079] Specifically, the computer device sorts the business devices from large to small, or from small to large, according to the size of the available resource information corresponding to each business device in the business device set.

[0080] Step S306: classify each sorted service device into a corresponding group according to a predetermined group classification ratio, wherein service devices belonging to the same group together constitute a group of service device subsets.

[0081] The group division ratio is a predetermined ratio value for dividing a set of business devices into different groups. The business devices are sorted according to the available resource information corresponding to each business device, and the group division ratio is determined according to the sorting value corresponding to each business device. It should be noted that in different business scenarios, the group division ratio is not a fixed value, and the group division ratio can be adaptively adjusted according to specific business needs.

[0082] Specifically, the computer device predetermines the number of business devices included in each business device subset, and determines the group division ratio according to the number corresponding to each business device subset. In one embodiment, the total number of business devices in the business device set is 24, the number of business device subsets is predetermined to be 5 groups, and the number of business devices in each business device subset is predetermined to be 2, 4, 6, 4, and 8, respectively, then the corresponding group division ratio is 1:2:3:2:4. In a specific implementation, the computer device sorts the business devices according to the available resource information corresponding to each business device, and divides different business device subsets from the sorted business devices according to the ratio of 1:2:3:2:4 to obtain multiple groups of business device subsets.

[0083] Specifically, the group division ratio can also be determined according to the grading level ratio. In one embodiment, the computer device sorts the business devices according to the available resource information corresponding to each business device, and then divides the groups according to the predetermined grading level ratio. For example, the business devices ranked in the range of 0-10% are divided into the first grading G1 to generate the first grading business device subset, the business devices ranked in the range of 10%-25% are divided into the second grading G2 to generate the second grading business device subset, the business devices ranked in the range of 25%-50% are divided into the third grading G3 to generate the third grading business device subset, and the business devices ranked in the range of 50%-85% are divided into the fourth grading G4 to generate the fourth grading business device subset. Furthermore, the business devices ranked in the range of 85%-100% can be divided into the fifth grading G5 to generate the fifth grading business device subset. It should be noted that in other embodiments, since the available resource information of the business devices ranked between 85% and 100% is relatively small, that is, the current load rate of these business devices is very high, and the business capacity that can still be loaded is relatively weak, these business devices can be discarded in the process of executing group division, or these business devices can be divided into groups that do not participate in receiving business requests, so as to ensure that the business devices with higher loads do not receive new business requests again, and to ensure that the business devices with higher loads will not crash due to excessive load caused by receiving too many business requests.

[0084] Specifically, in the current time period, the service device divides the service devices into groups according to the available resource information of each service device, obtains multiple service device subsets, and simultaneously determines the allocation weights corresponding to each service device subset. Then, all service requests received in the time period are allocated according to the allocation weights determined in the current time period. After completing the allocation of service requests in the current time period, the computer device starts to re-count the available resource information of each service device in the next time period, and re-executes the division of service device subsets in a new round of cycles according to the re-counted available resource information, and re-determines the allocation weights corresponding to the new round of service device subsets, and allocates the service requests received in the new round of time periods according to the re-determined allocation weights. This cycle repeats and re-executes the update of the service device subsets every time a time period is reached, which ensures the accuracy and real-time performance of the division of service device subsets, thereby achieving the purpose of reasonably allocating service requests to service device subsets.

[0085] In one embodiment, a time period of 5 seconds is used as an example for explanation. The computer device pre-counts the available resource information corresponding to each business device in real time, and divides each business device into groups according to the size of the available resource information, to obtain multiple levels of business device subsets, so that the division of the business device subsets is not re-executed in the 5-second time period, but the business requests are allocated based on the business device subsets. Only when the time exceeds the current 5 seconds, the business device will re-count the latest available resource information of each business device in the business device set, and re-divide the business device subsets, so that all business requests received within the next 5 seconds are allocated according to the latest business device subsets counted.

[0086] In the above embodiment, the load of all the service devices in the service device set is quantified to obtain the available resource information, and the available resource information of the service devices is collected every N seconds, and the service devices are sorted according to the collected available resource information, and the service devices are classified according to the order corresponding to the sorting, so as to obtain multiple groups of service device subsets. By performing group division once every N seconds, the collection delay requirement for the available resource information in the service device set is relatively low, and the amount of calculation is reduced. And the allocation weight of each service device subset is calculated, and then the service request can be allocated to the target service device subset according to the allocation weight. Furthermore, polling allocation can also be performed in the target service device subset to achieve reasonable allocation of service requests and load balancing of each service device.

[0087] like Figure 4 As shown, Figure 4This is a flow chart of a service request allocation method in another embodiment. In one embodiment, the service request allocation method further includes:

[0088] Step S402: Obtain available resource information corresponding to more than one service devices in the current time period.

[0089] Step S404: group the service devices according to the available resource information, and determine the service device subset to which each service device belongs.

[0090] Step S406: When the service device receives a service request within the current time period, a target service device subset matching the service request is determined according to the allocation weights corresponding to each group of service device subsets.

[0091] Step S408: Allocate the service request to the target service device in the target service device subset.

[0092] For the limitations of the above steps S402, S404, S406 and S408, refer to the relevant descriptions of steps S302, S204, S206, S210 and S210 above, and the embodiments of the present application are not repeated here.

[0093] In the above embodiment, by counting the available resource information of each service device once in the current time period, and performing the grouping step of the service devices according to the counted available resource information, a plurality of service device subsets corresponding to the current time period are obtained. Then, all service requests obtained in the current time period can be allocated to the service requests according to the service device subset determined in the current time period. When the next time period is reached, the available resource information of each service device is counted again, and the service device subsets are divided again. In the whole process, the load calculation is performed once in a time period, and the service device subset is updated once, without the need to update the service device subset in real time, not only does it not have the problem of load information statistical delay, but it also reduces the amount of calculation and improves the efficiency of service request allocation.

[0094] In one embodiment, determining available resource information corresponding to more than one service devices in a service device set in a current time period includes: determining valid resource information corresponding to each service device in the service device set. In the current time period, collecting current idle resource information corresponding to each service device in the service device set, and determining available resource information corresponding to each service device according to a comparison value between the current idle resource information and the valid resource information.

[0095] Among them, the effective resource information is the quantitative information obtained by quantifying the effective resources, which can be specifically represented by a specific value. And the larger the value corresponding to the effective resource information is, the more effective resources the business device has, which can also be understood as the effective resource information being the maximum resource value that the business device can load. The effective resource information is the data obtained during the stress test before each type of business device goes online, and the effective resources can be measured by indicators such as the CPU, memory, flow, and disk of each business device. Among them, the flow can be the intranet flow, and the CPU is a dynamic indicator with large fluctuations. In one embodiment, the number of accessible users and the number of virtual rooms can be used to measure the effective resources, such as the maximum number of accessible users (max_user_cnt), the maximum number of virtual rooms (max_room_cnt), and the maximum uplink and downlink bandwidth (max_in_flow, max_out_flow) that the business device can support. It should be noted that in other embodiments, considering that the impact of the pending business request on the disk is very small and can be ignored, the resources occupied by the disk can be used to measure the effective resource information.

[0096] Idle resource information is quantitative information obtained by quantifying idle resources, and current idle resource information is idle resource information corresponding to the service equipment in the current time period. Idle resources are equipment resources that are not currently occupied by the service equipment and are available for use.

[0097] Specifically, valid resource information and current idle resource information corresponding to all service devices in the service device set are collected based on the heartbeat algorithm during the current time period, and available resource information corresponding to each service device is determined according to the ratio of the current idle resource information to the valid resource information.

[0098] In one embodiment, the computer device determines the effective resource information corresponding to each service device in the current time period in the current time period. It should be noted that since the effective resource information is the inherent attribute information of the service device, the computer device can directly obtain the effective resource information of each service device, and the effective resource information of each service device can be fixed in different time periods. Among them, the effective resource information may include the maximum number of accessible users (max_user_cnt), the maximum number of virtual rooms that can be applied (max_room_cnt), the maximum inflow (max_in_flow) and the maximum outflow (max_out_flow). Among them, the maximum inflow and the maximum outflow can also be called effective uplink and downlink bandwidth (max_in_flow, max_out_flow). The computer device counts the current idle resource information of each service device, such as the current number of accessible users (curr_user_cnt), the current number of virtual rooms (curr_room_cnt) and the current uplink and downlink bandwidth (curr_in_flow, curr_out_flow) of the current service. Then the service device determines the available resource information corresponding to each service device according to the comparison value of the current idle resource information and the effective resource information. The comparison value is the difference between two values, which can be determined by mathematical calculation, such as dividing two numbers directly, dividing them after taking their logarithms, subtracting them, or performing other operations before dividing them.

[0099] In one embodiment, the comparison value may be a ratio calculated by calculating the ratio, and the ratios are: ratio of the number of accessible users = curr_user_cnt / max_user_cnt, ratio of the number of available virtual rooms = curr_room_cnt / max_room_cnt, idle ratio of inflow = curr_in_flow / max_in_flow, idle ratio of outflow = curr_out_flow / max_out_flow. In another embodiment, the comparison value may also be a difference calculated by calculating the difference, etc., which is not limited here. As long as the comparison value obtained can measure the difference state of one value relative to another value, that is, can express the relative size relationship between the current idle resource information and the effective resource information, it is within the protection scope of this application.

[0100] In one embodiment, the current idle resource information includes the current number of accessible users, the current number of virtual rooms, the current idle value of inbound traffic, and the current idle value of outbound traffic. The current number of accessible users may specifically be the difference between the maximum number of accessible users and the current number of connected users; the current number of virtual rooms may specifically be the difference between the maximum number of available virtual rooms and the current number of available virtual rooms; the current idle value of inbound traffic may specifically be the difference between the maximum inbound traffic and the current inbound traffic occupancy value; the current idle value of outbound traffic may specifically be the difference between the maximum outbound traffic and the current outbound traffic occupancy value.

[0101] It should be noted that if the current number of connected users is greater than the maximum number of users that can be connected, the current number of connected users is assigned to the maximum number of users that can be connected, to prevent the current number of users that can be connected from being a negative value when calculating. If the current number of applied virtual rooms is greater than the maximum number of virtual rooms that can be applied, the current number of applied virtual rooms is assigned to the maximum number of virtual rooms that can be applied, to prevent the current number of virtual rooms from being a negative value when calculating. If the current inflow occupancy value is greater than the maximum inflow value, the current inflow occupancy value is assigned to the maximum inflow value, to prevent the current inflow idle value from being a negative value when calculating. If the current outflow occupancy value is greater than the maximum outflow value, the current outflow occupancy value is assigned to the maximum outflow value, to prevent the current outflow idle value from being a negative value when calculating.

[0102] In the above embodiment, the effective resource information and the idle resource information are obtained by quantifying the effective resource and the idle resource of the service equipment. Then, in the current time period, by calculating the comparison value between the current idle resource information and the effective resource information of each service equipment, the available resource information corresponding to each service equipment is determined, and the service equipment is divided into groups according to the available resource information to obtain a plurality of service equipment subsets. The service equipment subsets are updated in real time in different time periods, and the accuracy of service request allocation is improved.

[0103] In one embodiment, the effective resource information includes the maximum number of accessible users, the maximum number of applicable virtual rooms, the maximum inflow, and the maximum outflow. The current idle resource information includes the current number of accessible users, the current number of accessible virtual rooms, the current idle value of inflow, and the current idle value of outflow. According to the comparison value between the current idle resource information and the effective resource information, the available resource information corresponding to each service device is determined, including: according to the current number of accessible users and the maximum number of accessible users corresponding to each service device, the corresponding first comparison value is determined. According to the current number of applicable virtual rooms and the maximum number of applicable virtual rooms corresponding to each service device, the corresponding second comparison value is determined. According to the current idle value of inflow and the maximum inflow corresponding to each service device, the corresponding third comparison value is determined. According to the current idle value of outflow and the maximum outflow corresponding to each service device, the corresponding fourth comparison value is determined. For each service device, the minimum value among the first comparison value, the second comparison value, the third comparison value and the fourth comparison value is used as the available resource information corresponding to the corresponding service device.

[0104] Among them, the performance indicators used to evaluate the effective resources of business equipment may include but are not limited to the number of accessible users, the number of virtual rooms, and traffic values. Specifically, the maximum number of accessible users refers to the maximum number of users that the business equipment can access, the maximum number of virtual rooms that can be applied for refers to the maximum number of virtual rooms that can be applied for provided by the business equipment, and the maximum inbound traffic and the maximum outbound traffic refer to the maximum values ​​of inbound and outbound traffic that can be provided by the business equipment. It should be noted that the effective resource information is the inherent attribute information of the business equipment itself, that is, for a specific business equipment, the effective resource information that it can bear is a certain value. When the maximum value of the effective resource information is reached, within the executable capacity of the business equipment, the business equipment can no longer receive more load tasks, otherwise the business equipment will be overloaded and will experience failures such as downtime.

[0105] The current idle resource information refers to the idle resources that the business device still has at the current time, and the idle resources can be used to perform specific business request tasks. Relative to the indicator performance corresponding to the effective resources, the idle resources may include the current number of accessible users, the current number of accessible virtual rooms, the current idle value of incoming traffic, and the current idle value of outgoing traffic. It can be understood that the sum of the current idle resources of the business device and the currently occupied resources of the business device determines the effective resources of the business device. Generally speaking, for the same business device, its effective resource information is a certain value. When its currently occupied resources are less, its corresponding current idle resource information is larger, that is, the probability of receiving a business request is greater.

[0106] Specifically, the computer device can calculate the comparison value corresponding to each performance indicator according to the effective resource information and idle resource information corresponding to each performance indicator. In one embodiment, the computer device determines the corresponding first comparison value according to the current number of accessible users and the maximum number of accessible users corresponding to each service device. The corresponding second comparison value is determined according to the current number of virtual rooms that can be applied for and the maximum number of virtual rooms that can be applied for each service device. The corresponding third comparison value is determined according to the current idle value of incoming traffic and the maximum value of incoming traffic corresponding to each service device. The corresponding fourth comparison value is determined according to the current idle value of outgoing traffic and the maximum value of outgoing traffic corresponding to each service device.

[0107] In one embodiment, for each business device, the computer device extracts the minimum value from the first comparison value, the second comparison value, the third comparison value, and the fourth comparison value, and uses the extracted minimum value as the available resource information corresponding to the corresponding business device. For example, available resource information (quantized value) = Min (first comparison value, second comparison value, third comparison value, fourth comparison value). In addition, in actual scenarios, the obtained available resource information can also be expanded by a certain multiple, such as 100,000 times, to normalize the available resource information to prevent the data processed during the calculation process from being decimals, resulting in the loss of processing accuracy of the computer device. In another embodiment, the business device can also calculate a comprehensive value based on the first comparison value, the second comparison value, the third comparison value, and the fourth comparison value, and determine the available resource information of each business device based on the comprehensive value.

[0108] In the above embodiment, by calculating the comparison values ​​corresponding to the multiple performance indicators of the business equipment, the minimum value of the multiple comparison values ​​is determined as the available resource information of the business equipment. The shortest edge effect (barrel effect) is used to determine the available resource information of the business equipment, which ensures that the business equipment will not crash due to excessive load when receiving a business request within the available resource information, making the determination of the available resource information more reasonable. In addition, the different types of business equipment in the business equipment set are uniformly abstracted into an available resource information, so as to use the available resource information to characterize the maximum service capacity of different types of business equipment, thereby realizing the unified allocation and processing of different types of business equipment.

[0109] In one embodiment, the service request allocation method further includes: determining the subset weight corresponding to each service device subset according to the idle resources of each service device in each service device subset. Determining the total set weight corresponding to the service device set according to the subset weight corresponding to each service device subset. Determining the allocation weight corresponding to each service device subset according to the comparison value between the subset weight corresponding to each service device subset and the total set weight.

[0110] The subset weight refers to the proportion of the service device subset in the service device set. The larger the subset weight, the larger the proportion of the service device subset in the service device set, that is, the more idle resources the service device subset currently has, and the more service load it can receive. The total set weight is determined by the idle resources corresponding to all service devices in the service device set, such as the total set weight can be the sum of the idle resources corresponding to all service devices in the service device set.

[0111] Specifically, the steps of determining the allocation weights corresponding to each group of service equipment subsets include: summing up the idle resource information corresponding to each service equipment in each group of service equipment subsets to determine the subset weight corresponding to each group of service equipment subsets. Summing up the subset weights corresponding to each service equipment subset to determine the total set weight. Determining the allocation weights corresponding to each group of service equipment subsets according to the ratio of each subset weight to the total set weight.

[0112] In one embodiment, the computer device collects idle resource information of all service devices in the service device set, and sorts each service device according to the numerical value corresponding to the idle resource information. According to a predetermined group division ratio (grading ratio), the service devices are divided into N grades, for example, when the grading ratio N=5, the service devices ranked in the range of 0-10% are divided into the G1 grade, the service devices ranked in the range of 10-25% are divided into the G2 grade, the service devices ranked in the range of 25-50% are divided into the G3 grade, the service devices ranked in the range of 50%-85% are divided into the G4 grade, and the service devices ranked in the range of 85-95% are divided into the G5 grade. Then, the service equipment obtains the subset weights corresponding to the service equipment subsets of each group according to the idle resource information corresponding to the service equipment included in the service equipment subsets of each level, which are: w1, w2, w3, w4 and w5, and calculates the total set weight corresponding to all service equipment as: W_all=w1+w2+w3+w4+w5, and calculates the allocation weights corresponding to each group of service equipment subsets as: W1=w1 / W_all*100, W2=w2 / W_all*100, W3=w3 / W_all*100, W4=w4 / W_all N*100 and W5=w5 / W_all*100. It can be understood that when the service equipment subsets correspond to N levels, the total set weight is W_all=(w1+…+wn)*100, and the allocation weight corresponding to the service equipment subset of the Gm level is: Wm=wm / w_all*100. It should be noted that in this embodiment, it is taken into account that the idle resource information of the business devices ranked in the range of 95%-100% is very small, that is, the current load rate of these business devices is already very high, and is even on the verge of overload. Therefore, in actual situations, it can be considered not to continue to allocate business requests to the business devices ranked in the range of 95%-100%.

[0113] In the above embodiment, by calculating the allocation weight of each service device subset, the quantization processing of the idle resource information of each service device subset is realized, and the allocation weight of the corresponding size is set for each service device subset according to the size of the idle resources. Then, according to the allocation weight corresponding to each service device subset, the corresponding number of service requests is allocated to it, so as to realize the reasonable allocation of service requests and the load balancing of the service devices in the service device subset.

[0114] like Figure 5 As shown, Figure 5A flowchart of a step of determining a target service device subset that matches a service request according to the allocation weights corresponding to each group of service device subsets provided in an embodiment. In one embodiment, step S206, the step of determining a target service device subset that matches a service request according to the allocation weights corresponding to each group of service device subsets specifically further includes:

[0115] Step S502, randomly determine a target allocation code corresponding to the service request from the allocation code set. The allocation code set includes allocation code subsets corresponding to multiple groups of service equipment subsets. The quotient of the number of allocation codes in the allocation code subset and the total number of allocation codes in the allocation code set matches the allocation weight corresponding to the corresponding service equipment subset.

[0116] The allocation code set includes more than one allocation code, and the value of the allocation code is within a preset range, and each allocation code can correspond to the same or different values, which is not limited in this application. Specifically, the allocation code can be a random code, which is randomly generated in a computer device and is a value within a preset range.

[0117] The allocation code subset is a subset obtained by grouping the allocation codes in the allocation code set, and each allocation code subset includes more than one allocation code. Specifically, the allocation codes in the allocation code set can be sorted according to the numerical value, and then the allocation codes can be grouped according to the preset group division ratio to obtain more than one allocation code subset. It should be noted that the number of allocation code subsets is the same as the number of service device subsets, and each allocation code subset corresponds to a service device subset.

[0118] In one embodiment, the computer device divides a preset number of allocation codes into different groups in sequence according to the sorting order of the allocation codes, and obtains multiple groups of allocation code subsets. For example, if the value interval of the allocation code in the allocation code set is 0-100, the allocation codes with a value interval of 0-10 can be divided into the g1 level, the allocation codes with a value interval of 10-25 can be divided into the g2 level, the allocation codes with a value interval of 25-50 can be divided into the g3 level, the allocation codes with a value interval of 50-85 can be divided into the g4 level, and the allocation codes with a value interval of 85-95 can be divided into the g5 level, and multiple groups of allocation code subsets can be obtained according to the allocation codes of different levels.

[0119] In another embodiment, the computer device can also classify the allocation codes into different groups according to the ranking to obtain multiple groups of allocation code subsets, such as classifying the allocation codes ranked in the range of 0-10% into the g1 grade, classifying the allocation codes ranked in the range of 10-25% into the g2 grade, classifying the allocation codes ranked in the range of 25-50% into the g3 grade, classifying the allocation codes ranked in the range of 50%-85% into the g4 grade, and classifying the allocation codes ranked in the range of 85-95% into the g5 grade, and obtaining multiple groups of allocation code subsets according to the allocation codes in different grades.

[0120] In another embodiment, the computer device divides a preset number of allocation codes into different groups to obtain multiple groups of allocation code subsets. For example, if the value interval of the allocation code in the allocation code set is 0-100, 10 different allocation codes can be divided into the g1 level, 15 different allocation codes can be divided into the g2 level, 25 different allocation codes can be divided into the g3 level, 35 different allocation codes can be divided into the g4 level, and the remaining 10 allocation codes can be divided into the g5 level, and multiple groups of allocation code subsets can be obtained according to the allocation codes of different levels.

[0121] It should be noted that the quotient of the number of allocation codes included in each service allocation code subset and the total number of allocation codes in the allocation code set matches the allocation weight corresponding to the corresponding service equipment subset. That is to say, the more allocation codes included in the allocation code subset, the greater the allocation code subset weight corresponding to the allocation code subset, and at this time, the allocation code subset corresponds to the service equipment subset with a larger allocation weight. Conversely, the fewer allocation codes included in the allocation code subset, the smaller the allocation code subset weight of the allocation code subset, and at this time, the allocation code subset corresponds to the service equipment subset with a smaller allocation weight.

[0122] In one embodiment, each time a computer device receives a service request, a random number is generated in the service device according to the rand()%100 function, and the random number ranges from 0 to 100, and the random number is used as the target allocation code. Then, the matching target service device is determined based on the randomly generated target allocation code. In another embodiment, it can also be understood that the allocation code set stores values ​​in the range of 0 to 100, and each time the computer device receives a service request, a value is randomly obtained from the allocation code set, and then the value is used as the target allocation code, and the target service device is matched based on the target allocation code.

[0123] Step S504: determine the target allocation code subset to which the target allocation code belongs.

[0124] The computer device determines the target allocation code subset to which the target allocation code belongs according to the numerical value corresponding to the target allocation code.

[0125] Step S506: The service device subset corresponding to the target allocation code subset in the multiple groups of service device subsets is used as the target service device subset that matches the service request.

[0126] Specifically, the computer device determines the allocation code subset weight corresponding to each allocation code subset according to the quotient of the number of allocation codes in each allocation code subset and the total number of allocation codes in the allocation code set. And each allocation code subset weight corresponds to the allocation weight of a service device subset. In one embodiment, the allocation code subsets are sorted according to the size of the allocation code subset weights, and the service device subsets are sorted according to the size of the allocation weights, and the corresponding allocation code subsets and service device subsets are matched in sequence according to the corresponding sorting order, and further, the corresponding allocation code subsets and service device subsets can be associated and stored accordingly. Specifically, a larger allocation code subset weight corresponds to a larger allocation weight, that is, the allocation code subset corresponding to the larger allocation code subset weight corresponds to the service device subset corresponding to the larger allocation weight.

[0127] The computer device searches for a service device subset matching the target allocation code subset in pre-corresponding stored data according to the determined target allocation code subset, and uses the found service device subset as the target service device subset matching the service request.

[0128] In the above embodiment, since the weight of the allocated code subset corresponding to each allocated code subset is determined according to the number of allocated codes included in each allocated code subset, that is to say, the allocated code subset with more allocated codes has a larger weight corresponding to the allocated code subset. In a specific business scenario, each business request corresponds to a randomly determined target allocated code. Since the target allocated code is randomly determined, that is to say, the probability that the target allocated code is any allocated code in the allocated code set is the same, so the probability that the target allocated code falls in each allocated code subset is consistent with the allocated code subset weight corresponding to each allocated code subset. That is, the larger the allocated code subset weight, the greater the probability that the randomly determined target allocated code falls within its range, and the greater the probability that the business request is allocated to the corresponding target business device subset. In the above embodiment, the deterministic principle in random events is cleverly used to match the corresponding target business device subset for each business request, so that the probability that the business device subset with a larger allocation weight is allocated to the business request is greater, and the probability that the business device subset with a smaller allocation weight is allocated to the business request is smaller, thereby achieving the effect of reasonable allocation of business requests and load balancing of business devices.

[0129] like Figure 6 As shown, Figure 6The following is a flow chart of a step of determining a target allocation code subset to which a target allocation code belongs provided in one embodiment. In one embodiment, the step of determining a target allocation code subset to which a target allocation code belongs specifically further includes:

[0130] Step S602: sort the multiple allocation code subsets to obtain the sorting values ​​corresponding to the respective allocation code subsets.

[0131] Specifically, the computer device sorts each allocation code subset according to the number of allocation codes included in the allocation code subset, and obtains a sorting value corresponding to each allocation code subset.

[0132] In one embodiment, the computer device sorts each allocation code subset according to the number of allocation codes included in the allocation code subset, and obtains the sorting value corresponding to each allocation code subset, as shown in Table 1, which is a kind of allocation code subset information provided in one embodiment. In Table 1, if the number of allocation codes included in the first allocation code subset is 35, the number of allocation codes included in the second allocation code subset is 30, the number of allocation codes included in the third allocation code subset is 20, the number of allocation codes included in the fourth allocation code subset is 10, and the number of allocation codes included in the fifth allocation code subset is 5. Then sort the multiple allocation code subsets, and obtain the sorting values ​​corresponding to each allocation code subset respectively: the sorting value of the first allocation code subset is first, the sorting value of the second allocation code subset is second, the sorting value of the third allocation code subset is third, the sorting value of the fourth allocation code subset is fourth, and the sorting value of the fifth allocation code subset is fifth.

[0133] Table 1 Allocation code subset information

[0134]

[0135] Step S604, obtaining the current ranking value of the current polling.

[0136] The computer device polls the corresponding allocation code subsets in sequence according to the ranking values ​​of each allocation code subset, and the current polling refers to the current cycle process. The current ranking value refers to the ranking value polled in the current polling state. Specifically, the computer device polls the corresponding allocation code subsets in sequence according to the ranking values ​​from large to small, and determines the current ranking value corresponding to each polling.

[0137] In one embodiment, referring to Table 1, the computer device first polls the first allocation code subset whose ranking value is first, and determines that the current ranking value is first, and then the computer device sequentially polls the second allocation code subset whose ranking value is second, and determines that the current ranking value is second, and when the computer device polls the third allocation code subset, the current ranking value corresponding to the next poll is third.

[0138] Step S606: determine a previous order ranking value that is ranked before the current order value, and determine the total number of previous order allocation codes of each allocation code subset corresponding to the previous order ranking value.

[0139] The previous sorting value is relative to the current sorting value, and the previous sorting value is all the sorting values ​​before the current sorting value.

[0140] In one embodiment, referring to Table 1, when the third allocation code subset is polled, the corresponding current ranking value is third, and the corresponding pre-order ranking values ​​are second and first, and the total number of pre-order allocation codes of the allocation code subsets corresponding to the pre-order ranking values ​​is 35 and 30, respectively. That is to say, the total number of pre-order allocation codes of each allocation code subset corresponding to the corresponding pre-order ranking value is 65.

[0141] Step S608: taking the difference between the target allocation code and the total number of the previous allocation codes as a value to be compared.

[0142] Specifically, the computer device calculates the difference between the target allocation code randomly determined according to the service request and the total number of the preceding allocation codes, and determines the value to be compared according to the difference. In one embodiment, when the target allocation code is 70 and the total number of the preceding allocation codes is 65, the calculated value to be compared is 15.

[0143] Step S610: when the value to be compared is greater than zero and less than the number of allocated codes in the allocated code subset corresponding to the current ranking value, the allocated code subset corresponding to the current ranking value is determined to be the target allocated code subset to which the target allocated code belongs.

[0144] Continuing with the above embodiment, it can be seen that the value to be compared is 15 which is greater than zero, and the value to be compared 15 is less than the number of allocated codes 20 of the allocated code subset corresponding to the current sort value, so it is determined that the allocated code subset corresponding to the current sort value, that is, the third allocated code subset, is the target allocated code subset to which the target allocated code belongs.

[0145] Step S612: otherwise, the next sorting value after the current sorting value is used as the current sorting value for the next polling, and the process returns to the step of determining the previous sorting value before the current sorting value to continue.

[0146] In one embodiment, continuing to refer to Table 1, when the target allocation code is 70 and the current sorting value is the second, the total number of previous allocation codes is 35 at this time, and the calculated value to be compared is 35. Since the value to be compared, 35, is greater than zero, but the value to be compared, 35, is greater than the current sorting value, 30, the next sorting value after the current sorting value is used as the current sorting value for the next poll, and the step of determining the previous sorting values sorted before the current sorting value is returned to continue execution. It can be seen that when the current sorting value reaches the third, the condition is met, and the third allocation code subset corresponding to the current sorting value is determined to be the target allocation code subset to which the target allocation code belongs.

[0147] In one embodiment, each time a computer device receives a service request, a random number R is randomly generated using the function rand() % 100 as the target allocation code. If the target allocation code subset corresponding to the target allocation code R is Wm, the condition that should be met at this time is: 0 < (R - (W1 + … + Wm - 1)) < Wm, where Wm is the current sorting value, and W1..Wm - 1 are the previous sorting values corresponding to the current sorting value.

[0148] In one embodiment, determining the target allocation code subset to which the target allocation code belongs includes: sorting multiple allocation code subsets; polling the allocation code subsets corresponding to each sorting value in sequence starting from the initial sorting value until the target allocation code subset to which the target allocation code belongs is determined from the multiple allocation code subsets; where, in each poll, the following steps are performed: determining the previous sorting values sorted before the current sorting value, and determining the total number of previous allocation codes of each allocation code subset corresponding to the previous sorting value; taking the difference between the target allocation code and the total number of previous allocation codes as the value to be compared; when the value to be compared is greater than zero and less than the number of allocation codes of the allocation code subset corresponding to the current sorting value, determining the allocation code subset corresponding to the current sorting value as the target allocation code subset to which the target allocation code belongs; otherwise, performing the next poll.

[0149] In the above embodiment, during the process of determining the target allocation code subset to which the target allocation code belongs, by calculating the value to be compared corresponding to each poll and determining the target allocation code according to the size of the value to be compared, the determination of the target allocation code subset is made simple and easy, improving the efficiency of determining the target allocation code subset.

[0150] The following is an example to illustrate in detail the specific process of dividing the service device set into groups to obtain multiple groups of service device subsets, so as to determine the target service device subset from the multiple groups of service device subsets when a service request is received:

[0151] Suppose the set of business devices includes 100 business devices. According to business experience, the business devices are divided into 5 grades, and the corresponding range of each grade is [1%-10%], [11%-25%], [26%-50%], [51%-85%], [86%-95%]. In specific implementation, before allocating the business devices, the business devices are sorted from large to small according to the available resource information (w1, w2... w100) corresponding to each business device. Then, the business devices ranked 1-10 are divided into the first grade to obtain the first-grade business device subset. This first-grade business device subset corresponds to the least busy grade, and the subset weight corresponding to this first-grade business device subset is: W1 = w1 + w2 +... + w10. The business devices ranked 11-25 are divided into the second grade to obtain the second-grade business device subset, and the subset weight corresponding to this second-grade business device subset is: W2 = w11 + w12 +... + w25. The business devices ranked 26-50 are divided into the third grade to obtain the third-grade business device subset, and the subset weight corresponding to this third-grade business device subset is: W3 = w26 + w27 +... + w50. The business devices ranked 51-85 are divided into the fourth grade to obtain the fourth-grade business device subset, and the subset weight corresponding to this fourth-grade business device subset is: W4 = w51 + w52 +... + w85. The business devices ranked 86-95 are divided into the fifth grade to obtain the fifth-grade business device subset. This fifth-grade business device subset is the busiest grade, and the corresponding subset weight is: W5 = w86 + w52 +... + w95. And the total weight corresponding to all business devices is: Wall = w1 + w2... + w95 = W1 + W2 + W3 + W4 + W5. Further, the allocation weight of each grade of business device subset can be determined according to the ratio of the subset weight of each grade of business device subset to the total weight of all business devices.

[0152] When the computer device receives a business request, a target allocation code R corresponding to the business request is randomly generated. Specifically, the target allocation code can be obtained through the following formula: R = Rand[1, Wall] - 1. And the grade to which the target allocation code R belongs is determined according to the magnitude relationship between R and the allocation weights of each grade. Specifically, when R < W1, it corresponds to the target allocation code belonging to the first grade. When R < W1 + W2, it corresponds to the target allocation code belonging to the second grade. When R < W1 + W2 + W3, it corresponds to the target allocation code belonging to the third grade. When R < W1 + W2 + W3, it corresponds to the target allocation code belonging to the fourth grade. When R < W1 + W2 + W3 + W4, it corresponds to the target allocation code belonging to the fifth grade.

[0153] Refer to Table 2, which is a table of idle resource information of business equipment in different business equipment subsets. Assuming that the business equipment set includes 100 business equipment, the business equipment in the business equipment set is sorted according to the idle resource information corresponding to each business equipment, and the business equipment sorted within [1-10%] is divided into the same group to obtain the first-tier business equipment subset, wherein the first business equipment subset includes 10 business equipment, and the idle resource information of each business equipment is 6w. The business equipment sorted within [11%-25%] is divided into a group to obtain the second-tier business equipment subset, wherein the second business equipment subset includes 15 business equipment, and the idle resource information of each business equipment is 5w. The business equipment sorted within [26%-50%] is divided into a group to obtain the third-tier business equipment subset, wherein the third-tier business equipment subset includes 25 business equipment, and the idle resource information of each business equipment is 2w. The business devices ranked within [51%-75%] are divided into a group to obtain the fourth-tier business device subset, wherein the fourth-tier business device subset includes 25 business devices, and the idle resource information of each business device is 1w. And the business devices ranked within [76%-100%] are divided into a group to obtain the fifth-tier business device subset, wherein the fifth-tier business device subset includes 25 business devices, and the idle resource information of each business device is 0w. It should be noted that the idle resource information of each business device in the fifth-tier business device subset is almost 0, so the business request is no longer allocated to the fifth-tier business device subset. And in a specific application scenario, when the business request is a meeting request, the meeting duration corresponding to the meeting request is much longer than the time period for updating the business device subset, so the business request is not allocated to the fifth-tier business device subset (high-load business device subset) within a time period (such as within 5s), which can also prevent the gap in load tasks in different grades of business device subsets from further widening.

[0154] Table 2 Idle resource information of service equipment in different service equipment subsets

[0155]

[0156] As can be seen from Table 2, the idle resource information of the service devices in each service device subset can be considered to be substantially the same. In one embodiment, the service requests allocated to the target service device subset can be allocated to the service devices in the target service device subset according to the polling strategy. It should be noted that in other embodiments, the idle resource information of each service device in each service device subset may also be quite different, which is not limited in this application.

[0157] In one embodiment, step S208, the specific step of screening the target service device from the target service device subset further includes: determining the queue order of each service device in the target service device subset, and using the service device currently polled when polling according to the queue order as the current target service device.

[0158] Specifically, in the target service device subset, each service device may be sorted according to the idle resource information corresponding to each service device, or each service device may be randomly arranged in the service device subset.

[0159] In one embodiment, the order of each service device in the target service device is calculated. When a service request is assigned to the target service device subset, the service device currently polled when polling in the queue order is used as the current target service device. In other words, the service devices are polled in the target service device subset in the queue order, and the service device polled at the time is used as the target service device corresponding to the service request at the time. The target service device is screened by the polling algorithm, so that the probability of the service device in the target service device subset being determined as the target service device is relatively consistent, and the load balancing of the service devices in the target service device subset is achieved.

[0160] In one embodiment, after the service request is allocated to the target service device subset, a service device with the largest idle resource information is selected as the target device according to the ranking of each service device in the target service device, and then the service request is allocated to the corresponding target service device. By allocating the service request to the target service device with the largest idle resource information, the service request is executed by the target service device with the strongest execution capability, thereby improving the processing efficiency of the service request and achieving load balancing of the service devices in the target service device subset.

[0161] In another embodiment, after the service request is assigned to the target service device subset, a service device is randomly selected from the target service device subset as the target service device, and then the service request is assigned to the corresponding target service device. Since the idle resources of each service device in the target service device subset are roughly the same, any service device in the target service device subset can be used as the target service device to process the service request, and there is no need to use a complex algorithm to screen the target service device, making the algorithm more efficient, reducing the use of computer resources, and improving the efficiency of service request processing.

[0162] like Figure 7 As shown, Figure 7 A flowchart of a step of allocating a service request to a target service device provided in an embodiment. In one embodiment, step S210, the step of allocating a service request to a target service device may further include:

[0163] Step S702: Acquire a target address corresponding to a target service device, and distribute the service request to the corresponding target service device according to the target address.

[0164] The target address may be an IP address, and the target address uniquely corresponds to the target service device. Specifically, the computer device sends the acquired service request to the corresponding target service device according to the target address.

[0165] In one embodiment, the service request allocation method further includes:

[0166] Step S704: determine the requested access address carried in the service request.

[0167] The requested access address is the address carried in the service request and needs to be accessed. Specifically, the target address is not the same as the requested access address.

[0168] In one embodiment, when a computer device receives a service request, it extracts the request access address carried in the service request, and then the computer device allocates the corresponding target service device to the service request, obtains the target address corresponding to the target service device, and modifies the request access address to the target address, so as to send the service request to the corresponding target service device according to the target address. In this step, the service request is matched with the corresponding target service device, and the service request is allocated to the corresponding target service device according to the target address corresponding to the target service device.

[0169] Step S706: receiving operation data sent by the target service device and obtained when executing the service operation corresponding to the service request.

[0170] The operation data is the data obtained after the target service device receives the corresponding service request and performs the corresponding service operation on the service request. Then the computer device obtains the operation data obtained by the target service device performing the service operation, and transmits the operation data to the user end that sent the service request.

[0171] Step S708: In response to the service request, feedback operation data is provided by requesting access to the address.

[0172] After the computer device obtains the operation data generated by the target business device, it modifies the target address to the requested access address, and feeds back the operation data to the user end that sent the business request according to the requested access address.

[0173] like Figure 8 As shown, Figure 8 FIG. 1 is a schematic diagram of allocating service requests according to IP addresses provided in one embodiment. Figure 8In the embodiment, the computer device may be a routing server (route), the service device set may be a media proxy device set, the service devices in the service device set may be multiple media proxy devices in the media proxy device set, and the media proxy device set includes N groups of media proxy devices, specifically media proxy device 1, media proxy device 2...media proxy device N. Specifically, one or more conference users of the user terminal send a request to obtain the IP address of the media proxy device to the routing server (route), and the routing server matches the corresponding media proxy device for the request sent by the user according to a service request allocation method provided in the present application. When the media proxy device matched by the routing server is media proxy device 2, a media connection is established between the user and the media proxy device 2 to realize the communication connection between the user terminal and the media proxy device 2. Furthermore, a target media proxy device may be selected in the media proxy device 2 to realize the communication connection with the user terminal by using the target media proxy device. In this embodiment, the conference user sends a request to access the IP address of the media proxy device. Considering that the allocation of the IP address of the media proxy device directly affects the utilization rate of the media proxy device, the allocation method provided in this application is used to reasonably allocate the IP address of the media proxy device to the conference user, thereby achieving reasonable utilization of the resources of the media proxy device and achieving load balancing of each media proxy device in the media proxy device set.

[0174] In the above embodiment, when the computer device receives a service request sent by a user, it extracts the request access address from the service request, and matches the service request with the corresponding target service device through the service request allocation method. Then, the request access address is modified to the target address corresponding to the target service device, so as to realize the communication connection between different devices according to the target address, making it possible to execute the service device using the target service device, thereby improving the efficiency of processing the service request.

[0175] In one embodiment, the service request to be processed is a conference connection request, and the service request allocation method further includes: receiving a conference connection request, wherein the conference connection request carries an access request address, determining a target service device matching the conference connection request according to the service request allocation method, obtaining a target address corresponding to the target service device, modifying the access request address to the target address, and allocating the conference connection request to the target service device corresponding to the target address, so as to instruct the target service data to perform a connection operation on the conference connection request.

[0176] Different conference connection requests vary greatly. For example, the duration of a conference corresponding to some conference connection requests may be several hours, while the duration of a conference corresponding to some conference connection requests may be only a few minutes. And the burr phenomenon of conference connection requests is serious. For example, the probability of conference connection requests being hourly meetings is relatively high, such as the number of corresponding conference connection requests during the morning meetings at 8 or 9 in the morning is relatively large. Based on the above problems, if the traditional conference connection request allocation method is used, after each conference connection request is received, it is necessary to re-count the idle resources of each business device in the business device set, and update the idle resources of each business device in real time, resulting in a large amount of calculation and causing system instability. The present application collects the idle resources of each business device in the business device set once every N seconds, and sorts all the business devices in the business device set according to the idle resources of each business device, and divides the business device subsets in the sorting order, and calculates the allocation weight of each business device subset. The conference connection request allocation weights sent by the user are allocated to different business device subsets, and the conference connection requests are polled and allocated in the business device subsets, which not only realizes the reasonable allocation of conference connection requests, but also realizes the load balancing of business devices. Especially in scenarios where the usage of conference users varies greatly, business devices with similar idle resources are placed in the same business device subset, and allocated among different business device subsets according to allocation weights. Round-robin allocation is performed within the same business device subset, which reduces the computational complexity of the algorithm while taking into account the different allocation probabilities of business device subsets with different allocation weights, thereby achieving load balancing.

[0177] In addition, the present application quantifies the idle resources of all business devices in the business device set, and can support different types of business devices. The algorithm is highly scalable and can be deployed in a distributed manner, which improves the scalability of business devices. In addition, the present application implements load balancing for conference scenarios in a simple and high-rate manner (idle resources are calculated every N seconds), and has relatively low requirements for the collection delay of idle resources in the current business device set.

[0178] Combination Fig. 9 , Fig. 9 This is a schematic diagram of resource usage rates corresponding to each service device when performing service request allocation according to a service request allocation method in an embodiment. Fig. 9 In the example, the vertical axis is the allocation weight, and the horizontal axis is the device ID (1-8000) of the service device. The upper limit of the load utilization rate of each service device is 10W. Fig. 9 It can be seen that the load utilization rate of the business devices in the business device set is distributed between 5W and 7W, which basically achieves load balancing of the business devices.

[0179] Through the service request allocation method provided by the present application, the computer device performs the grouping step of the service equipment every N seconds, collects the current available resource information of the service equipment only once in a time period, and calculates the allocation weight once. The allocation weight of each service equipment subset can be simply and efficiently counted, and there is no need to recalculate the allocation weight every time a service request is allocated. The real-time requirements for collecting the current idle information of each service equipment in the service equipment set are reduced, and the reliability of the system is improved at the same time. In addition, this method can support service equipment of different types and processing capabilities at the same time, and can also deploy various service equipment in a distributed manner. Especially when the number of service requests is relatively large, the service equipment can also be horizontally expanded to improve the processing capacity of the service equipment.

[0180] In one embodiment, the service request to be processed includes a conference connection request, the service device includes a media proxy device, and the device resources of the service device include at least one of resources for implementing user access, resources for implementing virtual room application, and network traffic resources.

[0181] The present application also provides an application scenario, which applies the above-mentioned service request allocation method. Specifically, the application of the service request method in the application scenario is as follows:

[0182] Take the computer device as a routing server, the business request as a conference connection request, the business device set as a media proxy device set, and the business device as a media proxy device as an example for explanation. Specifically, the routing server obtains the effective resource information and current idle resource information of each media proxy device in the media proxy device set within the current time period, and determines the available resource information of each media proxy device according to the ratio of the effective resource information and the current idle resource information, and sorts each media proxy device according to the available resource information. According to the predetermined group division ratio, each media proxy device is divided into different groups to obtain a plurality of media proxy device subsets corresponding to the current time period. And the allocation weight of each media proxy device subset is calculated according to the available resource information of the media proxy devices included in each media proxy device subset. Among them, the range of the allocation weight is 0-100, and the media proxy device subset with a larger allocation weight has a greater probability of being allocated a conference connection request.

[0183] After receiving a conference connection request sent by a conference user in the user terminal during the current time period, the routing server randomly obtains a target allocation code in the range of 0-100, and then determines the target media proxy device subset corresponding to the target allocation code according to the allocation weight interval in which the target allocation code falls, and allocates the conference connection request to the target media proxy device subset, and polls and accesses the media proxy device in the target media proxy device subset, and uses the media proxy device polled this time as the target media proxy device for processing the service request. The routing server obtains the target address corresponding to the target media proxy device, and sends the conference connection request to the target media proxy device according to the target address. When the target media proxy device completes the service operation on the conference connection request, it transmits the obtained operation data to the routing server through the target address corresponding to the target media proxy device. The routing server sends the operation data to the conference user to complete the conference connection operation.

[0184] When the conference connection request in this time period is completed, the routing server again re-counts the current idle resource information of each media proxy device in the media proxy device set, and re-divides the media proxy device subsets according to the current idle resource information to obtain multiple groups of media proxy device subsets. When a conference connection request is received in the next time period, the target media proxy device determination step is performed according to the re-determined media proxy device subset. By allocating conference connection requests in different media proxy device subsets according to the allocation weights, and randomly polling in the target media proxy device subset to determine the target media proxy device, it is simple and efficient, and the allocation efficiency of conference connection requests is improved.

[0185] It should be understood that although Figure 2-7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-7 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0186] In one embodiment, Fig.10As shown, a service request allocation device 1000 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: an acquisition module 1002, a first determination module 1004, a screening module 1008 and an allocation module 1010, wherein:

[0187] The acquisition module 1002 is used to acquire the service request to be processed.

[0188] The first determining module 1004 is used to determine a plurality of service device subsets obtained by dividing the service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set.

[0189] The second determination module 1006 is configured to determine a target service device subset that matches the service request according to the allocation weights corresponding to each group of service device subsets.

[0190] The screening module 1008 is used to screen the target service devices from the target service device subset.

[0191] The allocation module 1010 is used to allocate the service request to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

[0192] In one embodiment, the first determination module 1004 is also used to determine the available resource information corresponding to more than one business device in the business device set within the current time period; sort each business device according to the available resource information; and divide each sorted business device into a corresponding group according to a predetermined group division ratio; wherein the business devices belonging to the same group together constitute a group of business device subsets.

[0193] In one embodiment, the first determination module 1004 is also used to determine the effective resource information corresponding to each business device in the business device set; within the current time period, collect the current idle resource information corresponding to each business device in the business device set; and determine the available resource information corresponding to each business device based on the comparison value of the current idle resource information and the effective resource information.

[0194] In one embodiment, the effective resource information includes the maximum number of accessible users, the maximum number of virtual rooms that can be applied for, the maximum inflow, and the maximum outflow. The current idle resource information includes the current number of accessible users, the current number of accessible virtual rooms, the current idle value of inflow, and the current idle value of outflow. The first determination module 1004 is also used to: determine the corresponding first comparison value according to the current number of accessible users and the maximum number of accessible users corresponding to each business device; determine the corresponding second comparison value according to the current number of virtual rooms that can be applied for and the maximum number of virtual rooms that can be applied for corresponding to each business device; determine the corresponding third comparison value according to the current idle value of inflow and the maximum value of inflow corresponding to each business device; determine the corresponding fourth comparison value according to the current idle value of outflow and the maximum value of outflow corresponding to each business device; for each business device, the minimum value among the first comparison value, the second comparison value, the third comparison value and the fourth comparison value is used as the available resource information corresponding to the corresponding business device.

[0195] In one embodiment, the service request allocation device 1000 also includes a third determination module 1012, which is used to determine the subset weight corresponding to each group of service equipment subsets according to the idle resources of each service equipment in each group of service equipment subsets; determine the total set weight corresponding to the service equipment set according to the subset weight corresponding to each group of service equipment subsets; and determine the allocation weight corresponding to each group of service equipment subsets according to the comparison value of the subset weight corresponding to each group of service equipment subsets and the total set weight.

[0196] In one embodiment, the second determination module 1006 is further used to randomly determine a target allocation code corresponding to a business request from an allocation code set; the allocation code set includes allocation code subsets corresponding one-to-one to multiple groups of business equipment subsets, wherein the quotient of the number of allocation codes of the allocation code subset and the total number of allocation codes of the allocation code set matches the allocation weight corresponding to the corresponding business equipment subset; determine the target allocation code subset to which the target allocation code belongs; and use the business equipment subset corresponding to the target allocation code subset in the multiple groups of business equipment subsets as the target business equipment subset matching the business request.

[0197] In one embodiment, the second determination module 1006 is further used to sort multiple allocation code subsets to obtain the sorting values ​​corresponding to each allocation code subset; obtain the current sorting value of the current poll; determine the previous sorting value sorted before the current sorting value, and determine the total number of previous allocation codes of each allocation code subset corresponding to the previous sorting value; use the difference between the target allocation code and the total number of previous allocation codes as the value to be compared; when the value to be compared is greater than zero and less than the number of allocation codes of the allocation code subset corresponding to the current sorting value, determine that the allocation code subset corresponding to the current sorting value is the target allocation code subset to which the target allocation code belongs; otherwise, use the next sorting value after the current sorting value as the current sorting value for the next poll, and return to the step of determining the previous sorting value sorted before the current sorting value to continue execution.

[0198] In one embodiment, the screening module 1008 is further used to determine the queueing order of each service device in the target service device subset; and the service device currently polled when polling according to the queueing order is used as the current target service device.

[0199] In one embodiment, the allocation module 1010 is also used to obtain the target address corresponding to the target business device, and allocate the business request to the corresponding target business device according to the target address; the business request allocation device feedback module 1014, the feedback module 1014 is used to determine the request access address carried in the business request; receive the operation data sent by the target business device and obtained when executing the business operation corresponding to the business request; respond to the business request, and feedback the operation data through the request access address.

[0200] In one embodiment, the service request to be processed includes a conference connection request, the service device includes a media proxy device, and the device resources of the service device include at least one of resources for implementing user access, resources for implementing virtual room application, and network traffic resources.

[0201] For the specific definition of the service request allocation device, please refer to the definition of the service request allocation method above, which will not be repeated here. Each module in the above service request allocation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0202] The above-mentioned service request allocation device determines multiple groups of service device subsets obtained by dividing the service device set, wherein the multiple groups of service device subsets are divided based on the idle resources of more than one service device in the service device set, so that each group of service device subsets includes one or more service devices with similar load conditions. When the service request to be processed is obtained, the target service device subset matching the service request can be determined according to the allocation weights corresponding to each group of service device subsets. Then the service request is allocated to the target service device in the target service device subset to perform the corresponding service operation. Since the target service subset includes multiple service devices, the number of service device subsets is much smaller than the number of service devices. By first allocating the service request to the target service device subset instead of directly allocating it to a specific service device, the amount of calculation in the allocation process is reduced, and the allocation efficiency of the service request is improved. And the service request is allocated to the corresponding target service device subset according to the allocation weight corresponding to each service device subset, so as to achieve reasonable allocation of the service request, so that the load balancing is satisfied between each service device subset. In this way, the business requests are first allocated to the target business device subset in a coarse-grained manner according to the direction of load balancing, and then the business requests are allocated to a target business device in the target business device subset. This can not only meet the load balancing when allocating business requests, but also does not require a large amount of load update calculations in real time, greatly reducing the amount of calculation and greatly improving the efficiency of business request allocation.

[0203] In one embodiment, a computer device is provided. The computer device may be a routing device, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to each business device. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a business request allocation method is implemented.

[0204] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0205] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0206] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0207] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0208] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0209] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0210] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A service request allocation method, characterized in that: The method comprises: Get pending business requests; Determine a plurality of groups of service device subsets obtained by dividing the service device set, wherein the plurality of groups of service device subsets are obtained by dividing based on idle resources of each service device in the service device set; Randomly determine a target allocation code corresponding to the service request from an allocation code set; the allocation code set includes allocation code subsets corresponding one-to-one to the plurality of service device subsets; Sorting the multiple allocation code subsets in the allocation code set, and polling the allocation code subsets corresponding to the respective ranking values ​​in sequence starting from the initial ranking value, until a target allocation code subset to which the target allocation code belongs is determined from the multiple allocation code subsets; taking a service device subset corresponding to the target allocation code subset among the multiple groups of service device subsets as a target service device subset matching the service request; Filtering target service devices from the target service device subset; The service request is allocated to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

2. The method according to claim 1, characterized in that The determining of a plurality of service device subsets obtained by dividing the service device set includes: Determine, within a current time period, available resource information corresponding to more than one service devices in the service device set; sorting each of the service devices according to the available resource information; According to a predetermined group division ratio, each sorted business device is divided into a corresponding group; wherein, business devices belonging to the same group together constitute a group of business device subsets.

3. The method according to claim 2, characterized in that The determining, within the current time period, available resource information corresponding to more than one service devices in the service device set includes: Determine the effective resource information corresponding to each service device in the service device set; In the current time period, collecting the current idle resource information corresponding to each service device in the service device set; According to the comparison value between the current idle resource information and the effective resource information, the available resource information corresponding to each of the service devices is determined.

4. The method according to claim 3, characterized in that The effective resource information includes the maximum number of accessible users, the maximum number of virtual rooms that can be applied for, the maximum inbound flow, and the maximum outbound flow; the current idle resource information includes the current number of accessible users, the current number of accessible virtual rooms, the current idle value of inbound flow, and the current idle value of outbound flow; The determining, according to a comparison value between the current idle resource information and the valid resource information, the available resource information corresponding to each of the service devices includes: Determine a corresponding first comparison value according to the current number of accessible users and the maximum number of accessible users corresponding to each service device respectively; Determine a corresponding second comparison value according to the current number of available virtual rooms and the maximum number of available virtual rooms corresponding to each service device; Determine a corresponding third comparison value according to the current idle value of inbound flow and the maximum inbound flow corresponding to each service device respectively; Determine a corresponding fourth comparison value according to the current outbound flow idle value and the outbound flow maximum value respectively corresponding to each service device; For each service device, the minimum value among the first comparison value, the second comparison value, the third comparison value and the fourth comparison value is respectively used as the available resource information corresponding to the corresponding service device.

5. The method according to claim 1, characterized in that The method further comprises: Determine the subset weight corresponding to each group of the service device subsets according to the idle resources of each service device in each group of the service device subsets; Determining a total set weight corresponding to the service device set according to the subset weights corresponding to each group of the service device subsets; The allocation weights corresponding to each group of service device subsets are determined according to the comparison values ​​of the subset weights corresponding to each group of service device subsets and the total weight of the set.

6. The method according to claim 1, characterized in that The quotient of the number of allocated codes of the allocated code subset and the total number of allocated codes of the allocated code set matches the allocation weight corresponding to the corresponding service equipment subset.

7. The method according to claim 6, characterized in that The step of sorting the multiple allocation code subsets in the allocation code set and polling the allocation code subsets corresponding to the respective sort values ​​in sequence starting from the initial sort value until a target allocation code subset to which the target allocation code belongs is determined from the multiple allocation code subsets includes: Sorting the plurality of allocation code subsets in the allocation code set to obtain a ranking value corresponding to each allocation code subset; Get the current sort value of the current poll; Determine a pre-order sorting value that is sorted before the current sorting value, and determine the total number of pre-order allocation codes of each allocation code subset corresponding to the pre-order sorting value; Taking the difference between the target allocation code and the total number of the preceding allocation codes as a value to be compared; When the value to be compared is greater than zero and less than the number of allocated codes of the allocated code subset corresponding to the current ranking value, determining that the allocated code subset corresponding to the current ranking value is the target allocated code subset to which the target allocated code belongs; Otherwise, the next sorting value after the current sorting value is used as the current sorting value for the next poll, and the step of determining the previous sorting value before the current sorting value is returned to continue execution.

8. The method according to claim 1, characterized in that: The screening of the target service device from the target service device subset includes: Determine the queue order of each service device in the target service device subset; The service device currently polled when polling is performed according to the queuing order is used as the current target service device.

9. The method according to claim 1, characterized in that: The allocating the service request to the target service device comprises: Acquire a target address corresponding to the target service device, and distribute the service request to the corresponding target service device according to the target address; The method further comprises: Determining the requested access address carried in the service request; Receiving operation data sent by the target service device and obtained when executing the service operation corresponding to the service request; In response to the service request, the operation data is fed back through the requested access address.

10. The method according to any one of claims 1 to 9, characterized in that: The service request to be processed includes a conference connection request, the service device includes a media proxy device, and the device resources of the service device include at least one of resources for implementing user access, resources for implementing virtual room application, and network traffic resources.

11. A service request allocation device, characterized in that: The device comprises: An acquisition module is used to obtain pending business requests; A first determination module is used to determine a plurality of service device subsets obtained by dividing a service device set, wherein the plurality of service device subsets are obtained by dividing based on idle resources of each service device in the service device set; The second determination module is used to randomly determine a target allocation code corresponding to the service request from an allocation code set; the allocation code set includes allocation code subsets corresponding to the multiple groups of service device subsets one by one; sort the multiple allocation code subsets in the allocation code set, and poll the allocation code subsets corresponding to the respective sort values ​​in sequence starting from an initial sort value until a target allocation code subset to which the target allocation code belongs is determined from the multiple allocation code subsets; and use the service device subset corresponding to the target allocation code subset in the multiple groups of service device subsets as the target service device subset matching the service request; A screening module, used for screening target service devices from the target service device subset; The allocation module is used to allocate the service request to the target service device; the target service device is used to execute the service operation corresponding to the allocated service request.

12. The device according to claim 11, characterized in that The first determination module is also used to: determine the available resource information corresponding to more than one business device in the business device set within the current time period; sort each of the business devices according to the available resource information; and divide each sorted business device into a corresponding group according to a predetermined group division ratio; wherein the business devices belonging to the same group together constitute a group of business device subsets.

13. The device according to claim 12, characterized in that The first determination module is also used to: determine the effective resource information corresponding to each business device in the business device set; collect the current idle resource information corresponding to each business device in the business device set within the current time period; and determine the available resource information corresponding to each of the business devices based on the comparison value between the current idle resource information and the effective resource information.

14. The device according to claim 13, characterized in that The effective resource information includes the maximum number of accessible users, the maximum number of virtual rooms that can be applied for, the maximum inbound flow, and the maximum outbound flow; the current idle resource information includes the current number of accessible users, the current number of accessible virtual rooms, the current idle value of inbound flow, and the current idle value of outbound flow; The first determination module is also used to determine a corresponding first comparison value according to the current number of accessible users and the maximum number of accessible users corresponding to each business device; determine a corresponding second comparison value according to the current number of virtual rooms that can be applied for and the maximum number of virtual rooms that can be applied for corresponding to each business device; determine a corresponding third comparison value according to the current idle value of incoming traffic and the maximum incoming traffic value corresponding to each business device; determine a corresponding fourth comparison value according to the current idle value of outgoing traffic and the maximum outgoing traffic value corresponding to each business device; for each business device, the minimum value among the first comparison value, the second comparison value, the third comparison value and the fourth comparison value is used as the available resource information corresponding to the corresponding business device.

15. The device according to claim 11, characterized in that The device also includes: The third determination module is used to determine the subset weight corresponding to each group of the business equipment subsets according to the idle resources of each business equipment in each group of the business equipment subsets; determine the total set weight corresponding to the business equipment set according to the subset weight corresponding to each group of the business equipment subsets; and determine the allocation weight corresponding to each group of the business equipment subsets according to the comparison value of the subset weight corresponding to each group of the business equipment subsets and the total set weight.

16. The device according to claim 11, characterized in that The quotient of the number of allocated codes of the allocated code subset and the total number of allocated codes of the allocated code set matches the allocation weight corresponding to the corresponding service equipment subset.

17. The device according to claim 16, characterized in that The second determination module is further used to sort the multiple allocation code subsets in the allocation code set to obtain the sorting values ​​corresponding to each allocation code subset; obtain the current sorting value of the current polling; determine the previous sorting value sorted before the current sorting value, and determine the total number of previous allocation codes of each allocation code subset corresponding to the previous sorting value; Taking the difference between the target allocation code and the total number of the preceding allocation codes as a value to be compared; When the value to be compared is greater than zero and less than the number of allocated codes of the allocated code subset corresponding to the current ranking value, determining that the allocated code subset corresponding to the current ranking value is the target allocated code subset to which the target allocated code belongs; Otherwise, the next sorting value after the current sorting value is used as the current sorting value for the next poll, and the step of determining the previous sorting value before the current sorting value is returned to continue execution.

18. The device according to claim 11, characterized in that The screening module is also used to determine the queuing order of each service device in the target service device subset; and use the service device currently polled when polling according to the queuing order as the current target service device.

19. The device according to claim 11, characterized in that The allocation module is also used to obtain a target address corresponding to the target service device, and allocate the service request to the corresponding target service device according to the target address; The device also includes: A feedback module is used to determine the request access address carried in the business request; receive operation data sent by the target business device and obtained when executing the business operation corresponding to the business request; and respond to the business request by feeding back the operation data through the request access address.

20. The device according to any one of claims 11 to 19, characterized in that The service request to be processed includes a conference connection request, the service device includes a media proxy device, and the device resources of the service device include at least one of resources for implementing user access, resources for implementing virtual room application, and network traffic resources.

21. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.

22. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Load balancing method and system of application services

    CN102611735A

  • Resource allocation method, device and system, equipment and medium

    CN110858161A