Flow control method and device, electronic equipment and computer readable medium
By determining the flow control node and total traffic upper limit in the transaction orchestration cluster, and adjusting the traffic upper limit of the target node, the problem of processing performance degradation and transaction blocking caused by excessive node access traffic is solved, and the processing efficiency of the cluster is improved.
Patent Information
- Application Number
- CN202411083845.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The existing distributed implementation method of transaction orchestration cannot effectively control when the node access traffic is too large, resulting in reduced processing performance and transaction blocking, affecting the processing efficiency of other nodes.
By responding to the flow control request, determine the flow control node and the total traffic upper limit, and adjust the flow upper limit of the target adjustment node to ensure that the traffic of each node does not exceed the total flow upper limit, and to avoid excessive incoming traffic from one node affecting the processing of other nodes. efficiency.
It realizes flow control of transaction orchestration cluster nodes, avoids processing performance degradation and transaction blocking caused by excessive incoming traffic, and improves node processing efficiency.
Smart Images

Figure CN118748658A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow control method, device, electronic device and computer-readable medium. Background Art
[0002] At present, the existing distributed implementation methods of transaction orchestration do not have the ability to control traffic. When the inbound traffic of a node is too large, it will seriously affect the processing performance of the node and cause transaction congestion. If there are scenarios where transactions of different nodes depend on each other, it will affect the processing efficiency of other nodes. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a flow control method, device, electronic device and computer-readable medium, which can solve the problem in the existing distributed implementation method of transaction orchestration that when the incoming traffic of a node is too large, it will seriously affect the processing performance of the node and cause transaction congestion. If there is a scenario where transactions of different nodes depend on each other, it will affect the processing efficiency of other nodes.
[0004] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present application, a flow control method is provided, including: in response to a flow control request, determining a flow control node, and obtaining architecture data of a distributed transaction orchestration cluster; in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold, determining a total flow upper limit according to the flow control node and the architecture data; determining a first type of node corresponding to the total flow upper limit, and determining a second type corresponding to the flow control node; determining a target adjustment node according to the first type and the second type; determining a third type of the target adjustment node, obtaining the flow upper limit of each node in the distributed transaction orchestration cluster, and adjusting the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node, and the total flow upper limit.
[0005] Optionally, determining the total flow upper limit includes: when the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being 1, obtaining the configured flow upper limit corresponding to the upstream node, and determining the configured flow upper limit as the total flow upper limit.
[0006] Optionally, determining the total flow upper limit includes: when the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being greater than 1, obtaining the configured flow upper limit corresponding to the downstream node, and determining the configured flow upper limit as the total flow upper limit.
[0007] Optionally, determining the target adjustment node includes: when the first type is an upstream node and the second type is a downstream node, determining the flow control node as the target adjustment node; when the first type and the second type are both downstream nodes, determining the upstream node corresponding to the flow control node as the target adjustment node.
[0008] Optionally, adjusting the flow upper limit of the target adjustment node includes: in response to the third type being a downstream node, adjusting the flow upper limit of the target adjustment node so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes in each node except the target adjustment node is not greater than the total flow upper limit.
[0009] Optionally, adjusting the traffic upper limit of the target adjustment node includes: determining the number of target adjustment nodes in response to the third type being an upstream node; determining the traffic adjustment direction based on the traffic upper limit of each node; and adjusting the traffic upper limit of each target adjustment node based on the number, traffic adjustment direction and total traffic upper limit, so that the sum of the adjusted traffic upper limits of each target adjustment node is not greater than the total traffic upper limit.
[0010] Optionally, the method further includes: in response to the number of nodes in the distributed transaction orchestration cluster being 1, executing an adaptive flow control strategy according to preset orchestration rules and processing efficiency of different nodes.
[0011] In addition, the present application also provides a flow control device, including: an acquisition unit, configured to determine the flow control node in response to a flow control request, and obtain the architecture data of the distributed transaction orchestration cluster; a total flow upper limit determination unit, configured to determine the total flow upper limit according to the flow control node and the architecture data in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold; a type determination unit, configured to determine a first type of node corresponding to the total flow upper limit, and determine a second type corresponding to the flow control node; a target adjustment node determination unit, configured to determine a target adjustment node according to the first type and the second type; an adjustment unit, configured to determine a third type of the target adjustment node, obtain the flow upper limit of each node in the distributed transaction orchestration cluster, and adjust the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node and the total flow upper limit.
[0012] Optionally, the total flow upper limit determination unit is further configured to: when the flow control node is a downstream node, determine the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being 1, obtain the configured flow upper limit corresponding to the upstream node, and determine the configured flow upper limit as the total flow upper limit.
[0013] Optionally, the total flow upper limit determination unit is further configured to: when the flow control node is a downstream node, determine the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being greater than 1, obtain the configured flow upper limit corresponding to the downstream node, and determine the configured flow upper limit as the total flow upper limit.
[0014] Optionally, the target adjustment node determination unit is further configured to: when the first type is an upstream node and the second type is a downstream node, determine the flow control node as the target adjustment node; when the first type and the second type are both downstream nodes, determine the upstream node corresponding to the flow control node as the target adjustment node.
[0015] Optionally, the adjustment unit is further configured to: in response to the third type being a downstream node, adjust the flow upper limit of the target adjustment node so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes in each node except the target adjustment node is not greater than the total flow upper limit.
[0016] Optionally, the adjustment unit is further configured to: determine the number of target adjustment nodes in response to the third type being an upstream node; determine the flow adjustment direction based on the flow upper limit of each node; adjust the flow upper limit of each target adjustment node based on the number, flow adjustment direction and total flow upper limit, so that the sum of the flow upper limits of each target adjustment node after adjustment is not greater than the total flow upper limit.
[0017] Optionally, the flow control device also includes an adaptive flow control unit configured to: in response to the number of nodes in the distributed transaction orchestration cluster being 1, execute an adaptive flow control strategy according to preset orchestration rules and processing efficiency of different nodes.
[0018] In addition, the present application also provides a flow control electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the flow control method as described above.
[0019] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the flow control method as described above is implemented.
[0020] To achieve the above objective, according to another aspect of the embodiments of the present application, a computer program product is provided.
[0021] A computer program product according to an embodiment of the present application includes a computer program, and when the program is executed by a processor, the flow control method provided by the embodiment of the present application is implemented.
[0022] One embodiment of the above invention has the following advantages or beneficial effects: the present application determines the flow control node in response to the flow control request and obtains the architecture data of the distributed transaction orchestration cluster; in response to the number of nodes in the distributed transaction orchestration cluster being greater than the preset threshold, determines the total flow upper limit according to the flow control node and the architecture data; determines the first type of node corresponding to the total flow upper limit, and determines the second type corresponding to the flow control node; determines the target adjustment node according to the first type and the second type; determines the third type of the target adjustment node, obtains the flow upper limit of each node in the distributed transaction orchestration cluster, and adjusts the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node and the total flow upper limit. Thus, the flow control of the nodes in the transaction orchestration cluster is realized, the processing efficiency of other nodes is avoided to be affected by the excessive inbound flow of a certain node, and the processing efficiency of the nodes in the transaction orchestration cluster is improved.
[0023] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.
[0025] Figure 1 is a schematic diagram of the main process of a flow control method according to an embodiment of the present application;
[0026] Figure 2 is a schematic diagram of the main process of a flow control method according to an embodiment of the present application;
[0027] Figure 3 It is a main flow chart of a flow control method according to an embodiment of the present application;
[0028] Figure 4a is a schematic diagram of a transaction orchestration cluster architecture of a flow control method according to an embodiment of the present application;
[0029] Figure 4b is a schematic diagram of a transaction orchestration cluster architecture of a flow control method according to an embodiment of the present application;
[0030] Figure 5 It is a main flow chart of a flow control method according to an embodiment of the present application;
[0031] Figure 6 is a schematic diagram of the main units of the flow control device according to an embodiment of the present application;
[0032] Figure 7 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;
[0033] Figure 8 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of known functions and structures is omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of the present application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, certain software, components, models, and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must have used the solution. In the technical solution of the present application, the collection, analysis, use, transmission, storage, and other aspects of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes, and are not shared, leaked, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Take necessary measures to prevent illegal access to such user personal information data, ensure that persons who have access to such personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Once such user personal information data is no longer needed, the risk should be minimized by limiting or even prohibiting data collection and / or deleting the data.
[0035] When used, including in certain related applications, user privacy is protected by de-identifying data, such as by removing specific identifiers when used, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.
[0036] Figure 1 is a schematic diagram of the main process of the flow control method according to an embodiment of the present application, such as Figure 1 As shown, the flow control method mainly includes the following steps S101 to S105.
[0037] Step S101, in response to a flow control request, determining a flow control node, and acquiring architecture data of a distributed transaction orchestration cluster.
[0038] In this embodiment, the execution subject of the flow control method (for example, a server) can receive the flow control request through a wired connection or a wireless connection. After receiving the flow control request, the execution subject can determine the flow control node according to the node identifier carried in the request.
[0039] The flow control node is the node that triggers flow control, but it is not necessarily the node that needs to adjust the flow limit. After determining the flow control node, the execution subject can obtain the architecture data of the distributed transaction orchestration cluster containing the flow control node. The architecture data of the distributed transaction orchestration cluster can be as follows: Figure 4a As shown, the flow control node is a downstream node, and the flow control node has only one upstream node architecture data; it can also be as follows Figure 4b As shown, the flow control node is a downstream node, and the flow control node has architecture data of multiple upstream nodes.
[0040] Step S102, in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold, determining a total flow upper limit according to flow control nodes and architecture data.
[0041] The preset threshold value may be, for example, 1. When the number of nodes in the distributed transaction orchestration cluster is greater than 1, it indicates that there is more than one node in the transaction orchestration cluster, and there is an upstream node or a downstream node corresponding to the flow control node. For example, the execution subject may determine the total flow upper limit according to the flow control node and the number of upstream nodes and upstream nodes in the architecture data.
[0042] Specifically, determining the upper limit of the total flow includes: when the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being 1, obtaining the configured flow upper limit corresponding to the upstream node, and determining the configured flow upper limit as the total flow upper limit.
[0043] like Figure 4a As shown, when the flow control node is a downstream node (such as Component2) and there is only one upstream node (such as Component1), the flow upper limit of the upstream node (such as Component1) is the total flow upper limit.
[0044] Specifically, the method also includes: in response to the number of nodes in the distributed transaction orchestration cluster being 1, executing an adaptive flow control strategy according to preset orchestration rules and processing efficiency of different nodes.
[0045] like Figure 5 As shown, when the number of nodes in the distributed transaction orchestration cluster is 1, that is, there is only Component 1 (i.e., transaction orchestration unit 1), an adaptive flow control strategy is executed according to the preset orchestration rules and the processing efficiency of different nodes.
[0046] For example, Figure 5 In the transaction arrangement unit 1 shown, the flow control upper limit of the flow control node module is 400 (in the embodiment of the present application, the flow control upper limit is the flow upper limit, and the two have the same meaning). A=1 in the message triggers node 1 (outbound call), otherwise skip; B=1 in the message triggers node 2 (internal processing), otherwise skip. Node 1 has 200ms per transaction, and node 2 has 10ms per transaction. It can be seen that the processing efficiency of node 2 is 10 times that of node 1.
[0047] When the external call reaches the flow control upper limit of 400 (that is, the number of call messages of the external call accessed by the access module of the transaction arrangement unit 1 reaches the flow control upper limit of 400), the flow control node can perform flow control for the A and B values according to the number of transactions with A=1 and B=1 in the current transaction. Specifically, according to the number of transactions with A=1 and B=1 in the current transaction, the flow control node determines the branch for the A and B values and selects the corresponding access module to access the corresponding branch for flow control. Specifically, the following (1)-(4) strategies can be selected for flow control.
[0048] (1) Efficiency optimization strategy: Strengthen restrictions on transactions with A=1 and allow more transactions with B=1 to access. The strategy is to reduce the traffic limit of A=1 and increase the traffic limit of B=1;
[0049] (2) Node 1’s preferred strategy: prioritize transactions with A=1 and restrict transactions with A≠1. The strategy is to gradually reduce the traffic limit for A≠1, and the total traffic limit of 400 remains unchanged;
[0050] (3) Node 2's preferred strategy: prioritize transactions with B=1 and restrict transactions with B≠1. The strategy is to gradually reduce the upper limit of traffic for B≠1, and the total upper limit of 400 remains unchanged;
[0051] (4) Priority strategy: Prioritize transactions with A≠1 or B≠1, and the transactions are directly approved. The strategy is to reduce the traffic limit of A≠1 or B≠1, and the total traffic limit of 400 remains unchanged.
[0052] Step S103, determine the first type of node corresponding to the total flow upper limit, and determine the second type of node corresponding to the flow control node.
[0053] The first type may be an upstream node or a downstream node. The second type may be an upstream node or a downstream node.
[0054] Step S104: determining a target adjustment node according to the first type and the second type.
[0055] The upstream and downstream relationship between the node corresponding to the total flow upper limit and the flow control node is determined according to the first type and the second type, and the target adjustment node is determined according to the determined upstream and downstream relationship. The target adjustment node is the node for which the flow upper limit needs to be adjusted, which may be the flow control node or the upstream node of the flow control node. The target adjustment node is determined according to the first type and the second type.
[0056] Step S105, determine the third type of the target adjustment node, obtain the traffic upper limit of each node in the distributed transaction orchestration cluster, and adjust the traffic upper limit of the target adjustment node based on the third type, the traffic upper limit of each node and the total traffic upper limit.
[0057] The third type may be an upstream node or a downstream node.
[0058] Specifically, adjusting the flow upper limit of the target adjustment node includes: in response to the third type being a downstream node, adjusting the flow upper limit of the target adjustment node so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes in each node except the target adjustment node is not greater than the total flow upper limit.
[0059] If the third type is a downstream node, such as Figure 4a As shown, if the target adjustment node is a downstream node (for example, Component2), the node corresponding to the total traffic upper limit (for example, Component1) can be an upstream node, then the traffic upper limit of the target adjustment node (for example, Component2) is adjusted so that the sum of the traffic upper limits of the adjusted target adjustment node (for example, Component2's traffic upper limit of 400) and the traffic upper limits of other downstream nodes (for example, Component3's traffic upper limit of 500) in the architecture data of the corresponding distributed transaction orchestration cluster (for example, 400+500=900) is less than or equal to (that is, not greater than) the total traffic upper limit (for example, Component1's traffic upper limit of 1000).
[0060] This embodiment determines the flow control node in response to the flow control request, obtains the architecture data of the distributed transaction orchestration cluster; in response to the number of nodes in the distributed transaction orchestration cluster being greater than the preset threshold, determines the total flow upper limit according to the flow control node and the architecture data; determines the first type of the node corresponding to the total flow upper limit, and determines the second type corresponding to the flow control node; determines the target adjustment node according to the first type and the second type; determines the third type of the target adjustment node, obtains the flow upper limit of each node in the distributed transaction orchestration cluster, and adjusts the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node and the total flow upper limit. In this way, the flow control of the nodes in the transaction orchestration cluster is realized, the processing efficiency of other nodes is avoided to be affected by the excessive inbound flow of a certain node, and the processing efficiency of the nodes in the transaction orchestration cluster is improved.
[0061] Figure 2 is a schematic diagram of the main flow chart of the flow control method according to an embodiment of the present application, such as Figure 2 As shown, the flow control method mainly includes the following steps S201 to S206.
[0062] Step S201, in response to a flow control request, determining a flow control node, and obtaining architecture data of a distributed transaction orchestration cluster.
[0063] The flow control request may be a request to control the flow limit. The flow control node is the node that triggers the flow control, but it is not necessarily the node that needs to adjust the flow limit. After determining the flow control node, the execution subject may obtain the architecture data of the distributed transaction orchestration cluster containing the flow control node. The architecture data of the distributed transaction orchestration cluster may be as follows: Figure 4a As shown, the flow control node is a downstream node, and the flow control node has only one upstream node architecture data; it can also be as follows Figure 4b As shown, the flow control node is a downstream node, and the flow control node has architecture data of multiple upstream nodes.
[0064] Step S202, in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold, determining a total flow upper limit based on flow control nodes and architecture data.
[0065] Specifically, determining the total flow upper limit includes: when the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being greater than 1, obtaining the configuration flow upper limit corresponding to the downstream node, and determining the configuration flow upper limit as the total flow upper limit.
[0066] like Figure 4b As shown, when the flow control node is a downstream node (such as Component2), and the number of corresponding upstream nodes (such as Component1.1 and Component1.2) is greater than one, that is, the number of upstream nodes is multiple, then the flow control node (such as Component2) can be used as the node corresponding to the total flow upper limit, and the configured flow upper limit of the flow control node (that is, the downstream node) (such as Component2) is obtained, and the configured flow upper limit (for example, 400) of the flow control node (that is, the downstream node) (such as Component2) is determined as the total flow upper limit.
[0067] Step S203, determine the first type of node corresponding to the total flow upper limit, and determine the second type of node corresponding to the flow control node.
[0068] The first type may be an upstream node or a downstream node. The second type may be an upstream node or a downstream node.
[0069] Step S204: when the first type is an upstream node and the second type is a downstream node, determine the flow control node as a target adjustment node.
[0070] like Figure 4a As shown, the first type is the upstream node, that is, the node corresponding to the total flow upper limit (for example, 1000) (for example, Component1) is the upstream node; the second type is the downstream node, that is, the flow control node (for example, Component2) is the downstream node, and the downstream node (that is, the flow control node) (for example, Component2) is determined as the target adjustment node, that is, the node that needs to adjust the flow upper limit.
[0071] Step S205: When both the first type and the second type are downstream nodes, the upstream node corresponding to the flow control node is determined as the target adjustment node.
[0072] like Figure 4b As shown, when both the first type and the second type are downstream nodes, that is, the node corresponding to the total flow upper limit (e.g., Component2) and the flow control node (e.g., Component2) are both downstream nodes, the upstream nodes corresponding to the flow control node (e.g., Component1.1 and Component1.2) are determined as target adjustment nodes. For example, based on the total flow upper limit (e.g., 400) of the flow control node (downstream node), the flow upper limits of the upstream nodes Component1.1 and Component1.2 are both adjusted down from 400 to 200, so that the sum of the flow upper limits of the upstream nodes Component1.1 and Component1.2 does not exceed the total flow upper limit of 400 of the flow control node (downstream node) (e.g., Component2), so as to meet the flow control requirements of the flow control node (downstream node) (e.g., Component2).
[0073] Step S206, determine the third type of the target adjustment node, obtain the traffic upper limit of each node in the distributed transaction orchestration cluster, and adjust the traffic upper limit of the target adjustment node based on the third type, the traffic upper limit of each node and the total traffic upper limit.
[0074] The third type may be an upstream node or a downstream node.
[0075] Specifically, adjusting the flow upper limit of the target adjustment node includes: determining the number of target adjustment nodes in response to the third type being an upstream node; determining the flow adjustment direction according to the flow upper limit of each node; and adjusting the flow upper limit of each target adjustment node according to the number, flow adjustment direction and total flow upper limit, so that the sum of the flow upper limits of each target adjustment node after adjustment is not greater than the total flow upper limit.
[0076] If the third type is an upstream node, such as Figure 4b As shown, if the target adjustment nodes (such as Component1.1 and Component1.2) are upstream nodes, then the nodes corresponding to the total traffic limit (such as Component2) can be downstream nodes. Determine the number of target adjustment nodes (for example, 2, Component1.1 and Component1.2). Determine the traffic adjustment direction (for example, downward adjustment) based on the traffic limits of each node in the distributed transaction orchestration cluster (for example, the traffic limit of Component1.1 is 400 and the traffic limit of Component1.2 is 400). According to the quantity (for example, 2), traffic adjustment direction (for example, downward) and total traffic upper limit (for example, 400), adjust the traffic upper limit of each target adjustment node (for example, Component1.1 and Component1.2) (for example, reduce the traffic upper limit of Component1.1 from 400 to 200, and reduce the traffic upper limit of Component1.2 from 400 to 200), so that the sum of the adjusted traffic upper limits of each target adjustment node (for example, Component1.1 and Component1.2) (for example, Component1.1 traffic upper limit 200 and Component1.2 traffic upper limit 200) (200+200=400) is not greater than the total traffic upper limit (for example, Component2 traffic upper limit 400).
[0077] The embodiments of the present application can implement flow control of nodes in a transaction orchestration cluster, avoid affecting the processing efficiency of other nodes due to excessive inbound flow of a certain node, and improve the processing efficiency of nodes in the transaction orchestration cluster.
[0078] Figure 3 The main flow chart of the flow control method according to an embodiment of the present application is shown in FIG. The present application embodiment adds a flow control node module based on the distributed transaction arrangement component, such as Figure 3 As shown in ①. For example, Figure 3In the example, the access module of transaction orchestration unit 1 receives the call message sent by the external call. When the process flows to the flow control node module ①, the flow control node module ① can be connected to multiple processing programs, including: 1. internal processing and 2. outbound calls. Outbound calls can be made through process node 1, internal processing can be made through process node 2, branches can be judged through branch nodes, and then the output module can be connected to the access module of transaction orchestration unit 2 and transaction orchestration unit 3. The access module of transaction orchestration unit 2 is connected to the flow control node module ①-node 3 (external outbound call processing program)-node 4 (external internal processing processing program)-output module-(return) external call. The access module of transaction orchestration unit 3 (external internal processing processing program)-is connected to the flow control node module ①-node 5-output module-(return) external call.
[0079] In the embodiment of the present application, the flow control node module is described as follows:
[0080] This module can implement basic flow control capabilities through static configuration, such as total flow limit, interface flow limit, user flow limit, etc.
[0081] This module can realize the static flow control capability of this unit according to the transaction arrangement rules. For example: in transaction arrangement unit 1, the transaction arrangement rule is that in the input message, when A=1, node 1 is called; A=2, node 2 is called; A≠1 or 2, node 1 and node 2 are skipped. In this unit, the flow control module can configure the flow limit threshold according to the value of A.
[0082] The following are the configuration parameters:
[0083] Total traffic limit 1000TPS
[0084] A=1 Traffic limit 300TPS
[0085] A=2 Traffic limit 300TPS
[0086] A≠1 or 2 Traffic limit 400TPS
[0087] This module can realize the weighted flow control capability of this unit according to the transaction arrangement rules. For example: in transaction arrangement unit 1, the transaction arrangement rule is that in the input message, when A=1, node 1 is called; when A=2, node 2 is called; when A≠1 or 2, node 1 and node 2 are skipped. In addition, transactions with A=1 are guaranteed to pass first, followed by transactions with A=2, and finally transactions with A≠1 or 2. The priority can be expressed by configuring the weight.
[0088] The following are the configuration parameters:
[0089] Total traffic limit 1000TPS
[0090] A=1 Traffic limit weight 6
[0091] A=2 Traffic limit weight 3
[0092] A≠1 or 2 Traffic limit weight 1
[0093] When the total traffic exceeds the upper limit of 1000 TPS, the flow control module will allocate the upper limit of traffic with different A values according to the weight. The specific algorithm is: traffic upper limit = total traffic upper limit X (weight value / 10).
[0094] This module can realize the routing flow control capability of this unit according to the transaction arrangement rules. For example: in the system configured routing table, increase the flow control upper limit (i.e. flow upper limit), as shown below:
[0095] Route ID: 001; Route name: Company initial inspection; Deployment component number: Component1; Access address: 128.0.0.1; Traffic limit: 1000;
[0096] Route ID: 002; Route name: Company Review; Deployment component number: Component2; Access address: 128.0.0.2; Traffic limit: 400. Corresponding A=1 or 2;
[0097] Route ID: 003; Route name: Company exit; Deployment component number: Component3; Access address: 128.0.0.3; Traffic limit: 500. Corresponding to A≠1 or 2.
[0098] The flow control modules can communicate with each other and implement dynamic flow control adjustment strategies based on transaction orchestration rules.
[0099] Strategy 1: When flow control occurs at the downstream node, notify the upstream node to limit the flow of the corresponding rule.
[0100] Figure 4a is a schematic diagram of a transaction orchestration cluster architecture of a flow control method according to an embodiment of the present application, such as Figure 4a As shown in the figure, when Component 2 has flow control, the node notifies Component 2 to limit the transaction flow of A=1 or 2. That is, Component 1 increases the flow limit of A=1 or 2 to 400 based on the flow limit of 1000.
[0101] Strategy 2: When there are multiple upstream nodes, notify the upstream nodes to limit the overall traffic.
[0102] Figure 4b FIG. 1 is a schematic diagram of a transaction orchestration cluster architecture of a flow control method according to an embodiment of the present application. Figure 4b As shown:
[0103] Route ID: 001.1; Route name: Company initial inspection; Deployment component number: Component1.1; Access address: 128.0.0.1; Traffic limit: 400.
[0104] Route ID: 001.2; Route name: Company review; Deployment component number: Component1.2; Access address: 128.0.0.1; Traffic limit: 400.
[0105] Route ID: 002; Route name: Company exit; Deployment component number: Component2; Access address: 128.0.0.2; Traffic limit: 400.
[0106] When Component2 encounters flow control, the node notifies Component1.1 and Component1.2 to limit the transaction flow of the two upstream nodes. That is, Component1.1 and Component1.2 lower the flow limit to 200 to meet the control requirements of Component2.
[0107] Figure 5 It is a main flow diagram of the flow control method according to an embodiment of the present application. In the transaction arrangement unit 1, the flow control upper limit of the flow control node module is 400 (in the embodiment of the present application, the flow control upper limit is the flow upper limit, and the two have the same meaning). A=1 in the message triggers node 1 (outbound call), otherwise skip; B=1 in the message triggers node 2 (internal processing), otherwise skip. Node 1 has 200ms per transaction, and node 2 has 10ms per transaction. It can be seen that the processing efficiency of node 2 is 10 times that of node 1.
[0108] When the external call reaches the flow control upper limit of 400 (that is, the number of call messages of the external call accessed by the access module of the transaction arrangement unit 1 reaches the flow control upper limit of 400), the flow control node can perform flow control for the A and B values according to the number of transactions with A=1 and B=1 in the current transaction. Specifically, according to the number of transactions with A=1 and B=1 in the current transaction, the flow control node determines the branch for the A and B values and selects the corresponding access module to access the corresponding branch for flow control. Specifically, the following (1)-(4) strategies can be selected for flow control.
[0109] (1) Efficiency optimization strategy: Strengthen restrictions on transactions with A=1 and allow more transactions with B=1 to access. The strategy is to reduce the traffic limit of A=1 and increase the traffic limit of B=1;
[0110] (2) Node 1’s preferred strategy: prioritize transactions with A=1 and restrict transactions with A≠1. The strategy is to gradually reduce the traffic limit for A≠1, and the total traffic limit of 400 remains unchanged;
[0111] (3) Node 2's preferred strategy: prioritize transactions with B=1 and restrict transactions with B≠1. The strategy is to gradually reduce the upper limit of traffic for B≠1, and the total upper limit of 400 remains unchanged;
[0112] (4) Priority strategy: Prioritize transactions with A≠1 or B≠1, and the transactions are directly approved. The strategy is to reduce the traffic limit of A≠1 or B≠1, and the total traffic limit of 400 remains unchanged.
[0113] The flow control method of the embodiment of the present application is used to realize the flow control of each node of the distributed cluster of transaction arrangement by adding a transaction arrangement flow control module; the flow control module is deployed in each distributed node, and the flow control function of each node is the same to realize the flow control of this node; in addition to the basic flow control capability, the flow control module can perform personalized flow control according to the transaction arrangement rules of the current node. Distributed transaction arrangement is a method of distributing the transaction arrangement capability to different units through distributed deployment of application units. Flow control refers to a mechanism for preventing system blocking and controlling the access request and information flow of the system, which plays an important role in maintaining the availability and stability of the computer system. The embodiment of the present application is based on distributed transaction arrangement and provides a flow control module in this scenario. The flow control module is bound to the transaction arrangement project and also supports distributed deployment. Not only can the access flow control of the deployed unit be realized, but also the flow control under different rules can be realized according to the rules of transaction arrangement. The flow control method of the embodiment of the present application based on the distributed transaction arrangement cluster supports the flow control of the transaction arrangement cluster locally and globally through static, weighted, dynamic adjustment and other methods. It solves the problem that the distributed transaction orchestration cluster cannot currently implement flow control or that flow control is irrelevant to transaction encoding rules, making the flow control strategy better adapt to the business scenarios of the cluster.
[0114] Figure 6 Schematic diagram of the main units of the flow control device according to an embodiment of the present application. Figure 6 As shown, the flow control device 600 includes an acquisition unit 601 , a total flow upper limit determination unit 602 , a type determination unit 603 , a target adjustment node determination unit 604 and an adjustment unit 605 .
[0115] The acquisition unit 601 is configured to determine the flow control node in response to the flow control request and acquire the architecture data of the distributed transaction orchestration cluster.
[0116] The total traffic upper limit determining unit 602 is configured to determine the total traffic upper limit according to the flow control nodes and the architecture data in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold.
[0117] The type determination unit 603 is configured to determine a first type of node corresponding to the total flow upper limit, and determine a second type corresponding to the flow control node.
[0118] The target adjustment node determining unit 604 is configured to determine the target adjustment node according to the first type and the second type.
[0119] The adjustment unit 605 is configured to determine the third type of the target adjustment node, obtain the traffic upper limit of each node in the distributed transaction orchestration cluster, and adjust the traffic upper limit of the target adjustment node based on the third type, the traffic upper limit of each node and the total traffic upper limit.
[0120] In some embodiments, the total traffic upper limit determination unit 602 is further configured to: when the flow control node is a downstream node, determine the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being 1, obtain the configured traffic upper limit corresponding to the upstream node, and determine the configured traffic upper limit as the total traffic upper limit.
[0121] In some embodiments, the total traffic upper limit determination unit 602 is further configured to: when the flow control node is a downstream node, determine the number of upstream nodes corresponding to the downstream node based on the architecture data; in response to the number being greater than 1, obtain the configured traffic upper limit corresponding to the downstream node, and determine the configured traffic upper limit as the total traffic upper limit.
[0122] In some embodiments, the target adjustment node determination unit 604 is further configured to: when the first type is an upstream node and the second type is a downstream node, determine the flow control node as the target adjustment node; when the first type and the second type are both downstream nodes, determine the upstream node corresponding to the flow control node as the target adjustment node.
[0123] In some embodiments, the adjustment unit 605 is further configured to: in response to the third type being a downstream node, adjust the flow upper limit of the target adjustment node so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes in each node except the target adjustment node is not greater than the total flow upper limit.
[0124] In some embodiments, the adjustment unit 605 is further configured to: determine the number of target adjustment nodes in response to the third type being an upstream node; determine the flow adjustment direction based on the flow upper limit of each node; adjust the flow upper limit of each target adjustment node based on the number, flow adjustment direction and total flow upper limit, so that the sum of the flow upper limits of each target adjustment node after adjustment is not greater than the total flow upper limit.
[0125] In some embodiments, the flow control device further comprises Figure 6The adaptive flow control unit not shown in the figure is configured to: in response to the number of nodes in the distributed transaction orchestration cluster being 1, execute an adaptive flow control strategy according to preset orchestration rules and processing efficiency of different nodes.
[0126] It should be noted that the flow control method and flow control device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.
[0127] Figure 7 An exemplary system architecture 700 is shown to which the flow control method or flow control device according to the embodiment of the present application can be applied.
[0128] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0129] The user can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 701, 702, 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0130] The terminal devices 701 , 702 , and 703 may be various electronic devices having a flow control processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0131] Server 705 may be a server that provides various services, such as a background management server that provides support for traffic control requests submitted by users using terminal devices 701, 702, and 703 (only as an example). The background management server may determine the flow control node in response to the flow control request, and obtain the architecture data of the distributed transaction orchestration cluster; in response to the number of nodes in the distributed transaction orchestration cluster being greater than the preset threshold, determine the total flow upper limit according to the flow control node and the architecture data; determine the first type of node corresponding to the total flow upper limit, and determine the second type corresponding to the flow control node; determine the target adjustment node according to the first type and the second type; determine the third type of the target adjustment node, obtain the flow upper limit of each node in the distributed transaction orchestration cluster, and adjust the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node and the total flow upper limit. In this way, the flow control of the nodes in the transaction orchestration cluster is realized, the processing efficiency of other nodes is avoided to be affected by the excessive inbound flow of a certain node, and the processing efficiency of the nodes in the transaction orchestration cluster is improved.
[0132] It should be noted that the flow control method provided in the embodiment of the present application is generally executed by the server 705, and accordingly, the flow control device is generally set in the server 705.
[0133] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0134] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present application. Figure 8 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0135] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the computer system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0136] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0137] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present application are executed.
[0138] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0140] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a total flow upper limit determination unit, a type determination unit, a target adjustment node determination unit, and an adjustment unit. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0141] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device responds to a flow control request, determines a flow control node, and obtains the architecture data of a distributed transaction orchestration cluster; in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold, determines the total flow upper limit according to the flow control node and the architecture data; determines the first type of node corresponding to the total flow upper limit, and determines the second type corresponding to the flow control node; determines the target adjustment node according to the first type and the second type; determines the third type of the target adjustment node, obtains the flow upper limit of each node in the distributed transaction orchestration cluster, and adjusts the flow upper limit of the target adjustment node based on the third type, the flow upper limit of each node and the total flow upper limit.
[0142] The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, the flow control method in the embodiment of the present application is implemented.
[0143] According to the technical solution of the embodiment of the present application, the traffic control of the nodes in the transaction orchestration cluster can be implemented to avoid affecting the processing efficiency of other nodes due to excessive inbound traffic of a certain node, thereby improving the processing efficiency of the nodes in the transaction orchestration cluster.
[0144] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A flow control method, characterized in that: include: In response to the flow control request, determine the flow control node and obtain the architecture data of the distributed transaction orchestration cluster; In response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold, determining a total flow upper limit according to the flow control node and the architecture data; Determine a first type of node corresponding to the total flow upper limit, and determine a second type of node corresponding to the flow control node; Determining a target adjustment node according to the first type and the second type; Determine a third type of the target adjustment node, obtain a traffic upper limit of each node in the distributed transaction orchestration cluster, and adjust the traffic upper limit of the target adjustment node based on the third type, the traffic upper limit of each node, and the total traffic upper limit.
2. The method according to claim 1, characterized in that Determining the upper limit of the total flow rate includes: When the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; In response to the number being 1, the configured traffic upper limit corresponding to the upstream node is obtained, and the configured traffic upper limit is determined as the total traffic upper limit.
3. The method according to claim 1, characterized in that Determining the upper limit of the total flow rate includes: When the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; In response to the number being greater than 1, obtaining a configured traffic upper limit corresponding to the downstream node, and determining the configured traffic upper limit as a total traffic upper limit.
4. The method according to claim 1, characterized in that: The determining of the target adjustment node includes: When the first type is an upstream node and the second type is a downstream node, determining the flow control node as a target adjustment node; When both the first type and the second type are downstream nodes, an upstream node corresponding to the flow control node is determined as a target adjustment node.
5. The method according to claim 1, characterized in that The adjusting the flow upper limit of the target adjustment node includes: In response to the third type being a downstream node, the flow upper limit of the target adjustment node is adjusted so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes among the nodes except the target adjustment node is not greater than the total flow upper limit.
6. The method according to claim 1, characterized in that The adjusting the flow upper limit of the target adjustment node includes: In response to the third type being an upstream node, determining the number of the target adjustment nodes; Determining a flow adjustment direction according to the flow upper limit of each node; According to the quantity, the flow adjustment direction and the total flow upper limit, the flow upper limit of each of the target adjustment nodes is adjusted so that the sum of the adjusted flow upper limits of each of the target adjustment nodes is not greater than the total flow upper limit.
7. The method according to claim 1, characterized in that The method further comprises: In response to the number of nodes in the distributed transaction orchestration cluster being 1, an adaptive flow control strategy is executed according to preset orchestration rules and processing efficiencies of different nodes.
8. A flow control device, characterized in that: include: an acquisition unit, configured to determine a flow control node in response to a flow control request, and acquire architecture data of a distributed transaction orchestration cluster; a total traffic upper limit determining unit, configured to determine a total traffic upper limit according to the flow control node and the architecture data in response to the number of nodes in the distributed transaction orchestration cluster being greater than a preset threshold; a type determination unit, configured to determine a first type of node corresponding to the total flow upper limit, and determine a second type corresponding to the flow control node; a target adjustment node determining unit, configured to determine a target adjustment node according to the first type and the second type; The adjustment unit is configured to determine a third type of the target adjustment node, obtain the traffic upper limit of each node in the distributed transaction orchestration cluster, and adjust the traffic upper limit of the target adjustment node based on the third type, the traffic upper limit of each node and the total traffic upper limit.
9. The device according to claim 8, characterized in that The total flow upper limit determination unit is further configured to: When the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; In response to the number being 1, the configured traffic upper limit corresponding to the upstream node is obtained, and the configured traffic upper limit is determined as the total traffic upper limit.
10. The device according to claim 8, characterized in that The total flow upper limit determination unit is further configured to: When the flow control node is a downstream node, determining the number of upstream nodes corresponding to the downstream node based on the architecture data; In response to the number being greater than 1, obtaining a configured traffic upper limit corresponding to the downstream node, and determining the configured traffic upper limit as a total traffic upper limit.
11. The device according to claim 8, characterized in that The target adjustment node determination unit is further configured to: When the first type is an upstream node and the second type is a downstream node, determining the flow control node as a target adjustment node; When both the first type and the second type are downstream nodes, an upstream node corresponding to the flow control node is determined as a target adjustment node.
12. The device according to claim 8, characterized in that The adjustment unit is further configured to: In response to the third type being a downstream node, the flow upper limit of the target adjustment node is adjusted so that the sum of the adjusted flow upper limit of the target adjustment node and the flow upper limits of other nodes among the nodes except the target adjustment node is not greater than the total flow upper limit.
13. The device according to claim 8, characterized in that The adjustment unit is further configured to: In response to the third type being an upstream node, determining the number of the target adjustment nodes; Determining a flow adjustment direction according to the flow upper limit of each node; According to the quantity, the flow adjustment direction and the total flow upper limit, the flow upper limit of each of the target adjustment nodes is adjusted so that the sum of the adjusted flow upper limits of each of the target adjustment nodes is not greater than the total flow upper limit.
14. A flow control electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
15. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Message traffic control method and device and related system
CN106921587A
Traffic control method and device
CN113055300A
Flow control method and device, computer equipment and storage medium
CN115134301A
Distributed cloud traffic scheduling method and device based on topology awareness
CN117135128A
Flow control method and device, electronic equipment and storage medium
CN117411829A
