Request processing method and system

By introducing a dynamic weight push mechanism between the server and consumer, the task processing node generates a weight based on the current status and feeds it back to the allocation node. This solves the problem that the server cannot know the processing status in a timely manner, achieves load balancing and fault isolation, and improves request processing efficiency.

CN115686840BActive Publication Date: 2026-03-27ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, the server cannot know the current processing status of other servers in a timely manner, resulting in low request processing efficiency.

Method used

By introducing a dynamic weight push mechanism between the server and consumer, the task processing node generates task processing weights based on the current processing status and feeds them back to the allocation node, so that the allocation node can accurately allocate requests based on the weights, thereby achieving load balancing and fault isolation.

Benefits of technology

It improves request processing efficiency, avoids unlimited resource consumption expansion, quickly converges faults, and reduces the impact on users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686840B_ABST
    Figure CN115686840B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a request processing method and system, wherein the request processing method is applied to a request processing system, the system comprises an allocation node and at least two task processing nodes, the method comprises: the allocation node receives at least two to-be-processed requests and receives a task response message sent by the at least two task processing nodes, the task response message carries a task processing weight; and based on the task processing weight and the at least two to-be-processed requests, a corresponding to-be-processed request set is allocated to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes; the first task processing node processes the to-be-processed request in the received to-be-processed request set, updates the task processing weight according to the current processing state information in the task processing process, and sends the updated task processing weight to the allocation node based on the task response message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a request processing method. Background Technology

[0002] With the continuous development of Internet technology, after receiving a request, a server may need to call other servers to process the request. When the server distributes the request to other servers, in order to improve the efficiency of request processing, a load balancing method will be adopted, allocating the corresponding request to each server according to its current processing status.

[0003] In existing technologies, the server monitors the current processing status of other servers. However, this method suffers from latency, which prevents the server from knowing the current processing status of other servers in a timely manner, thus reducing request processing efficiency. Summary of the Invention

[0004] In view of the above, embodiments of this specification provide a request processing method. One or more embodiments of this specification also relate to a request processing system, two other request processing methods, two request processing apparatuses, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a request processing method is provided, applied to a request processing system, the system including an allocation node and at least two task processing nodes, the method comprising:

[0006] The allocation node receives at least two pending requests and receives task response messages sent by the at least two task processing nodes, the task response messages carrying task processing weights; and

[0007] Based on the task processing weight and the at least two pending requests, a corresponding set of pending requests is assigned to the first task processing node among the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes;

[0008] The first task processing node processes the pending requests in the received pending request set, updates the task processing weight according to the current processing status information during the task processing, and sends the updated task processing weight to the allocation node based on the task response message.

[0009] According to a second aspect of the embodiments of this specification, a request processing system is provided, the system including an allocation node and at least two task processing nodes, wherein...

[0010] The allocation node is configured to receive at least two to-be-processed requests, and receive a task response message sent by the at least two task processing nodes, wherein the task response message carries a task processing weight; and

[0011] Based on the task processing weight and the at least two to-be-processed requests, a corresponding to-be-processed request set is allocated to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes.

[0012] The first task processing node is configured to perform task processing on the to-be-processed requests in the received to-be-processed request set, update the task processing weight according to current processing state information in the task processing process, and send the updated task processing weight to the allocation node based on the task response message.

[0013] According to a third aspect of an embodiment of the present specification, a request processing method applied to a task processing node is provided, including:

[0014] generating a task response message based on a task processing weight, and sending the task response message to an allocation node;

[0015] receiving a to-be-processed request set determined by the allocation node for the task processing node, wherein the to-be-processed request set is determined by the allocation node based on the task processing weight and at least two to-be-processed requests received;

[0016] performing task processing on the to-be-processed requests in the received to-be-processed request set, and updating the task processing weight according to current processing state information in the task processing process;

[0017] sending the updated task processing weight to the allocation node based on the task response message.

[0018] According to a fourth aspect of an embodiment of the present specification, a request processing device applied to a task processing node is provided, including:

[0019] a first sending module configured to generate a task response message based on a task processing weight, and send the task response message to an allocation node;

[0020] a receiving module configured to receive a to-be-processed request set determined by the allocation node for the task processing node, wherein the to-be-processed request set is determined by the allocation node based on the task processing weight and at least two to-be-processed requests received;

[0021] The processing module is configured to perform task processing on the to-be-processed request in the received to-be-processed request set, and update the task processing weight according to current processing state information in the task processing process;

[0022] The second sending module is configured to send the updated task processing weight to the allocation node based on the task response message.

[0023] According to a fifth aspect of the embodiments of the present specification, a request processing method is provided, applied to an allocation node, comprising:

[0024] receiving at least two to-be-processed requests, and receiving task response messages sent by at least two task processing nodes, wherein the task response message carries a task processing weight;

[0025] allocating a corresponding to-be-processed request set for a first task processing node in the at least two task processing nodes based on the task processing weight and the at least two to-be-processed requests, wherein the first task processing node is one of the at least two task processing nodes.

[0026] According to a sixth aspect of the embodiments of the present specification, a request processing device is provided, applied to an allocation node, comprising:

[0027] The receiving module is configured to receive at least two to-be-processed requests, and receive task response messages sent by at least two task processing nodes, wherein the task response message carries a task processing weight;

[0028] The allocation module is configured to allocate a corresponding to-be-processed request set for a first task processing node in the at least two task processing nodes based on the task processing weight and the at least two to-be-processed requests, wherein the first task processing node is one of the at least two task processing nodes.

[0029] According to a seventh aspect of the embodiments of the present specification, a computing device is provided, comprising:

[0030] a memory and a processor;

[0031] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions, which realize the steps of the above request processing method when executed by the processor.

[0032] According to an eighth aspect of the embodiments of the present specification, a computer readable storage medium is provided, which stores computer executable instructions, which realize the steps of the above request processing method when executed by the processor.

[0033] According to a ninth aspect of an embodiment of the present specification, a computer program is provided, which, when executed in a computer, causes the computer to perform the steps of the above request processing method.

[0034] The request processing method provided by an embodiment of the present specification is applied to a request processing system, the system comprising an allocation node and at least two task processing nodes, the method comprising: the allocation node receiving at least two to-be-processed requests and receiving a task response message sent by the at least two task processing nodes, the task response message carrying a task processing weight; and based on the task processing weight and the at least two to-be-processed requests, assigning a corresponding to-be-processed request set to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes; the first task processing node performing task processing on the to-be-processed request in the received to-be-processed request set, updating the task processing weight according to the current processing state information in the task processing process, and sending the updated task processing weight to the allocation node based on the task response message.

[0035] Specifically, the task processing node of the method will actively send the task processing weight determined according to the current processing state information in the task processing process to the allocation node; and the allocation node will quickly and accurately determine the current processing state of each task processing node based on the task processing weight, avoiding the problem of delay; and when receiving a to-be-processed request, the allocation node will assign the to-be-processed request to the corresponding task processing node based on the current processing state of each task processing node, improving the request processing efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is a request allocation schematic diagram provided by an embodiment of the present specification;

[0037] Figure 2 is an application schematic diagram of a request processing method provided by an embodiment of the present specification;

[0038] Figure 3 is a flowchart of a request processing method provided by an embodiment of the present specification;

[0039] Figure 4 is a concurrent speed-up change schematic diagram of an abnormal server in a request processing method provided by an embodiment of the present specification;

[0040] Figure 5 is a concurrent number change schematic diagram of a request processing method provided by an embodiment of the present specification under different functions;

[0041] Figure 6is a processing process schematic diagram of a request processing method provided by one embodiment of the present specification;

[0042] Figure 7 is a schematic diagram of single machine concurrency number in a request processing method provided by one embodiment of the present specification;

[0043] Figure 8 is a flow chart of another request processing method provided by one embodiment of the present specification;

[0044] Figure 9 is a flow chart of still another request processing method provided by one embodiment of the present specification;

[0045] Figure 10 is a structural schematic diagram of a request processing system provided by one embodiment of the present specification;

[0046] Figure 11 is a structural block diagram of a computing device provided by one embodiment of the present specification. DETAILED DESCRIPTION

[0047] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples, set forth in this description. Those skilled in the art, in light of the description, can implement the present specification without limiting to the specific details disclosed in this description.

[0048] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0049] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, without departing from the scope of one or more embodiments of the present specification, first can be termed second; likewise, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining." Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining."

[0050] First, the noun terms related to one or more embodiments of the present specification are explained.

[0051] Service concurrency: the number of requests being processed by the server at a given moment.

[0052] Request rate: the total number of requests sent in a given period of time.

[0053] Response speed: the time taken for a single request to be processed from start to finish.

[0054] Load balancing: selecting the best address from multiple addresses through an algorithm, which can achieve maximum utilization of all address resources when the request volume reaches a certain level.

[0055] With the continuous development of Internet technology, a server may need to call other servers to process the request after receiving the request; and in order to improve the request processing efficiency, the server will adopt load balancing when distributing requests to other servers according to the current processing state of each server. For example, for most micro-service applications, a service provided by a server often needs to be a consumer and rely on several other services to process the requests received by itself, and services that expose data management capabilities to the outside world mostly need to rely on databases for processing. Referring to Figure 1 , Figure 1 is a request distribution diagram of an order service provided by an embodiment of the present specification; based on Figure 1 Part A, the order server relies on a service of the inventory server for inventory deduction, and the inventory server needs to rely on a database for data persistence. Among them, QPS is the request rate, and the ms is the response speed. However, in the production environment, due to slow processing from the database, network jitter and other problems may cause the service provided by the inventory server to be blocked, and the instantaneous concurrency may increase significantly, causing serious pressure on the machine, and even causing the service to crash. Referring to Figure 1 Part B, it can be known that Figure 1 Part B of the present specification is a request processing situation in a scenario where the database has a slow processing problem. When the database connection of the inventory server A has a problem, a single request needs 2000ms to process, which will cause the instantaneous concurrency of the inventory server A to reach 840, that is, the dashed line part in the figure, causing the order service upstream to rise from 80 concurrency to 880 concurrency, and the processing time of half of the user requests reaches more than 2100ms, which brings adverse factors to the user's request experience or the stability of the entire system. Therefore, it can be known that for most micro-service applications, if the service processing performance fluctuates, the instantaneous concurrency of the server will increase instantaneously due to the overall request processing slowing down, directly leading to service unavailability and even service avalanche and other consequences.

[0056] Based on this, this manual provides three solutions to the problem of instantaneous concurrency growth caused by server-side blocking: a solution without setting limits, a solution with a maximum concurrency limit, and a solution for load balancing and scheduling from the client's perspective.

[0057] However, all of the above solutions may lead to server-side blocking and a sudden surge in concurrency. The solution of setting a maximum concurrency limit means that the server rejects new requests when the instantaneous concurrency reaches a certain limit. This solution sacrifices a certain number of successful requests to ensure the overall performance of the application. Rejecting new requests after reaching the limit will result in a poor user experience.

[0058] Another approach is to impose no restrictions, allowing concurrency to increase without limit. This unrestricted approach involves continuously scaling up the processing pool to meet the increased concurrency demands when concurrency in a single service rises. Because there are no limits on scaling, this puts pressure on the provider when request concurrency increases. As this pressure rises, the overall processing time for all services also increases. When concurrency reaches a certain level, this can potentially lead to memory overflow in the processes. Figure 1 As shown in Part C, setting the maximum concurrency to 100 results in approximately 352 requests being rejected per second, ensuring that the overall concurrency across the application is not particularly high. There are two ways to limit maximum concurrency: one is for each service to have its own dedicated concurrency limit, and the other is for multiple services to share a single limit. With the dedicated concurrency limit, if the limit is too high, it can still lead to memory overflow issues when multiple services are blocked. If the limit is too low, it is unsuitable for some I / O-intensive services. In the shared mode, if one service is blocked, other services in the same service group will also be unable to receive new requests, affecting normal requests. Dedicated concurrency limits are generally not used by default; support is only provided based on custom configurations. Therefore, the maximum concurrency limit scheme has two major drawbacks: first, it can cause a decrease in the number of successful requests, resulting in a poor user experience; second, limiting abnormal services can also affect normal services, expanding the impact.

[0059] The third approach is load balancing from the client's perspective. This involves using metrics such as response time from the consumer to select the optimal server at the individual consumer machine level. Common algorithms include the minimum active number algorithm and the fastest response algorithm. However, these algorithms only schedule traffic from the perspective of a single consumer machine and cannot provide timely and efficient information about the actual performance of each server. Furthermore, algorithms like minimum active number and fastest response rely on cluster machine configurations and similar metrics to function effectively, making them prone to misjudgments in complex, mixed-distribution scenarios.

[0060] Based on this, in the present specification, a request processing method is provided, and the present specification also relates to a request processing system, another request processing method, a request processing device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0061] Referring to Figure 2 , Figure 2 An application schematic diagram of a request processing method provided according to one embodiment of the present specification is shown, and it should be noted that the request processing method provided in the present specification adopts a dynamic weight pushing manner, and reduces the calling speed of a problematic server through weight scheduling in a case where the maximum concurrency number does not exceed an expectation. On the premise of avoiding directly throwing an exception to disturb a user, it can be ensured that the pressure of a single server does not exceed an upper limit. Based on this, referring to Figure 2 , the request processing method provided in the present specification adds a data channel for pushing a weight size from a server to a consumer in a calling link between an order server (which can be used as a consumer) and an inventory server. When the load of the server is high, the inventory server can push a degradation weight determined according to the load of the server to the consumer through the data channel, and the consumer uses the new weight to distribute order requests when the consumer initiates a call to multiple inventory servers based on an order request sent by a client next time, so as to reduce the number of requests received by a server with a high load or an exception, and realize load balancing. Based on this, the request processing method provided in the present specification aims to realize intelligent flow scheduling of a cluster by reversely pushing an adaptive degradation weight from a server, realize service degradation isolation of an abnormal single machine node, prevent unlimited expansion of resource occupation, achieve rapid fault convergence, and greatly reduce the influence on a user.

[0062] Referring to Figure 3 , Figure 3 An application flowchart of a request processing method provided according to one embodiment of the present specification is shown, and the request processing method is applied to a request processing system, the system includes an allocation node and at least two task processing nodes, and the method specifically includes the following steps.

[0063] Step 302: The allocation node receives at least two to-be-processed requests, and receives a task response message sent by the at least two task processing nodes, the task response message carrying a task processing weight; and based on the task processing weight and the at least two to-be-processed requests, a corresponding to-be-processed request set is allocated to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes.

[0064] The task processing node can be understood as a node capable of processing a to-be-processed request. The task processing node can be a task processing server, for example, the above-mentioned inventory server, logistics server, etc. The server can be one or more servers. The allocation node can be understood as a server capable of allocating a to-be-processed request received or generated by itself to a task processing node associated with it. The allocation node can also be referred to as a consumer. For example, the allocation node can be the order server. The order server can receive an order request sent by a user through a user terminal. The to-be-processed request can be understood as a user request sent by a user to the allocation node, for example, an order request, a data acquisition request, etc. Alternatively, the to-be-processed request can also be understood as a request generated by the allocation node according to the user request sent by the user. For example, after the user sends a shopping order request to it, the order server needs to send a deduction inventory request to the inventory server after processing the shopping order request, so as to call the service of the inventory server to deduct the inventory quantity of the commodity. Avoid the problem that the user cannot obtain the commodity after ordering due to the fact that the inventory quantity is not reduced after the commodity is sold out. The to-be-processed request set can be understood as a set composed of a specific number of to-be-processed requests.

[0065] The task response message can be understood as a message sent by the task processing node to the allocation node through a data channel between the task processing node and the allocation node. The message carries a task processing weight.

[0066] The task processing weight can be understood as a parameter representing the request processing capability of the task processing node itself. The parameter can be any value in a value interval, for example, any value in the value interval [0, 1] or [0, 100]. That is, the task processing node generates a task processing weight according to the current task processing information in the task processing process of the task processing node itself. The task processing weight is used to represent the information of the task processing situation of the task processing node itself. It should be noted that in the request processing method provided in the present specification, the task processing weight is calculated by the task processing node and fed back to the allocation node. Thus, the feedback channel from the server to the consumer is opened through the weight reverse pushing mode, which provides feasibility for the self-protection of the server.

[0067] The request processing method is described below in the application of the e-commerce scenario. The allocation node is the order server, the task processing node is the inventory server, the to-be-processed request is the deduction inventory request, and the task processing weight can be the weight corresponding to each inventory server. Based on this, the inventory server determines its weight according to the current processing state information in the current deduction inventory processing process of itself. Then, a weight adjustment message is generated based on the weight information, and the weight adjustment message is sent to the order server.

[0068] The order service receives the weight adjustment message sent by each inventory service end, and determines the weight of each inventory service end from the weight adjustment message. In the case of receiving a shopping order processing request for a commodity sent by a user through a client, a deduction inventory request for the commodity is generated, wherein the number of the shopping order processing request is consistent with the number of the deduction inventory request. Then, the order service end allocates a certain number of deduction inventory requests to each inventory service end according to the weight of each inventory service end, and sends the deduction inventory request to the corresponding inventory service end. That is, the request processing method provided in the specification uses the weight pushing method of the inventory service end to feedback the pressure information of the inventory service end, avoids the problem of reducing the service success rate caused by directly rejecting the request, and ensures that the normal service can continue to process, and isolates the fault in a single service.

[0069] In an embodiment provided in the specification, the request processing method provided in the specification determines the corresponding number of to-be-processed requests for each task processing node according to the task processing weight representing the current processing state of each task processing node during the request allocation process, and allocates the to-be-processed requests to the corresponding task processing node, so as to realize the load balancing of the task processing node and realize the intelligent flow scheduling of the cluster. Specifically, the first task processing node in the at least two task processing nodes allocates a corresponding to-be-processed request set, which includes:

[0070] The allocation node determines the request set information corresponding to the first task processing node in the at least two task processing nodes based on the task processing weight of the first task processing node.

[0071] Based on the request set information and the at least two to-be-processed requests, the to-be-processed request set corresponding to the first task processing node is constructed, and the to-be-processed request set is sent to the first task processing node.

[0072] The request set information can be understood as information for constructing the request set information, for example, the request set information can be the number of to-be-processed requests that each task processing node needs to allocate.

[0073] Specifically, the determination of the request set information corresponding to the first task processing node based on the task processing weight of the first task processing node in the at least two task processing nodes includes:

[0074] The allocation node determines the first task processing node in the at least two task processing nodes, and determines the task processing weight of the first task processing node.

[0075] determine the request processing quantity of the first task processing node based on the request quantity of the at least two to-be-processed requests, the node quantity of the at least two task processing nodes, and the task processing weight, and determine the request processing quantity as the request set information.

[0076] Specifically, in order to achieve load balancing of the task processing nodes and intelligent flow scheduling of the cluster, the allocation node needs to first determine a first task processing node from the at least two task processing nodes, and then determine the task processing weight of the first task processing node from the task processing weight recorded by the allocation node.

[0077] Then, the allocation node needs to determine the request quantity of the at least two to-be-processed requests and the node quantity of the at least two task processing nodes, and then calculate the request processing quantity of the to-be-processed requests that needs to be allocated to the task processing weight based on the request quantity, the node quantity, and the task processing weight of the first task processing node, and determine the request processing quantity as the request set information required for constructing the to-be-processed request set.

[0078] In the above example, the order server needs to determine the weight of the inventory server A in the process of determining the request quantity that needs to be allocated to the inventory server. Then, the total number of deduction inventory requests and the total number of inventory servers are determined. Based on the weight of the inventory server A, the total number of deduction inventory requests, and the total number of inventory servers, the request quantity that needs to be allocated to the inventory server A is calculated. In actual application, the request quantity can be calculated by the following formula (1).

[0079]

[0080] Wherein, A represents the total request rate of the order server (consumer), that is, the order quantity, B represents the total number of inventory servers. DeWeight represents the weight of each inventory server. The request quantity allocated to each inventory server can be referred to as the request rate of the inventory server. Among them, the normal inventory server can be understood as the inventory server with a weight of 1, and the abnormal inventory server can be understood as the inventory server with a weight less than 1. Based on this, the request rate H of the abnormal inventory server is degraded to The request rate of the normal server is

[0081] It should be noted that the request processing method provided in the specification determines the request quantity that needs to be allocated to each task processing node through the weight provided by the task processing node. Based on this, the above request rate parameter can obtain the abnormal server concurrent function, as shown in the following formula (2).

[0082]

[0083] Wherein, J represents the concurrent number of abnormal service end; MaxCon is a preset concurrent number threshold, referred to as the maximum action concurrent number; MinCon is a preset concurrent number threshold, referred to as the minimum action concurrent number; wherein MaxCon is greater than MinCon.

[0084] For convenience of calculation, it is assumed that the minimum action concurrent number can be 200, and the maximum action concurrent number can be 400, and the abnormal service end concurrent function (formula 2) can be simplified as the following formula (3).

[0085]

[0086] Based on the above abnormal service end concurrent function, the concurrent speed change of the abnormal service end can be calculated, see Figure 4 , Figure 4 is a schematic diagram of the concurrent speed change of the abnormal service end provided by an embodiment of the present specification. Based on Figure 4 It can be known that after the total request rate A reaches 400 and the concurrent number reaches 200, the concurrent speed change of the abnormal service end becomes slow, and finally converges near the maximum concurrent number 400.

[0087] Specifically, the first task processing node corresponding to the to-be-processed request set is constructed based on the request set information and the at least two to-be-processed requests, comprising:

[0088] The allocation node obtains the target to-be-processed request corresponding to the request processing number of the first task processing node from the at least two to-be-processed requests.

[0089] The first task processing node corresponding to the to-be-processed request set is constructed based on the target to-be-processed request, wherein the to-be-processed request set contains the target to-be-processed request.

[0090] Specifically, after determining the request processing number of the first task processing node, the allocation node obtains the to-be-processed request corresponding to the request processing number of the first task processing node from the at least two to-be-processed requests, and takes the to-be-processed request as the target to-be-processed request to be allocated to the first task processing node; then the first task processing node corresponding to the to-be-processed request set is constructed based on the target to-be-processed request, the to-be-processed request set contains the target to-be-processed request, and the to-be-processed request set is sent to the first task processing node, so as to prevent the resource occupation from expanding infinitely, achieve fast fault convergence, and greatly reduce the influence on the user.

[0091] In the request processing method provided in the specification, the to-be-processed request is a to-be-processed order;

[0092] Correspondingly, the assigning, for a first task processing node of the at least two task processing nodes, a corresponding set of to-be-processed requests based on the task processing weight and the at least two to-be-processed requests comprises:

[0093] The assigning node assigns, for a first order processing node of the at least two order processing nodes, a corresponding set of to-be-processed orders based on the order task processing weight and the at least two to-be-processed orders.

[0094] The to-be-processed order can be understood as a commodity order that needs to be processed, and the order processing node can be understood as a server capable of processing the commodity order. The server can be one or more servers.

[0095] The assigning node can be understood as a server that assigns the to-be-processed order to the order task processing node.

[0096] In the above example, the assigning node is an order assigning server, and the first order processing node can be a commodity order processing server. Based on this, when the commodity order server load is high, the commodity order server can determine a degradation weight according to its own load condition and push the degradation weight to the order assigning server. The order assigning server will use this new weight to distribute commodity orders when it initiates a call to multiple commodity order processing servers based on commodity order requests sent by the client next time, thereby reducing the number of requests received by servers with high load or abnormality and achieving load balancing.

[0097] Step 304: The first task processing node processes the to-be-processed request in the received set of to-be-processed requests, updates the task processing weight according to the current processing state information in the task processing process, and sends the updated task processing weight to the assigning node based on the task response message.

[0098] The current processing state information can be understood as information representing the current processing state of the first task processing node, or as information representing the current load condition of the server. For example, the current processing state information can be the current concurrency number of the first task processing node, the memory occupancy rate of the first task processing node, the CPU (Central Processing Unit) occupancy rate, etc.

[0099] In the case of a to-be-processed request being a deduction inventory request, the task processing of the to-be-processed request can be understood as deducting the commodity inventory data stored in the database associated with the first task processing node based on the deduction inventory request.

[0100] Specifically, the task processing weight is updated according to the current processing state information in the task processing process, including:

[0101] The first task processing node monitors the current processing state information in the task processing process.

[0102] In a case where it is determined that the current processing state information meets a preset weight update condition, the task processing weight is updated based on the current processing state information and a preset weight update parameter.

[0103] It should be noted that the current processing state information can be a current request concurrency number, based on which the determination that the current processing state information meets the preset weight update condition includes:

[0104] In a case where it is determined that the current request concurrency number is greater than or equal to a preset minimum request concurrency threshold, the first task processing node determines that the current processing state information meets the preset weight update condition.

[0105] The preset minimum request concurrency threshold can be understood as a preset value, which can be used by the first task processing node to determine the load condition of itself. For example, the preset minimum request concurrency threshold MinCon. If the concurrency number of the current server is less than the minimum action concurrency number, no weight degradation is performed, and the current server weight and other normal server weights remain the same. If the concurrency number of the current server is higher than the minimum action concurrency number, the weight of the current server needs to be recalculated, so as to check the load condition of the current server in real time, and prevent the request from occupying unlimited expansion to the server.

[0106] It should be noted that the current processing state information is current processing resource information; the current processing resource can be understood as a resource required by the first task processing node for task processing, for example, CPU resource, memory resource, etc. The current processing resource information can be understood as information representing the use condition of the current processing resource, for example, CPU utilization, memory utilization, etc. Based on this, the determination that the current processing state information meets the preset weight update condition includes:

[0107] In a case where it is determined that the current processing resource information is greater than or equal to a preset resource threshold, the first task processing node determines that the current processing state information meets the preset weight update condition.

[0108] The preset resource threshold can be understood as a preset value, which can be used by the first task processing node to determine the load condition of itself. For example, the CPU utilization threshold is 90%.

[0109] With the above example, the request processing method provided by the present specification can detect the CPU utilization of the inventory server in real time. If it is determined that the CPU utilization of the inventory server is greater than or equal to the preset CPU utilization threshold, it is determined that the inventory server is in a load state, and the weight of the inventory server needs to be adjusted. Thus, the load state of the inventory server can be checked in real time, and the influence of the request on the server caused by unlimited expansion can be prevented.

[0110] Specifically, the first task processing node in the request processing method provided by the present specification can monitor the current processing state information in the task processing process in real time. If it is determined that the current processing state information meets the preset weight update condition, the task processing weight of the first task processing node can be updated based on the current processing state information and the preset weight update parameter.

[0111] The current processing state information is the current request concurrency number, and the preset weight update parameter includes a preset minimum request concurrency threshold and a preset maximum request concurrency threshold. Based on this, the task processing weight is updated based on the current processing state information and the preset weight update parameter, which includes:

[0112] The first task processing node determines the preset minimum request concurrency threshold and the preset maximum request concurrency threshold.

[0113] Based on the preset minimum request concurrency threshold, the preset maximum request concurrency threshold, and the current request concurrency number, the updated task weight information is obtained, and the task weight information is replaced based on the updated task weight information.

[0114] The preset maximum request concurrency threshold can be understood as a preset value, which can be used by the first task processing node to determine the load state of the first task processing node. The preset maximum request concurrency threshold is greater than the preset minimum request concurrency threshold. It should be noted that the request processing method provided by the present specification designs two adjustment factors, namely the minimum action concurrency number MinCon and the maximum action concurrency number MaxCon, a push data (degraded weight DeWeight), and a self-defined adjustment curve. In actual application, if the concurrency number of the current server is less than the minimum action concurrency number, no weight degradation is performed, and the current server weight is consistent with the weight of other normal servers. Moreover, the task processing node dynamically controls the weight value of the task processing node in the cluster between the minimum action concurrency number and the maximum action concurrency number, provides the ability of fault shielding when the task processing node is abnormal, and realizes the disaster recovery of the service cluster. Through the calculation and update of the weight of the server, the optimal solution of traffic scheduling between multiple discrete servers is achieved when there is a single point exception.

[0115] If the current concurrency of the service end is higher than the minimum action concurrency, the degradation weight is determined according to the current concurrency, and the degradation weight is pushed to the consumer end, and the degradation weight decreases with the increase of the current concurrency. The decreasing trend in this decreasing process is controlled by a self-defined adjustment curve, which can be a linear function curve, or can be adjusted to a quadratic function, a cubic function, etc. With the increase of the number of functions, the convergence speed of the performance of the service end is also faster.

[0116] In the above example, before the minimum action concurrency is reached, the processing rate of the service end is consistent with the foregoing case, but after the minimum action concurrency is reached, the weight of the service end needs to be degraded, so the inventory service end needs to determine the pre-set minimum action concurrency and maximum action concurrency, and then recompute the degradation weight of the service end based on the minimum action concurrency, the maximum action concurrency and the current concurrency. The service end performs capacity assessment based on the current concurrency, so that the weight value pushed has quasi-real-time performance, avoiding information lag. Wherein, the degradation weight can be determined according to the following formula (4).

[0117]

[0118] It should be noted that, for the convenience of description, the self-defined adjustment curve adopts a linear function. But also a quadratic function or a tenth function. See Figure 5 , Figure 5 is a schematic diagram of the change of concurrency under different functions provided by an embodiment of the present specification for a request processing method. Figure 5 is the fitting curve of the concurrency growth when the self-defined adjustment curve is a linear function, a quadratic function and a tenth function; based on Figure 5 It can be seen that, with the increase of the number of functions, the concurrency is less affected by the request rate, and the protection efficiency of the service end is also higher. In addition, when the current concurrency reaches the maximum action concurrency, the degradation weight is 0, which means that no request is accepted, and the current concurrency of the machine is always less than the maximum action concurrency.

[0119] The task processing node in the request processing method provided by the present specification will actively send the task processing weight determined according to the current processing state information in the task processing process to the allocation node; and the allocation node will quickly and accurately determine the current processing state of each task processing node based on the task processing weight, avoiding the problem of delay; and when receiving a to-be-processed request, the to-be-processed request will be allocated to the corresponding task processing node based on the current processing state of each task processing node, improving the request processing efficiency.

[0120] The following is combined with the accompanying Figure 6With reference to the application of the request processing method provided in the specification in the order processing scenario, the request processing method is further described. In this case, Figure 6 A schematic diagram of the processing procedure of a request processing method provided in an embodiment of the specification is shown; wherein the order server (i.e. the consumer side) can receive a commodity order provided by a user, and in the process of processing the commodity order in the order server, in order to avoid the problem that after the commodity is sold out, the user cannot obtain the commodity due to the fact that the inventory quantity is not reduced. The order server needs to send a deduction inventory request to the inventory server (i.e. the server corresponding to the consumer side), so as to deduct the inventory quantity of the commodity by calling the service of the inventory server. Based on this, the process of the order server calling the deduction inventory service provided by the inventory server through the deduction inventory request is as follows.

[0121] It should be noted that, Figure 6 The total request rate of the order server is A qps, the total number of inventory servers is B (B>1), the response speed of the normal inventory server is C ms, and the response speed of the abnormal inventory server is D ms (D>C). Based on this, it can be determined that the request rate of each inventory server before the weight adjustment is The number of concurrent normal inventory servers is The number of concurrent abnormal inventory servers is

[0122] Based on this, with reference to Figure 6 , B is 2, C is 50, D is 2000, which represents a total of 4 inventory servers, the response speed of the normal inventory server is 50 ms, and the response speed of the abnormal inventory server is 2000 ms. It can be obtained that the concurrent number growth function of the normal inventory server is The concurrent number growth function of the abnormal inventory server is With reference to Figure 7 , Figure 7 is a schematic diagram of the single machine concurrency number in a request processing method provided in an embodiment of the specification; the Figure 7 is obtained by substituting the above concurrent number growth function. As shown in Figure 7 , even if the total request rate reaches 8000 QPS, the single machine concurrency number of the normal inventory server is only 100, while the concurrency number of the abnormal inventory server has reached 4000, which is far beyond the concurrency range limit that a general server can bear. Based on this, after the current concurrency number of the server reaches the minimum action concurrency number MinCon, the degradation weight of the abnormal inventory server is determined by the formula , and the degradation weight is sent to the order server.

[0123] In order to prevent unlimited expansion of resource occupation, achieve rapid fault convergence, and greatly reduce the impact on users, the order server sends a deduction inventory request to multiple inventory servers. According to the weight provided by the inventory server to represent its own load condition, the request rate of each inventory server is determined. Specifically, the degradation weight is substituted into the formula , the request rate of the abnormal inventory server is determined, that is, the number of deduction inventory requests allocated to the abnormal server, and the corresponding number of deduction inventory requests is sent to the abnormal inventory server. The request processing method provided by the present specification reduces the impact by dynamically sensing and calculating the delay and timely degrading the problematic server. Referring to Figure 6 , by reducing the weight ratio of the problematic and non-problematic inventory service providers from 1:1 to 10.5:1, the average delay and delay of user-side requests are greatly optimized, and the high concurrency on the whole link is also relieved.

[0124] It should be noted that for the above-mentioned unlimited scheme, the scheme of setting the maximum concurrent limit, and the client perspective load balancing scheduling scheme, the request processing method provided by the present specification defines the minimum action concurrency and the maximum action concurrency two adjustment factors, limits the maximum concurrency, and fundamentally solves the problem of unlimited expansion of resource occupation in the unlimited scheme. In addition, by means of weight pushing and self-defined adjustment curve, the request proportion distribution of the consumer end is adjusted, and the direct request processing is avoided. By transferring the request target, the impact on user experience is reduced. At the same time, since the abnormal server does not reject all request processing, the normal service in the abnormal server can also normally receive requests, achieving abnormal shielding between services. In addition, the performance calculation of the server itself is relatively real-time and accurate, and the self-flow limiting of the server perspective can ensure the efficiency and correctness of the degradation isolation.

[0125] In summary, the request processing method provided by the present specification protects the concurrency of the server from the perspective of the server, and greatly optimizes and improves the single server, abnormal service, normal service, cluster overall stability, and user experience.

[0126] Referring to Figure 8 , Figure 8 application flowchart of another request processing method provided by an embodiment of the present specification is shown, which is applied to a task processing node. The method specifically includes the following steps.

[0127] Step 802: generate a task response message based on the task processing weight, and send the task response message to the allocation node.

[0128] Step 804: receiving a set of to-be-processed requests determined by the distribution node for the task processing node, wherein the set of to-be-processed requests is determined by the distribution node based on the task processing weight and the received at least two to-be-processed requests.

[0129] Step 806: processing the to-be-processed requests in the received set of to-be-processed requests, and updating the task processing weight according to the current processing state information in the task processing process.

[0130] Step 808: sending the updated task processing weight to the distribution node based on the task response message.

[0131] For the explanation of the other request processing method, please refer to the corresponding or corresponding contents in the above-mentioned one request processing method, which will not be described here.

[0132] The other request processing method provided by the present specification applied to the task processing node will actively send the task processing weight determined according to the current processing state information in the task processing process to the distribution node; and the distribution node will quickly and accurately determine the current processing state of each task processing node based on the task processing weight, avoiding the problem of delay; and when receiving the to-be-processed request, it will be based on the current processing state of each task processing node to distribute the to-be-processed request to the corresponding task processing node, improving the request processing efficiency.

[0133] The above is a schematic scheme of the other request processing method of the present embodiment. It should be noted that the technical scheme of the other request processing method belongs to the same concept as the technical scheme of the above-mentioned one request processing method, and the details of the technical scheme of the other request processing method which are not described in detail can be referred to the description of the technical scheme of the above-mentioned one request processing method.

[0134] Referring to Figure 9 , Figure 9 An application flowchart of still another request processing method according to an embodiment of the present specification is shown, which is applied to a distribution node, and the method specifically includes the following steps.

[0135] Step 902: receiving at least two to-be-processed requests and receiving task response messages sent by at least two task processing nodes, wherein the task response message carries a task processing weight.

[0136] Step 904: based on the task processing weight and the at least two to-be-processed requests, assigning a corresponding set of to-be-processed requests to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes.

[0137] For the explanation of the still another request processing method, reference can be made to the corresponding or corresponding contents in the above-mentioned one request processing method and another request processing method, which will not be described herein again.

[0138] The another request processing method applied to the distribution node provided in the specification receives the task processing weight determined by the task processing node according to the current processing state information in the task processing process, and quickly and accurately determines the current processing state of each task processing node based on the task processing weight, so as to avoid the problem of delay. When receiving the to-be-processed request, the to-be-processed request is distributed to the corresponding task processing node based on the current processing state of each task processing node, so as to improve the request processing efficiency.

[0139] The above is a schematic scheme of the still another request processing method of the embodiment. It should be noted that the technical scheme of the still another request processing method belongs to the same concept as the technical scheme of the above-mentioned one request processing method. The details of the technical scheme of the still another request processing method which are not described in detail can be referred to the description of the technical scheme of the above-mentioned one request processing method.

[0140] Corresponding to the method embodiment, the specification also provides a request processing system embodiment, Figure 10 The structure schematic diagram of a request processing system provided by one embodiment of the specification is shown. As shown in the figure, Figure 10 The system includes a distribution node 1002 and at least two task processing nodes 1004, wherein,

[0141] The distribution node 1002 is configured to receive at least two to-be-processed requests and receive the task response message sent by the at least two task processing nodes 1004, wherein the task response message carries a task processing weight; and

[0142] Based on the task processing weight and the at least two to-be-processed requests, a corresponding to-be-processed request set is distributed to a first task processing node 1004 in the at least two task processing nodes 1004, wherein the first task processing node 1004 is one of the at least two task processing nodes 1004.

[0143] The first task processing node 1004 is configured to process the to-be-processed request in the received to-be-processed request set, update the task processing weight according to the current processing state information in the task processing process, and send the updated task processing weight to the distribution node 1002 based on the task response message.

[0144] Optionally, the allocation node 1002 is further configured to determine request set information corresponding to a first task processing node 1004 among the at least two task processing nodes 1004 based on a task processing weight of the first task processing node 1004.

[0145] Based on the request set information and the at least two pending requests, a pending request set corresponding to the first task processing node 1004 is constructed, and the pending request set is sent to the first task processing node 1004.

[0146] Optionally, the allocation node 1002 is further configured to determine a first task processing node 1004 among the at least two task processing nodes 1004 and determine a task processing weight of the first task processing node 1004.

[0147] Based on the number of requests of the at least two pending requests, the number of nodes of the at least two task processing nodes 1004, and the task processing weight, a request processing number of the first task processing node 1004 is determined, and the request processing number is taken as request set information.

[0148] Optionally, the allocation node 1002 is further configured to obtain a target pending request corresponding to the request processing number of the first task processing node 1004 from the at least two pending requests.

[0149] Based on the target pending request, a pending request set corresponding to the first task processing node 1004 is constructed, wherein the target pending request is included in the pending request set.

[0150] Optionally, the first task processing node 1004 is further configured to monitor current processing state information in the task processing process.

[0151] In a case where it is determined that the current processing state information satisfies a preset weight update condition, the task processing weight is updated based on the current processing state information and a preset weight update parameter.

[0152] Optionally, the current processing state information is a current request concurrency number, and the preset weight update parameter includes a preset minimum request concurrency threshold and a preset maximum request concurrency threshold.

[0153] Correspondingly, the first task processing node 1004 is further configured to determine the preset minimum request concurrency threshold and the preset maximum request concurrency threshold.

[0154] Based on the preset minimum request concurrency threshold, the preset maximum request concurrency threshold and the current request concurrency number, obtain updated task weight information, and replace the task weight information based on the updated task weight information.

[0155] Optionally, the current processing state information is a current request concurrency number.

[0156] Correspondingly, the first task processing node 1004 is further configured to determine that the current processing state information meets a preset weight update condition if it is determined that the current request concurrency number is greater than or equal to a preset minimum request concurrency threshold.

[0157] Optionally, the current processing state information is current processing resource information.

[0158] Correspondingly, the first task processing node 1004 is further configured to determine that the current processing state information meets a preset weight update condition if it is determined that the current processing resource information is greater than or equal to a preset resource threshold.

[0159] Optionally, the to-be-processed request is a to-be-processed order.

[0160] Correspondingly, the allocation node 1002 is further configured to allocate a corresponding set of to-be-processed orders to a first order processing node in the at least two order processing nodes based on order task processing weights and the at least two to-be-processed orders.

[0161] The task processing node of the request processing system provided in the specification actively sends the task processing weight determined according to the current processing state information in the task processing process to the allocation node. The allocation node quickly and accurately determines the current processing state of each task processing node based on the task processing weight, avoiding the problem of delay. When receiving a to-be-processed request, the allocation node allocates the to-be-processed request to the corresponding task processing node based on the current processing state of each task processing node, improving the request processing efficiency.

[0162] The above is a schematic scheme of a request processing system according to an embodiment. It should be noted that the technical scheme of the request processing system and the technical scheme of the request processing method described above belong to the same concept. The details of the technical scheme of the request processing system that are not described in detail can be referred to the description of the technical scheme of the request processing method.

[0163] Corresponding to the method embodiments described above, the specification also provides another request processing device embodiment. The request processing device is applied to a task processing node and includes:

[0164] The first sending module is configured to generate a task response message based on the task processing weight, and send the task response message to the allocation node.

[0165] The receiving module is configured to receive a set of to-be-processed requests determined by the allocation node for the task processing node, wherein the set of to-be-processed requests is determined by the allocation node based on the task processing weight and at least two received to-be-processed requests.

[0166] The processing module is configured to process the to-be-processed requests in the received set of to-be-processed requests, and update the task processing weight according to current processing state information in the task processing process.

[0167] The second sending module is configured to send the updated task processing weight to the allocation node based on the task response message.

[0168] The application provided by the specification provides another request processing device for a task processing node, which actively sends a task processing weight determined according to current processing state information in a task processing process to an allocation node; the allocation node quickly and accurately determines the current processing state of each task processing node based on the task processing weight, thereby avoiding the problem of delay; and when receiving a to-be-processed request, the allocation node allocates the to-be-processed request to a corresponding task processing node based on the current processing state of each task processing node, thereby improving the request processing efficiency.

[0169] The above is a schematic scheme of another request processing device of the embodiment. It should be noted that the technical scheme of the another request processing device belongs to the same concept as the technical scheme of the another request processing method described above, and the details of the technical scheme of the another request processing device that are not described in detail can be referred to the description of the technical scheme of the another request processing method.

[0170] Corresponding to the method embodiment, the specification also provides another request processing device embodiment. The request processing device is applied to an allocation node and includes:

[0171] The receiving module is configured to receive at least two to-be-processed requests and receive task response messages sent by at least two task processing nodes, wherein the task response messages carry task processing weights.

[0172] The allocation module is configured to allocate a corresponding set of to-be-processed requests to a first task processing node in the at least two task processing nodes based on the task processing weights and the at least two to-be-processed requests, wherein the first task processing node is one of the at least two task processing nodes.

[0173] The application provided by the specification is another request processing device applied to a distribution node. The task processing weight determined by a task processing node according to current processing state information in a task processing process is received, and the current processing state of each task processing node is quickly and accurately determined based on the task processing weight, so as to avoid the problem of delay. When a to-be-processed request is received, the to-be-processed request is distributed to the corresponding task processing node based on the current processing state of each task processing node, and the request processing efficiency is improved.

[0174] The above is a schematic scheme of another request processing device of the embodiment. It should be noted that the technical scheme of the another request processing device belongs to the same concept as the technical scheme of the another request processing method described above, and the details of the technical scheme of the another request processing device not described in detail can be referred to the description of the technical scheme of the another request processing method.

[0175] Figure 11 A structural block diagram of a computing device 1100 according to an embodiment of the specification is shown. The components of the computing device 1100 include, but are not limited to, a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 through a bus 1130, and a database 1150 is used to save data.

[0176] The computing device 1100 also includes an access device 1140, which enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include the public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0177] In an embodiment of the specification, the above-mentioned components of the computing device 1100 and other components not shown in the Figure 11 may be connected to each other, for example, through a bus. It should be understood that Figure 11 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the specification. Other components can be added or replaced as needed by those skilled in the art.

[0178] The computing device 1100 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. The computing device 1100 can also be a mobile or stationary server.

[0179] The processor 1120 is configured to execute computer-executable instructions to perform the steps of the request processing method described above.

[0180] The above is a schematic solution of the computing device according to the embodiment. It should be noted that the technical solution of the computing device and the technical solution of the request processing method described above belong to the same concept, and the details of the technical solution of the computing device that are not described in detail can be referred to the description of the technical solution of the request processing method.

[0181] An embodiment of the present specification further provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the request processing method described above.

[0182] The above is a schematic solution of the computer-readable storage medium according to the embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the request processing method described above belong to the same concept, and the details of the technical solution of the storage medium that are not described in detail can be referred to the description of the technical solution of the request processing method.

[0183] An embodiment of the present specification further provides a computer program, which, when executed in a computer, causes the computer to perform the steps of the request processing method described above.

[0184] The above is a schematic solution of the computer program according to the embodiment. It should be noted that the technical solution of the computer program and the technical solution of the request processing method described above belong to the same concept, and the details of the technical solution of the computer program that are not described in detail can be referred to the description of the technical solution of the request processing method.

[0185] The above-described embodiments of the application have several aspects, no single one of which is solely responsible for the application's desirable attributes. Without limiting the scope of the application as expressed by the claims which follow, some further embodiments make these aspects even more useful. Other embodiments can result in less desirable attributes.

[0186] The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate contents according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0187] It should be noted that for the foregoing method embodiments, the acts described therein can be performed in a different order from the order described, and that some acts can be performed in parallel or concurrently. In addition, some acts can be performed by different entities than the ones described. Furthermore, some acts can be performed by the same entity using different resources. In some embodiments, the acts described can be performed by a single entity.

[0188] In the above embodiments, the description of each embodiment is focused on, and the part not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0189] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and do not limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. The present specification selects and describes these embodiments in order to better explain the principles and practical application of the embodiments of the present specification, so that those skilled in the art can well understand and use the present specification. The present specification is limited by the claims and their full scope and equivalents.

Claims

1. A request processing method applied to a request processing system, the system comprising an allocation node and at least two task processing nodes, the method comprising: receiving, by the allocation node, at least two pending requests and receiving task response messages sent by the at least two task processing nodes, the task response messages carrying task processing weights generated by the task processing nodes according to current task processing information in a task processing process of the task processing nodes; and allocating, based on the task processing weights and the at least two pending requests, a corresponding set of pending requests to a first task processing node of the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes, the set of pending requests is determined according to request set information and the at least two pending requests, and the request set information is determined according to the task processing weights, for determining the number of pending requests to be allocated to each of the task processing nodes; processing, by the first task processing node, the pending requests in the set of pending requests received, updating the task processing weights according to current processing state information in the task processing process, wherein the first task processing node dynamically controls the task processing weights in the cluster based on a self-defined adjustment curve between a preset minimum request concurrency threshold and a preset maximum request concurrency threshold, the self-defined adjustment curve is less affected by the request rate as the function order rises, the protection efficiency of the task processing node is higher, and the updated task processing weights are sent to the allocation node based on the task response messages. 2.The request processing method of claim 1, wherein the allocating, based on the task processing weights and the at least two pending requests, a corresponding set of pending requests to a first task processing node of the at least two task processing nodes comprises: determining, by the allocation node, request set information corresponding to the first task processing node based on the task processing weights of the first task processing node of the at least two task processing nodes; constructing a set of pending requests corresponding to the first task processing node based on the request set information and the at least two pending requests, and sending the set of pending requests to the first task processing node. 3.The request processing method of claim 2, wherein the determining, based on the task processing weights of the first task processing node of the at least two task processing nodes, request set information corresponding to the first task processing node comprises: determining, by the allocation node, the first task processing node of the at least two task processing nodes and the task processing weights of the first task processing node; determining a request processing number of the first task processing node based on the number of requests of the at least two pending requests, the number of nodes of the at least two task processing nodes, and the task processing weights, and taking the request processing number as the request set information.

4. The request processing method of claim 3, wherein the constructing the set of pending requests corresponding to the first task processing node based on the request set information and the at least two pending requests comprises: obtaining, by the allocation node, a target pending request from the at least two pending requests, the target pending request corresponding to a number of requests to be processed by the first task processing node; and constructing the set of pending requests corresponding to the first task processing node based on the target pending request, wherein the set of pending requests includes the target pending request.

5. The request processing method of claim 1, wherein the updating the task processing weight based on the current processing state information of the task processing process comprises: monitoring, by the first task processing node, the current processing state information of the task processing process; and updating, by the first task processing node, the task processing weight based on the current processing state information and a preset weight update parameter, in a case where the current processing state information satisfies a preset weight update condition.

6. The request processing method of claim 5, wherein the current processing state information is a current request concurrency number, and the preset weight update parameter includes a preset minimum request concurrency threshold and a preset maximum request concurrency threshold; and wherein the updating the task processing weight based on the current processing state information and the preset weight update parameter comprises: determining, by the first task processing node, the preset minimum request concurrency threshold and the preset maximum request concurrency threshold; and obtaining, by the first task processing node, updated task weight information based on the preset minimum request concurrency threshold, the preset maximum request concurrency threshold, and the current request concurrency number, and replacing the task weight information with the updated task weight information.

7. The request processing method of claim 5, wherein the current processing state information is a current request concurrency number; and wherein the determining that the current processing state information satisfies the preset weight update condition comprises: determining, by the first task processing node, that the current processing state information satisfies the preset weight update condition, in a case where the current request concurrency number is greater than or equal to a preset minimum request concurrency threshold.

8. The request processing method of claim 5, wherein the current processing state information is current processing resource information; and wherein the determining that the current processing state information satisfies the preset weight update condition comprises: determining, by the first task processing node, that the current processing state information satisfies the preset weight update condition, in a case where the current processing resource information is greater than or equal to a preset resource threshold.

9. The request processing method of claim 1, wherein the pending request is a pending order; and wherein the allocating a set of pending requests corresponding to a first task processing node of the at least two task processing nodes based on the task processing weight and the at least two pending requests comprises: ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ The distribution node allocates a set of to-be-processed orders corresponding to a first order processing node among the at least two order processing nodes to the first order processing node based on the order task processing weight and the at least two to-be-processed orders.

10. A request processing method applied to a task processing node, comprising: generating a task response message based on a task processing weight and sending the task response message to a distribution node; receiving a set of to-be-processed requests determined by the distribution node for the task processing node, wherein the set of to-be-processed requests is determined by the distribution node based on the task processing weight and at least two to-be-processed requests received, wherein the task processing weight is generated by the task processing node according to current task processing information in a task processing process of the task processing node, and the set of to-be-processed requests is determined according to request set information and the at least two to-be-processed requests, the request set information being used to determine a number of to-be-processed requests required to be allocated to each of the task processing nodes; processing the to-be-processed requests in the set of to-be-processed requests received, and updating the task processing weight according to current processing state information in the task processing process, wherein the task processing node dynamically controls the task processing weight of the task processing node in a cluster based on a self-defined adjustment curve between a preset minimum request concurrency threshold and a preset maximum request concurrency threshold, the self-defined adjustment curve being less affected by a request rate as a function order increases, and the protection efficiency of the task processing node being higher. sending the updated task processing weight to the distribution node based on the task response message.

11. A request processing method applied to a distribution node, comprising: receiving at least two to-be-processed requests and receiving task response messages sent by at least two task processing nodes, wherein the task response messages carry task processing weights, and the task processing weights are generated by the task processing nodes according to current task processing information in a task processing process of the task processing nodes; allocating a set of to-be-processed requests corresponding to a first task processing node among the at least two task processing nodes to the first task processing node based on the task processing weights and the at least two to-be-processed requests, wherein the first task processing node is one of the at least two task processing nodes, the set of to-be-processed requests is determined according to request set information and the at least two to-be-processed requests, the request set information being used to determine a number of to-be-processed requests required to be allocated to each of the task processing nodes, and the first task processing node dynamically controls the task processing weight of the first task processing node in a cluster based on a self-defined adjustment curve between a preset minimum request concurrency threshold and a preset maximum request concurrency threshold, the self-defined adjustment curve being less affected by a request rate as a function order increases, and the protection efficiency of the task processing node being higher.

12. A request processing system, comprising a distribution node and at least two task processing nodes, wherein The allocation node is configured to receive at least two to-be-processed requests and receive a task response message sent by the at least two task processing nodes, the task response message carrying a task processing weight, wherein the task processing weight is generated by the task processing node according to current task processing information in a task processing process of the task processing node; and Based on the task processing weight and the at least two to-be-processed requests, a corresponding to-be-processed request set is allocated to a first task processing node in the at least two task processing nodes, wherein the first task processing node is one of the at least two task processing nodes, the to-be-processed request set is determined according to request set information and the at least two to-be-processed requests, and the request set information is used to determine a number of to-be-processed requests required to be allocated to each task processing node; The first task processing node is configured to process the to-be-processed requests in the received to-be-processed request set and update the task processing weight according to current processing state information in the task processing process, wherein the first task processing node dynamically controls the task processing weight of the first task processing node in the cluster based on a self-defined adjustment curve between a preset minimum request concurrency threshold and a preset maximum request concurrency threshold, the self-defined adjustment curve is less affected by a request rate on a current request concurrency number as a function number rises, and the protection efficiency of the task processing node is higher, and the updated task processing weight is sent to the allocation node based on the task response message.

13. A computing device comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, and the computer executable instructions, when executed by the processor, implement the request processing method in claim 10 or the steps of the request processing method in claim 11.

14. A computer readable storage medium storing computer executable instructions, the computer executable instructions, when executed by a processor, implement the request processing method in claim 10 or the steps of the request processing method in claim 11.

15. A computer program product, characterised in that, computer instructions, the computer instructions, when executed by a processor, implement the request processing method in claim 10 or the steps of the request processing method in claim 11.

Citation Information

Patent Citations

  • A dynamic load balancing method of Nginx based on WebSocket long connection

    CN109308221A

  • Load balancing method, load balancing device, processing system and storage medium

    CN115150399A