Request distribution method, device and storage medium

By dynamically allocating requests based on the load and resource usage of each physical machine packet, the problem of unbalanced load of physical machine packets in e-commerce applications is solved, and the service response rate and client call experience are improved.

CN113783912BActive Publication Date: 2025-02-25BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010866001.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-25
Publication Date
2025-02-25
Estimated Expiration
2040-08-25

AI Technical Summary

Technical Problem

In e-commerce applications, excessive server request calls result in unbalanced load on physical machine packets, resulting in low service response rate.

Method used

By obtaining the service source identification information carried by the request to be distributed, if the corresponding physical machine packet load is higher than the preset threshold, the target physical machine packet is determined based on the load and resource usage of each physical machine packet, and the request is distributed to the target physical machine.

Benefits of technology

It effectively improves the service response rate, avoids requests piled up into a single physical machine group, and ensures the client's call experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783912B_ABST
    Figure CN113783912B_ABST
Patent Text Reader

Abstract

The present application provides a request distribution method, device and storage medium, the method comprising: obtaining a request to be distributed, the request to be distributed carrying business source identification information; if the load of the physical machine group corresponding to the business source identification information is higher than a preset threshold, determining the target physical machine group according to the load and resource usage of each physical machine group; distributing the request to be distributed to the physical machines in the target physical machine group. When the load of the physical machine group corresponding to the business source identification information is higher than a preset threshold, the target physical machine group is determined according to the load and resource usage of each physical machine group, which is conducive to load balancing, thereby effectively improving the service response rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a request distribution method, device and storage medium. Background Art

[0002] In e-commerce applications, in order to solve the problem of extremely high request call volume in the server, the hierarchical application system will use the purpose and source of the request as the basis for distributing the request, and will configure the same physical machine grouping for interface call behaviors with the same characteristics. For example, the interface call behavior of the product details or product system is configured to the product group, and the interface call behavior of the clearing and settlement system is configured to the settlement group, and so on.

[0003] The limitation of the above technology is that physical machine groups need to be manually configured according to the purpose and source of the request. In an environment with fixed physical machine groups, reading and writing data from many same request sources can easily lead to a large number of requests being accumulated in a single physical machine group. If manual configuration is not timely, it will lead to a low service response rate. Summary of the invention

[0004] The present application provides a request distribution method, device and storage medium to effectively improve the service response rate.

[0005] In a first aspect, the present application provides a request distribution method, comprising:

[0006] Obtaining a request to be distributed, the request to be distributed carrying business source identification information;

[0007] If the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold, the target physical machine group is determined according to the load and resource usage of each physical machine group;

[0008] The request to be distributed is distributed to the physical machines in the target physical machine group.

[0009] In a possible implementation manner, determining the target physical machine grouping according to the load and resource usage of each physical machine grouping includes:

[0010] Determine the amount of resources consumed by each physical machine group to process the requests to be distributed;

[0011] The target physical machine grouping is determined based on the load of each physical machine grouping and its corresponding resource amount and resource usage.

[0012] In a possible implementation manner, the above-mentioned determining the amount of resources consumed by each physical machine group for processing the request to be distributed includes:

[0013] Obtain the performance degradation duration of the request to be distributed when it runs on each physical machine in the physical machine group;

[0014] Determine the average performance degradation duration corresponding to the physical machine group according to the performance degradation duration of each physical machine in the physical machine group;

[0015] The amount of resources consumed by the physical machine grouping for processing the requests to be distributed is determined according to the average duration of performance degradation corresponding to the physical machine grouping.

[0016] In a possible implementation manner, obtaining the performance degradation duration when the request to be distributed is run on each physical machine in the physical machine group includes:

[0017] According to the impact factor and the performance degradation time when the resource utilization of the physical machine in the previous cycle exceeds the preset resource utilization, the performance degradation time when the request to be distributed runs on each physical machine in the physical machine group is determined, where the impact factor is determined based on the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of requests successfully processed by the physical machine in unit time.

[0018] In a possible implementation, the request distribution method further includes:

[0019] Monitor the resource usage of physical machines;

[0020] Compare the resource usage of the physical machine during the current monitoring with the resource usage of the physical machine stored in the corresponding cache area to obtain the resource change of the physical machine;

[0021] If the resource change is outside the preset range, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

[0022] In a possible implementation, the request distribution method further includes:

[0023] If the load of the physical machine group corresponding to the service source identification information is lower than a preset threshold, the request to be distributed is distributed to the physical machines in the physical machine group corresponding to the service source identification information.

[0024] In a second aspect, the present application provides a request distribution device, comprising:

[0025] An acquisition module, used to acquire a request to be distributed, where the request to be distributed carries business source identification information;

[0026] A processing module, used to determine a target physical machine group according to the load and resource usage of each physical machine group when the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold;

[0027] The sending module is used to distribute the request to be distributed to the physical machines in the target physical machine group.

[0028] In a possible implementation manner, the processing module is specifically used for:

[0029] Determine the amount of resources consumed by each physical machine group to process the requests to be distributed;

[0030] The target physical machine grouping is determined based on the load of each physical machine grouping and its corresponding resource amount and resource usage.

[0031] In a possible implementation manner, when the processing module is used to determine the amount of resources consumed by each physical machine group to process the requests to be distributed, it is specifically used to:

[0032] Obtain the performance degradation duration of the request to be distributed when it runs on each physical machine in the physical machine group;

[0033] Determine the average performance degradation duration corresponding to the physical machine group according to the performance degradation duration of each physical machine in the physical machine group;

[0034] The amount of resources consumed by the physical machine grouping for processing the requests to be distributed is determined according to the average duration of performance degradation corresponding to the physical machine grouping.

[0035] In a possible implementation manner, when the processing module is used to obtain the performance degradation duration of the request to be distributed when it is running on each physical machine in the physical machine group, it is specifically used to:

[0036] According to the impact factor and the performance degradation time when the resource utilization of the physical machine in the previous cycle exceeds the preset resource utilization, the performance degradation time when the request to be distributed runs on each physical machine in the physical machine group is determined, wherein the impact factor is determined based on the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of requests successfully processed by the physical machine in unit time.

[0037] In a possible implementation manner, the processing module is further configured to:

[0038] Monitor the resource usage of physical machines;

[0039] Compare the resource usage of the physical machine during the current monitoring with the resource usage of the physical machine stored in the corresponding cache area to obtain the resource change of the physical machine;

[0040] If the resource change is outside the preset range, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

[0041] In a possible implementation manner, the processing module is further configured to:

[0042] If the load of the physical machine group corresponding to the service source identification information is lower than a preset threshold, the sending module is triggered to distribute the request to be distributed to the physical machines in the physical machine group corresponding to the service source identification information.

[0043] In a third aspect, the present application provides a communication device, including: a memory and a processor;

[0044] The memory is used to store program instructions;

[0045] The processor is used to call program instructions in the memory to execute the method as described in any one of the first aspects.

[0046] In a fourth aspect, the present application provides a communication system, comprising: a client, a distribution server, and a physical machine group, wherein the physical machine group includes at least one physical machine; wherein:

[0047] The client is used to send requests to the distribution server;

[0048] A distribution server, configured to execute the method according to any one of the first aspects;

[0049] A physical machine is used to process requests and send processing results to the client.

[0050] In a fifth aspect, the present application provides a readable storage medium having a computer program stored thereon; when the computer program is executed, the method as described in any one of the first aspects is implemented.

[0051] In a sixth aspect, the present application also provides a program product, which includes a computer program, the computer program is stored in a readable storage medium, a processor can read the computer program from the readable storage medium, and the processor executes the computer program to implement the method described in any one of the first aspects.

[0052] The present application provides a request distribution method, device and storage medium, the method comprising: obtaining a request to be distributed, the request to be distributed carrying business source identification information; if the load of the physical machine group corresponding to the business source identification information is higher than a preset threshold, determining the target physical machine group according to the load and resource usage of each physical machine group; distributing the request to be distributed to the physical machines in the target physical machine group. When the load of the physical machine group corresponding to the business source identification information is higher than a preset threshold, the target physical machine group is determined according to the load and resource usage of each physical machine group, which is conducive to load balancing, thereby effectively improving the service response rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a schematic diagram of a communication system provided by the present application;

[0054] Figure 2 A flowchart of a request distribution method provided in an embodiment of the present application;

[0055] Figure 3 A flowchart of a request distribution method provided by another embodiment of the present application;

[0056] Figure 4 A flowchart of a request distribution method provided in another embodiment of the present application;

[0057] Figure 5 A schematic diagram of the structure of a request distribution device provided in one embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of a communication device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0059] It should be understood that the "and / or" involved in the embodiments of the present application describes the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0060] Before introducing the technical solution of the present application, we first introduce the problems existing in the existing technology and the technical conception process of the present application in combination with a specific application scenario of the present application.

[0061] In e-commerce applications, in order to solve the problem of excessively high request calls in the server, the hierarchical application system will use the purpose and source of the request as the basis for distributing the request, and will assign the same physical machine group to the interface call behaviors with the same characteristics, such as configuring the interface call behavior of the product details or product system to the product group, and configuring the call interface behavior of the settlement system to the settlement group, etc. The limitation of this technology is that the physical machine group needs to be manually configured according to the purpose and source of the request, and manual diversion can only be performed by manually appending dynamic aliases. The service provider will distribute it after weighting the call situation, so the request source has a great weight in affecting the response speed during the service interface call process. For example, all requests of the caller will be distributed to multiple fixed physical machines. When the call volume suddenly increases and remains high, it is easy to cause a large number of requests to accumulate in a single physical machine group. If the manual configuration is not timely, it will lead to a low service response rate, an increase in service unavailability, and a poor caller experience. For example, during a big promotion, users will obviously make high-frequency calls to requests such as settlement and product details in a short period of time. Therefore, overloading the service group will only cause a bad experience for the client.

[0062] Therefore, the present application provides a request distribution method, device and storage medium to provide clients with flexible, on-demand interface services. Specifically, by dynamically combining existing system resources, the load situation is taken into account in the request distribution method, and then the request distribution scheme is modified to ensure that the request is distributed to the most suitable and fastest responding business processing server, effectively improving the service response rate to ensure the client's calling experience.

[0063] It is worth noting that, in the embodiment of the present application, the request distribution method is a process in which the request triggered by the user at the client is distributed by the distribution server to a specific business processing server.

[0064] For example, Figure 1 is a schematic diagram of a communication system provided by this application. Figure 1 As shown, the application scenario may include: at least one client ( Figure 1 Three clients are shown, namely, client 111, client 112, and client 113, a distribution server 12, and a business processing server 13. Each client can communicate with the distribution server 12 through a network, and the distribution server 12 can also communicate with the business processing server 13 through a network.

[0065] For example, when a user browses an e-commerce platform through the client 111, for example, the e-commerce platform can be browsed through the e-commerce APP installed in the client 111. The client 111 sends a request to the distribution server 12 through the network based on the user behavior. The distribution server 12 can determine the target physical machine group based on the business source identification information carried in the request and the load of the physical machine group, and further distribute the request to a business processing server 13 in the target physical machine group through the network, and the business processing server 13 processes it.

[0066] Among them, user behavior includes but is not limited to the behavior of purchasing goods, the behavior of adding goods to the shopping cart, the behavior of browsing product details, the behavior of generating orders, the behavior of settlement, etc. Taking the behavior of browsing product details as an example, if a user wants to browse the details of a certain mobile phone, the user clicks "Details" in the product page. In response to the user's click behavior, the client 111 sends a request to the distribution server 12 through the network. The distribution server 12 can determine the target physical machine group according to the business source identification information carried in the request and the load of the physical machine group, and further distribute the request to a business processing server 13 in the target physical machine group through the network. The business processing server 13 responds to the request and sends the details page to the client 111, and the client 111 displays the above details page to the user for the user to view.

[0067] It should be noted that Figure 1This is only a schematic diagram of an application scenario provided by the embodiment of the present application. Figure 1 does not limit the equipment included in Figure 1 The positional relationship between the devices in the Figure 1 In the application scenario shown, a data storage device may also be included, and the data storage device may be an external memory relative to the distribution server 12 and / or the business processing server 13, or an internal memory integrated in the distribution server 12 and / or the business processing server 13. In addition, the distribution server 12 and the business processing server 13 may be independent servers, or may be a service cluster, etc.

[0068] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0069] Figure 2 A flowchart of a request distribution method provided in an embodiment of the present application is shown in FIG. Figure 1 The distribution server in the communication system shown is explained as the execution subject. It should be clear that the execution subject of the request distribution method provided in the embodiment of the present application is not limited to the distribution server, and any communication device with a certain computing power can be used as the execution subject.

[0070] like Figure 2 As shown, the method comprises the following steps:

[0071] S201. Obtain a request to be distributed, where the request to be distributed carries business source identification information.

[0072] In actual applications, the client sends a request to the distribution server, and the distribution server distributes the request. There is at least one client. As for the request, it can be at least one request sent by one client, or multiple requests sent by multiple clients. For example, multiple clients send requests to the distribution server at the same time.

[0073] For example, during a big promotion, there are multiple clients that send requests for settlement at the same time. At this time, the distribution server will receive multiple requests at the same time. The distribution server can process multiple requests at the same time. However, considering that the distribution server has limited processing power, when the number of requests is particularly large and exceeds the processing power of the distribution server, the distribution server can store the requests in a stack in a first-in-first-out manner. In this way, the distribution server can obtain the requests to be distributed from the stack based on its processing power. It should be noted that the above-mentioned method of storing requests in the stack is only an example, and the embodiments of the present application are not limited to this.

[0074] S202: If the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold, determine a target physical machine group according to the load and resource usage of each physical machine group.

[0075] Among them, the request to be distributed carries the business source identification information, and different business source identification information corresponds to different physical machine groups, that is, there is a mapping relationship between the request to be distributed sent by the client and the physical machine group. Therefore, the physical machine group that processes the corresponding request can be determined by the business source identification information. However, this application takes into account the problem of load balancing. Before determining the target physical machine group, it is also necessary to judge the load of the physical machine group corresponding to the business source identification information. Only when the load of the physical machine group corresponding to the business source identification information is higher than the preset threshold, the target physical machine group will be determined based on the load and resource usage of each physical machine group.

[0076] In this step, when distributing requests, the distribution server determines the target physical machine grouping based on the load and resource usage of each physical machine grouping, thereby avoiding the problem of low service response rate caused by a large number of requests piling up in a single physical machine grouping, and ensuring that the requests are distributed to physical machine groups with faster responses.

[0077] It should be noted that the preset threshold can be set according to historical experience or actual needs and is not limited here.

[0078] Optionally, this step may be replaced by: determining that the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold; and determining the target physical machine group according to the load and resource usage of each physical machine group.

[0079] S203: Distribute the request to be distributed to the physical machines in the target physical machine group.

[0080] The physical machine group may include at least one physical machine, namely, a service processing server. The service processing server refers to a server that specifically processes a request. After processing the request, the service processing server feeds back the processing result to the corresponding client.

[0081] After determining the target physical machine group, the distribution server can distribute the request in a variety of implementations. For example, in one implementation, the distribution server randomly selects a physical machine in the target physical machine group to distribute the request; or, in another implementation, the distribution server selects a physical machine that meets a preset condition in the target physical machine group to distribute the request, etc. The preset condition may be that there are no requests queued in the business processing server, or the business processing server is in an idle state, that is, no request is being processed.

[0082] The request distribution method of the embodiment of the present application first obtains the request to be distributed, which carries the business source identification information; then, if the load of the physical machine group corresponding to the business source identification information is higher than the preset threshold, the target physical machine group is determined according to the load and resource usage of each physical machine group, and the request to be distributed is distributed to the physical machines in the target physical machine group. When the load of the physical machine group corresponding to the business source identification information is higher than the preset threshold, the target physical machine group is determined according to the load and resource usage of each physical machine group, which is conducive to load balancing, thereby effectively improving the service response rate.

[0083] In some embodiments, if the load of the physical machine group corresponding to the service source identification information is lower than a preset threshold, the request to be distributed is distributed to the physical machines in the physical machine group corresponding to the service source identification information.

[0084] like Figure 3 As shown, the request distribution method may include:

[0085] S301. Obtain a request to be distributed, where the request to be distributed carries business source identification information.

[0086] This step is similar to S201 and will not be described again here.

[0087] S302: Determine whether the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold.

[0088] If the load of the physical machine group corresponding to the service source identification information is higher than the preset threshold, execute S303; if the load of the physical machine group corresponding to the service source identification information is lower than the preset threshold, execute S305.

[0089] S303: Determine the target physical machine group according to the load and resource usage of each physical machine group.

[0090] S304: Distribute the request to be distributed to the physical machines in the target physical machine group.

[0091] This step is similar to S203 and will not be described again here.

[0092] S305: Distribute the request to be distributed to the physical machines in the physical machine group corresponding to the service source identification information.

[0093] In this embodiment, before determining the target physical machine grouping according to the load and resource usage of each physical machine grouping, first determine whether the load of the physical machine grouping corresponding to the business source identification information is higher than a preset threshold. Only when the load of the physical machine grouping corresponding to the business source identification information is higher than the preset threshold, determine the target physical machine grouping according to the load and resource usage of each physical machine grouping; when the load of the physical machine grouping corresponding to the business source identification information is lower than the preset threshold, distribute the request to be distributed to the physical machine in the physical machine grouping corresponding to the business source identification information, that is, distribute the request according to the existing request distribution process. By analyzing the load dynamics of each physical machine grouping in real time, the best physical machine grouping to which the request can be distributed is obtained.

[0094] On the basis of the above embodiments, optionally, determining the target physical machine grouping according to the load and resource usage of each physical machine grouping may include: determining the amount of resources consumed by each physical machine grouping to process the requests to be distributed; determining the target physical machine grouping according to the load of each physical machine grouping and its corresponding resource amount and resource usage.

[0095] Since the number of physical machines, hardware conditions and resource usage contained in each physical machine group are different, for the same request, different physical machine groups consume different amounts of resources when processing it. Therefore, when determining the target physical machine group, you can first determine the amount of resources consumed by each physical machine group to process the request to be distributed, and then further determine the target physical machine group based on the load of each physical machine group and its corresponding amount of resources and resource usage. For example, the load of each physical machine group in the next time period or cycle can be obtained through a calculation formula. For example, in minutes, a time period or cycle is agreed to be 1 minute.

[0096] In a specific implementation, determining the amount of resources consumed by each physical machine group in processing requests to be distributed may include: obtaining the performance degradation duration when the requests to be distributed are running on each physical machine in the physical machine group; determining the average performance degradation duration corresponding to the physical machine group based on the performance degradation duration of each physical machine in the physical machine group; determining the amount of resources consumed by the physical machine group in processing the requests to be distributed based on the average performance degradation duration corresponding to the physical machine group.

[0097] For example, the performance degradation duration of the request to be distributed when it runs on each physical machine in the physical machine group is obtained by the following formula:

[0098]

[0099]

[0100] Among them, T jIt represents the time when the overall performance of server j is degraded when the resource utilization of server j in the previous cycle exceeds the preset resource utilization; Sum(i) represents the total duration of performance degradation when the request i to be distributed runs on N physical machines in a certain physical machine group; E(i) represents the average duration of performance degradation corresponding to the physical machine group.

[0101] By combining the various indicators of the servers in each group and the load range they can bear under normal conditions, the server with the largest difference from the calculated result is the available load machine, ensuring that each request has a tailor-made group and machine, breaking the constraints of traditional fixed grouping and manual switching.

[0102] Furthermore, obtaining the duration of performance degradation when the request to be distributed is running on each physical machine in the physical machine group may include: determining the duration of performance degradation when the request to be distributed is running on each physical machine in the physical machine group according to the impact factor and the performance degradation time when the resource utilization of the physical machine in the previous cycle exceeds the preset resource utilization. Among them, the impact factor is determined based on the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of requests successfully processed by the physical machine per unit time. Correcting and updating the distribution results in combination with the impact factor can ensure that the distribution results are not accumulated to a certain extent, which can not only ensure the calling experience of the downstream client, but also improve the response speed.

[0103] Optionally, the impact factor has a value range of (0,1).

[0104] Figure 4 A flowchart of a request distribution method provided by another embodiment of the present application. Figure 4 , the request distribution method may include the following steps:

[0105] S401: Monitor resource usage of a physical machine.

[0106] S402: Compare the resource usage of the physical machine during the current monitoring with the resource usage of the physical machine stored in the corresponding cache area to obtain resource changes of the physical machine.

[0107] S403: If the resource change is outside the preset range, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

[0108] After the distribution server is powered on, the physical machine grouping information and the resource information of each physical machine in the physical machine group are initialized and stored in the cache area. The distribution server monitors the resource usage and resource changes of the physical machines in each physical machine group in real time to prepare for rapid analysis.

[0109] The resource usage includes the following two situations:

[0110] In the first case, if the resource change is within a reasonable range, that is, the resource change is within the preset range, no operation is performed and the content of the cache area is not updated;

[0111] In the second case, if the resource change is not within a reasonable range, that is, the resource change is within the preset range, resource data such as memory, disk space, CPU, etc. are extracted and stored in the cache area, that is, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

[0112] It should also be noted that the present application does not limit the execution order between S401 to S403 and the steps in the above embodiments.

[0113] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0114] Figure 5 This is a schematic diagram of the structure of a request distribution device provided in an embodiment of the present application. The present application provides a request distribution device, which can be integrated on a communication device such as a server, or the device can be integrated on a chip of a communication device, or the device can also be a communication device. Figure 5 As shown, the request distribution device 50 includes: an acquisition module 51, a processing module 52 and a sending module 53. Among them:

[0115] The acquisition module 51 is used to acquire the request to be distributed, wherein the request to be distributed carries the business source identification information.

[0116] The processing module 52 is used to determine the target physical machine group according to the load and resource usage of each physical machine group when the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold.

[0117] The sending module 53 is used to distribute the request to be distributed to the physical machines in the target physical machine group.

[0118] In a specific implementation, the processing module 52 may be specifically used for:

[0119] Determine the amount of resources consumed by each physical machine group to process the requests to be distributed;

[0120] The target physical machine grouping is determined based on the load of each physical machine grouping and its corresponding resource amount and resource usage.

[0121] Furthermore, when the processing module 52 is used to determine the amount of resources consumed by each physical machine group to process the requests to be distributed, it is specifically used to:

[0122] Obtain the performance degradation duration of the request to be distributed when it runs on each physical machine in the physical machine group;

[0123] Determine the average performance degradation duration corresponding to the physical machine group according to the performance degradation duration of each physical machine in the physical machine group;

[0124] The amount of resources consumed by the physical machine grouping for processing the requests to be distributed is determined according to the average duration of performance degradation corresponding to the physical machine grouping.

[0125] In some embodiments, when the processing module 52 is used to obtain the performance degradation duration when the request to be distributed is running on each physical machine in the physical machine group, it can be specifically used to: determine the performance degradation duration when the request to be distributed is running on each physical machine in the physical machine group according to the impact factor and the performance degradation time when the resource utilization of the physical machine exceeds the preset resource utilization in the previous cycle. Among them, the impact factor is determined based on the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of the physical machine successfully processing requests per unit time.

[0126] Based on the above, the processing module 52 can also be used for:

[0127] Monitor the resource usage of physical machines;

[0128] Compare the resource usage of the physical machine during the current monitoring with the resource usage of the physical machine stored in the corresponding cache area to obtain the resource change of the physical machine;

[0129] If the resource change is outside the preset range, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

[0130] Optionally, the processing module 52 is further used to: when the load of the physical machine group corresponding to the service source identification information is lower than a preset threshold, trigger the sending module 53 to distribute the request to be distributed to the physical machines in the physical machine group corresponding to the service source identification information.

[0131] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0132] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0133] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0134] Figure 6 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present application. Figure 6 As shown, the communication device may include: a processor 61, a memory 62, a communication interface 63 and a system bus 64. The memory 62 and the communication interface 63 are connected to the processor 61 through the system bus 64 and communicate with each other. The memory 62 is used to store program instructions, the communication interface 63 is used to communicate with other devices, and the processor 61 is used to call the program instructions in the memory to execute the solution described in the above method embodiment.

[0135] Should Figure 6The system bus mentioned in the specification may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage.

[0136] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP for short), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0137] like Figure 1 As an example, an embodiment of the present application further provides a communication system, including: a client, a distribution server, and a physical machine group, wherein the physical machine group includes at least one physical machine; wherein:

[0138] The client is used to send requests to the distribution server;

[0139] A distribution server, used to execute the method described in the above method embodiment;

[0140] A physical machine is used to process requests and send processing results to the client.

[0141] Optionally, an embodiment of the present application further provides a readable storage medium, in which a computer program is stored. When the computer program is executed, the method described in the above method embodiment is implemented.

[0142] Optionally, an embodiment of the present application further provides a chip for executing instructions, wherein the chip is used to execute the method described in the above method embodiment.

[0143] An embodiment of the present application also provides a program product, which includes a computer program stored in a readable storage medium. At least one processor can read the computer program from the readable storage medium, and when the at least one processor executes the computer program, the method described in the above method embodiment can be implemented.

[0144] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0145] It is to be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A request distribution method, characterized in that: include: Obtaining a request to be distributed, where the request to be distributed carries business source identification information; If the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold, then determining the amount of resources consumed by each physical machine group in processing the request to be distributed according to the performance degradation duration when the request to be distributed is processed on each physical machine in each physical machine group; The performance degradation duration is determined according to the impact factor and the performance degradation time when the resource utilization of the physical machine in the previous cycle exceeds the preset resource utilization, the impact factor is determined according to the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of requests successfully processed by the physical machine in a unit time; Determine the target physical machine grouping according to the resource amount and resource usage corresponding to each physical machine grouping and the load of each physical machine grouping in the next time period or the next cycle obtained based on a preset formula; The request to be distributed is distributed to the physical machines in the target physical machine group.

2. The method according to claim 1, characterized in that The determining, according to a performance degradation duration when the request to be distributed is processed on each physical machine in each physical machine group, an amount of resources consumed by each physical machine group in processing the request to be distributed includes: Obtaining a performance degradation duration when the request to be distributed is processed on each physical machine in each physical machine group; Determine the average performance degradation duration corresponding to each physical machine group according to the performance degradation duration of each physical machine in each physical machine group; The amount of resources consumed by each physical machine group in processing the request to be distributed is determined according to the average duration of performance degradation corresponding to each physical machine group.

3. The method according to claim 1 or 2, characterized in that: Also includes: Monitor the resource usage of physical machines; Compare the resource usage of the physical machine during the current monitoring with the resource usage of the physical machine stored in the corresponding cache area to obtain the resource change of the physical machine; If the resource change is outside the preset range, the resource usage of the physical machine stored in the cache area is updated to the resource usage of the physical machine obtained by the current monitoring.

4. The method according to claim 1 or 2, characterized in that: Also includes: If the load of the physical machine group corresponding to the service source identification information is lower than a preset threshold, the request to be distributed is distributed to the physical machine in the physical machine group corresponding to the service source identification information.

5. A request distribution device, characterized in that: include: An acquisition module, used to acquire a request to be distributed, wherein the request to be distributed carries business source identification information; a processing module, configured to determine, when the load of the physical machine group corresponding to the service source identification information is higher than a preset threshold, an amount of resources consumed by each physical machine group in processing the request to be distributed according to a performance degradation duration when the request to be distributed is processed on each physical machine in each physical machine group; The performance degradation duration is determined according to the impact factor and the performance degradation time when the resource utilization of the physical machine in the previous cycle exceeds the preset resource utilization, the impact factor is determined according to the request response time of the physical machine and the availability of the physical machine, and the availability of the physical machine is used to indicate the proportion of requests successfully processed by the physical machine in a unit time; Determine the target physical machine grouping according to the resource amount and resource usage corresponding to each physical machine grouping and the load of each physical machine grouping in the next time period or the next cycle obtained based on a preset formula; The sending module is used to distribute the request to be distributed to the physical machines in the target physical machine group.

6. A communication device, characterized in that: include: Memory and processor; The memory is used to store program instructions; The processor is configured to call program instructions in the memory to execute the method according to any one of claims 1 to 4.

7. A communication system, characterized in that: include: A client, a distribution server and a physical machine group, wherein the physical machine group includes at least one physical machine; wherein: The client is used to send a request to the distribution server; The distribution server is used to execute the method according to any one of claims 1 to 4; The physical machine is used to process the request and send the processing result to the client.

8. A readable storage medium, characterized in that: The readable storage medium stores a computer program; when the computer program is executed, the method according to any one of claims 1 to 4 is implemented.

9. A computer program product comprising: A computer program, characterized in that when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and system for processing request message as well as load balancer equipment

    CN102075409A

  • Task distributing method and scanner

    CN103699443A

  • Load balancing method, load balancer and load balancing system

    CN107026907A