Flow control method, device, computer equipment, storage medium and program product

CN122933539APending Publication Date: 2026-10-16SUGON INFORMATION IND +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610983317.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]然而,在切换服务质量生效节点的方案中,在生效节点发生切换的时候,会有短暂的服务质量无法生效的问题,从而影响分布式存储系统的稳定性

Benefits of technology

[0024] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described flow control method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933539A_ABST
    Figure CN122933539A_ABST
Patent Text Reader

Abstract

The application relates to a flow control method and device, computer equipment, a storage medium and a program product. The method comprises the following steps: in the case that the current flow limiting mode is switched from a client mode to a pre-switching mode, respectively notifying a client node and a storage node to switch to the pre-switching mode, so that the client node sends a target data packet to the storage node after setting a rule matching mark on the target data packet, and the storage node generates first demand information based on network resource demand information of the target data packet; receiving the first demand information from the storage node, generating and returning first token information based on the first demand information, and the first token information is used for flow limiting in combination with a quality of service rule after the management node notifies the switching to the storage node mode. The method can improve the stability of a distributed storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed storage technology, and in particular to a flow control method, apparatus, computer equipment, storage medium, and program product. Background Technology

[0002] In distributed systems, QoS (Quality of Service) is used to ensure traffic access control for the controlled objects. The controlled objects refer to the objects to which QoS applies, such as directories, accounts, or IP (Internet Protocol) addresses.

[0003] Currently, QoS (Quality of Service) guarantees can be implemented on the client side, on the storage node, or on both the client and storage nodes, with the effective QoS point switching based on the specific on-site pressure. For example, a scheme can be used to dynamically switch the effective QoS node based on the number of client nodes.

[0004] However, in the solution of switching the effective node of quality of service, there will be a temporary problem that the quality of service will not take effect when the effective node is switched, which will affect the stability of the distributed storage system. Summary of the Invention

[0005] Therefore, it is necessary to provide a flow control method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the stability of distributed storage systems in response to the above-mentioned technical problems.

[0006] On one hand, this application provides a flow control method applied to a management node in a distributed storage system, the distributed storage system including multiple storage nodes, comprising: when the current rate limiting mode switches from client mode to pre-switching mode, notifying both client nodes and storage nodes to switch to pre-switching mode respectively, so that the client nodes set a rule matching mark for target data packets and send them to the storage nodes, the target data packets being data packets that the client nodes need to send and that match the quality of service rules, and causing the storage nodes to generate first demand information based on the network resource demand information of the target data packets; receiving the first demand information from the storage nodes, generating and returning first token information based on the first demand information, the first token information being used for rate limiting in conjunction with the quality of service rules after the management node notifies the switch to storage node mode.

[0007] In this embodiment, in the pre-switching mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to the storage node mode, the storage node has already obtained valid token information (i.e., the first token information). This ensures that the storage node has accurate and valid token information (i.e., the first token information) after switching to the storage node mode. Therefore, after the management node notifies the storage node to switch to the storage node mode, the storage node can perform rate limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0008] In some embodiments, the method further includes: receiving second demand information from the client node in the pre-switching mode; generating and returning second token information based on the second demand information, wherein the second token information is used for rate limiting in conjunction with the quality of service rules before the management node notifies the switch to storage node mode.

[0009] In this embodiment, in the pre-switching mode, the management node calculates token information for both the storage node and the client node, so that both the storage node and the client node have token information during the switching process from the pre-switching mode to the storage node mode, ensuring that the service quality is not interrupted during the switching process.

[0010] In some embodiments, the method further includes: when the current rate limiting mode is client mode, detecting the number of client nodes currently accessing the distributed storage system to obtain the current number of nodes; and when the current number of nodes reaches a threshold, setting the current rate limiting mode to a pre-switching mode.

[0011] In this embodiment, when the number of current nodes reaches the threshold, it indicates that there are many client nodes accessing the distributed storage system. The effect of rate limiting on the client node side will be reduced. At this time, switching to storage node mode can perform rate limiting on the storage node side to ensure the rate limiting effect.

[0012] In some embodiments, the step of notifying the client node and storage node to switch to the pre-switching mode includes: responding to a first mode change acquisition request sent by the storage node, and if it is determined that the node is currently in the pre-switching mode, returning a first pre-switching message to the storage node, wherein the first pre-switching message is used to notify the node to switch to the pre-switching mode; and responding to a second mode change acquisition request sent by the client node, and if it is determined that the node is currently in the pre-switching mode, returning a second pre-switching message to the client node, wherein the second pre-switching message is used to notify the node to switch to the pre-switching mode.

[0013] In this embodiment, the storage node sends a first mode change acquisition request to the management node, and the client node sends a second mode change acquisition request to the management node, so that the client node and the storage node can synchronize the latest rate limiting mode from the management node in a timely manner.

[0014] In some embodiments, the storage node periodically sends a first mode change acquisition request to the management node according to a mode update acquisition cycle. The method further includes: when the termination condition of the pre-switching mode is met, sending a first mode switching message to the storage node, the first mode switching message being used to notify switching to storage node mode; and after the first mode switching message has been sent, waiting for at least one mode update acquisition cycle, sending a second mode switching message to the client node, the second mode switching message being used to notify switching to storage node mode.

[0015] In this embodiment, after the first mode switching message has been sent, the second mode switching message is sent to the client node only after at least one mode update acquisition cycle has been completed. This ensures that all storage nodes under the current environmental conditions have undergone at least one mode update acquisition cycle, so as to ensure that each storage node has updated itself to the current rate-limiting effective node (i.e., service quality effective node). This ensures that when the client node switches to non-rate-limiting mode and traffic reaches the storage node, the storage node knows that it is already a rate-limiting effective node.

[0016] In some embodiments, the management node periodically calculates first token information and second token information according to a token calculation cycle. Sending a first mode switching message to the storage node when the end condition of the pre-switching mode is met includes: detecting the duration of being in the pre-switching mode when the current rate limiting mode is set to the pre-switching mode; and sending a first mode switching message to the storage node when the duration of being in the pre-switching mode reaches the pre-switching mode duration. The pre-switching mode duration is greater than or equal to the total duration of at least one mode update acquisition cycle and at least one token calculation cycle.

[0017] In this embodiment, since the duration of the pre-switching mode is greater than or equal to the duration of at least one mode update acquisition cycle and the total duration of at least one token calculation cycle, it can be ensured that each node is synchronized to the pre-switching mode and obtains valid token information as much as possible.

[0018] On the other hand, this application provides a flow control method applied to a client node. The method includes: when the management node notifies the switch to a pre-switching mode, setting a rule matching flag for a target data packet and sending it to a storage node, so that after the management node notifies the storage node to switch to the pre-switching mode, the storage node generates and returns first demand information based on the network resource demand information of the target data packet, so that the management node generates and returns first token information based on the first demand information; wherein, the target data packet is a data packet that the client node needs to send and matches the quality of service rules, and the first token information is used for the storage node to perform flow limiting in conjunction with the quality of service rules after the management node notifies the storage node to switch to storage node mode, and the management node notifies the switch to the pre-switching mode when the current flow limiting mode is switched from client mode to pre-switching mode.

[0019] In this embodiment, in the pre-switching mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to the storage node mode, the storage node has already obtained valid token information (i.e., the first token information). This ensures that the storage node has accurate and valid token information (i.e., the first token information) after switching to the storage node mode. Therefore, after the management node notifies the storage node to switch to the storage node mode, the storage node can perform rate limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0020] On the other hand, this application provides a flow control method applied to a storage node. The method includes: when the management node notifies a switch to a pre-switch mode, generating first demand information based on network resource demand information of a target data packet, wherein the target data packet is sent to the storage node after setting a rule matching flag when the management node notifies a client node to switch to the pre-switch mode, and the target data packet is a data packet that the client node needs to send and matches a quality of service rule, and the management node notifies a switch to the pre-switch mode when the current rate limiting mode switches from client mode to pre-switch mode; sending the first demand information to the management node, and receiving first token information generated by the management node based on the first demand information; and performing rate limiting based on the first token information and the quality of service rule after the management node notifies a switch to storage node mode.

[0021] In this embodiment, in the pre-switching mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to the storage node mode, the storage node has already obtained valid token information (i.e., the first token information). This ensures that the storage node has accurate and valid token information (i.e., the first token information) after switching to the storage node mode. Therefore, after the management node notifies the storage node to switch to the storage node mode, the storage node can perform rate limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0022] On the other hand, this application also provides a traffic control device, including: a pre-switching notification module, used to notify both client nodes and storage nodes to switch to pre-switching mode when the current rate limiting mode switches from client mode to pre-switching mode, so that the client node sets a rule matching mark for a target data packet and sends it to the storage node, the target data packet being a data packet that the client node needs to send and that matches the quality of service rules, and causing the storage node to generate first demand information based on the network resource demand information of the target data packet; and a demand information processing module, used to receive the first demand information from the storage node, generate and return first token information based on the first demand information, the first token information being used for rate limiting in conjunction with the quality of service rules after the management node notifies the switch to storage node mode.

[0023] On the other hand, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described flow control method.

[0024] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described flow control method.

[0025] On the other hand, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the above-described flow control method.

[0026] In the pre-switching mode, the aforementioned flow control method, apparatus, computer equipment, computer-readable storage medium, and computer program product, since the target data packet is a data packet that the client node needs to send and matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates second demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the second demand information. Thus, before switching to storage node mode, the storage node has already obtained valid token information (i.e., first token information). This ensures that the storage node has accurate and valid token information (i.e., first token information) after switching to storage node mode. After the management node notifies the storage node to switch to storage node mode, the storage node can perform flow limiting based on the first token information. This can address the problem of temporary ineffective quality of service when the effective node switches, thereby improving the stability of the distributed storage system. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a diagram illustrating the application environment of the flow control method in one embodiment;

[0029] Figure 2 This is a flowchart illustrating a flow control method in one embodiment;

[0030] Figure 3 This is a schematic diagram of the processing flow of the QoS MGR module in the management node in one embodiment;

[0031] Figure 4This is a schematic diagram of the processing flow of a client node in one embodiment;

[0032] Figure 5 This is a schematic diagram of the processing flow of a storage node in one embodiment;

[0033] Figure 6 This is a structural block diagram of a flow control device in one embodiment;

[0034] Figure 7 This is an internal structural diagram of a computer device in one embodiment;

[0035] Figure 8 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0037] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0038] The flow control method provided in this application embodiment can be applied to, for example, Figure 1The application environment shown is a distributed storage system containing multiple storage nodes and a management node. The management node can be any storage node and can be replaced. Multiple client nodes (e.g., N client nodes, N≥2) connect to the distributed storage system. Each client node can correspond to a tenant, although different client nodes can correspond to the same tenant. The management node in the distributed storage system includes a QoS MGR module, which is responsible for managing and controlling QoS rules, status, and tokens. It manages QoS (Quality of Service) resources and then distributes them to various rate-limiting nodes. Rate-limiting nodes can be client nodes or storage nodes; they are nodes that enforce traffic limits and whose QoS is effective. MGR is an abbreviation for Manager. The management node is the server. Storage nodes are nodes that provide storage services. Client nodes are nodes that can access the resources of the storage nodes.

[0039] The client node can be deployed on the user's terminal or the client node itself can be the user's terminal. Terminals can be, but are not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Storage nodes can be independent physical servers or virtual machines, or cloud servers providing cloud computing services.

[0040] Distributed storage systems can be used to provide cloud services. In cloud service scenarios, when a distributed storage system provides services to cloud tenants, it is necessary to ensure that the services of each cloud tenant do not affect each other. For example, when tenant A accesses cloud services, the service quality of tenant B should not be degraded because tenant A consumes more service bandwidth or IOPS (Input / Output Operations Per Second). Therefore, service quality assurance is required for each cloud tenant to ensure that each cloud tenant uses the corresponding resources.

[0041] QoS (Quality of Service) can limit the upper limit of resources used by tenants and ensure that tenants receive the minimum resources. In the front-end network environment, QoS on firewalls or switches can guarantee network bandwidth and IOPS. However, in the back-end storage service, front-end QoS cannot accurately guarantee the QoS of the storage service. Therefore, distributed storage services also need to provide QoS functionality to ensure the quality of service of storage. A scheme of dynamically switching the QoS service quality effective node can be used, for example, dynamically switching the QoS service quality effective node based on the number of client nodes. However, in the scheme of switching the effective node, there will be a problem of temporary service quality failure when the effective node is switched. For example, during the switch, due to communication delays or synchronization issues between the MGR node and each effective node, client nodes and storage nodes may not be able to simultaneously perceive the mode switch, the MGR may not have complete information on the rate limiting node at the moment of mode switch, and the effective node may not report the demand information in a timely manner. As a result, the MGR cannot obtain accurate data to calculate reliable service quality indicators, thus affecting the overall service quality. The root cause of these problems is that existing distributed QoS schemes lack effective and reliable node switching mechanisms, and fail to achieve seamless integration and real-time synchronization of control policies, which in turn limits the ability to guarantee service quality during the switching process.

[0042] Based on this, in an exemplary embodiment, such as Figure 2 As shown, a flow control method is provided, applied to the management node of a distributed storage system. The distributed storage system includes multiple storage nodes, and includes the following steps:

[0043] Step 202: When the current rate limiting mode is switched from client mode to pre-switching mode, the client node and the storage node are notified to switch to pre-switching mode respectively, so that the client node sets the rule matching mark for the target data packet and sends it to the storage node. The target data packet is the data packet that the client node needs to send and matches the quality of service rule, and the storage node generates the first demand information based on the network resource demand information of the target data packet.

[0044] In this system, client-side mode is used for rate limiting based on Quality of Service (QoS) rules at the client node. Storage node mode is used for rate limiting based on QoS rules at the storage node. The switching direction is from client-side mode to storage node mode. Client-side mode can also be called client-side rate limiting mode, and storage node mode can also be called storage node rate limiting mode. In client-side mode, the client node is the effective rate limiting node; in storage node mode, the storage node is the effective rate limiting node. Therefore, switching rate limiting modes will switch the effective rate limiting node. Network resource demand information includes, but is not limited to, IOPS (Input / Output Operations Per Second) and bandwidth usage.

[0045] Quality of Service (QoS) rules refer to rules that match service quality rules. A QoS rule can include multiple sub-rules; a target data packet is considered to have matched a QoS rule if it matches any one of the sub-rules. Sub-rules can be related to directories or IP (Internet Protocol) addresses; for example, one sub-rule might be for packets originating from a first IP address, and another for packets destined for a second IP address. Data packets that a client node needs to send but do not match a QoS rule are not marked. A rule matching tag is used to indicate a match to a QoS rule. The specific form of the rule matching tag can be set according to actual needs; for example, it can be a preset label.

[0046] For example, a client node can send target data packets to a storage node according to QoS rules.

[0047] For example, when the current rate limiting mode is client mode, the management node can periodically or in real-time detect the number of client nodes currently accessing the distributed storage system to obtain the current node count. Pre-switch conditions may include the current node count reaching a threshold. Alternatively, pre-switch conditions may include a change in the current node count and the current node count reaching a threshold.

[0048] In an exemplary embodiment, the method further includes: in pre-switching mode, receiving second demand information from a client node; generating and returning second token information based on the second demand information, the second token information being used for rate limiting in conjunction with quality of service rules before the management node notifies the switch to storage node mode.

[0049] The second requirement information may include the number of tokens the client node needs in the next token calculation cycle, and may also include the number of tokens consumed in the current token calculation cycle. Before the management node notifies the client node to switch to storage node mode, the client node can perform rate limiting based on the received second token information.

[0050] For example, for a target data packet that matches the quality of service rule, the required token resource is obtained from the token bucket corresponding to the second token information. If the token resource is successfully obtained, the target data packet is sent to the storage node. If the token resource is not successfully obtained, the target data packet cannot pass through.

[0051] In this embodiment, in the pre-switching mode, the management node calculates token information for both the storage node and the client node, so that both the storage node and the client node have token information during the switching process from the pre-switching mode to the storage node mode, ensuring that the service quality is not interrupted during the switching process.

[0052] For example, a storage node may periodically send a request to the management node to obtain a first mode change. In response to the first mode change request, if the management node determines that it is currently in a pre-switch mode, it returns a first pre-switch message to the storage node.

[0053] Similarly, client nodes can periodically send a second mode change acquisition request to the management node. In response to the second mode change acquisition request, if the management node determines that it is currently in pre-switch mode, it returns a second pre-switch message to the client nodes.

[0054] Step 204: Receive first demand information from storage nodes, generate and return first token information based on the first demand information, and use the first token information to perform rate limiting in conjunction with quality of service rules after the management node notifies the switch to storage node mode.

[0055] The sending of the first pre-switching message to the storage node and the sending of the second pre-switching message to the client node can be performed in parallel or sequentially. This application does not limit the order in which the first pre-switching message and the second pre-switching message are sent.

[0056] The management node maintains the current rate limiting mode, and the storage nodes and client nodes also maintain their own rate limiting modes locally. When the current rate limiting mode changes, the storage nodes and client nodes are notified to synchronize the rate limiting mode.

[0057] For example, after notifying the storage node to switch to storage node mode, the management node then notifies the client node to switch to storage node mode. In other words, the management node first notifies the storage node to switch its local rate limiting mode to storage node mode, and then notifies the client node to switch its local rate limiting mode to storage node mode.

[0058] In the aforementioned flow control method, under pre-switch mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching flag on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to storage node mode, the storage node has already obtained valid token information (i.e., first token information). This ensures that the storage node has accurate and valid token information (i.e., first token information) after switching to storage node mode. Therefore, after the management node notifies the storage node to switch to storage node mode, the storage node can perform flow limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0059] In an exemplary embodiment, the method further includes: when the current rate limiting mode is client mode, detecting the number of client nodes currently accessing the distributed storage system to obtain the current number of nodes; and when the current number of nodes reaches a threshold, setting the current rate limiting mode to pre-switching mode.

[0060] The quantity threshold can be set and updated according to actual needs, and this application does not limit the specific value of the data threshold.

[0061] In this embodiment, when the number of current nodes reaches the threshold, it indicates that there are many client nodes accessing the distributed storage system. The effect of rate limiting on the client node side will be reduced. At this time, switching to storage node mode can perform rate limiting on the storage node side to ensure the rate limiting effect.

[0062] In an exemplary embodiment, notifying both the client node and the storage node to switch to pre-switching mode includes: responding to a first mode change acquisition request sent by the storage node, and if it is determined that the node is currently in pre-switching mode, returning a first pre-switching message to the storage node, wherein the first pre-switching message is used to notify the node to switch to pre-switching mode; and responding to a second mode change acquisition request sent by the client node, and if it is determined that the node is currently in pre-switching mode, returning a second pre-switching message to the client node, wherein the second pre-switching message is used to notify the node to switch to pre-switching mode.

[0063] For example, a storage node may periodically send a first mode change request to the management node according to a mode update acquisition cycle. A client node may periodically send a second mode change request to the management node according to a mode update acquisition cycle.

[0064] In this embodiment, the storage node sends a first mode change acquisition request to the management node, and the client node sends a second mode change acquisition request to the management node, so that the client node and the storage node can synchronize the latest rate limiting mode from the management node in a timely manner.

[0065] In an exemplary embodiment, the storage node periodically sends a first mode change acquisition request to the management node according to the mode update acquisition cycle. The method further includes: when the end condition of the pre-switching mode is met, sending a first mode switching message to the storage node, the first mode switching message being used to notify the switching to the storage node mode; and after the first mode switching message has been sent, waiting for at least one mode update acquisition cycle, sending a second mode switching message to the client node, the second mode switching message being used to notify the switching to the storage node mode.

[0066] The termination condition for the pre-switching mode can include the duration of the pre-switching mode being in effect reaching the pre-switching mode duration. The pre-switching mode duration can be set and updated according to actual needs.

[0067] In this embodiment, after the first mode switching message has been sent, the second mode switching message is sent to the client node only after at least one mode update acquisition cycle has been completed. This ensures that all storage nodes under the current environmental conditions have undergone at least one mode update acquisition cycle, so as to ensure that each storage node has updated itself to the current rate-limiting effective node as much as possible. This ensures that when the client node switches to non-rate-limiting mode and traffic reaches the storage node, the storage node knows that it is already a rate-limiting effective node.

[0068] In an exemplary embodiment, the management node periodically calculates the first token information and the second token information according to the token calculation cycle. When the end condition of the pre-switching mode is met, the management node sends a first mode switching message to the storage node, including: when the current rate limiting mode is set to the pre-switching mode, detecting the duration of the pre-switching mode; and when the duration of the pre-switching mode reaches the pre-switching mode duration, sending a first mode switching message to the storage node.

[0069] The pre-switching mode duration is greater than or equal to the total duration of at least one mode update acquisition cycle and at least one token calculation cycle. The token calculation cycle is the cycle for calculating token information (e.g., the first token information and the second token information).

[0070] For example, in pre-switch mode, the management node can periodically calculate the first token information and the second token information according to the token calculation cycle.

[0071] In this embodiment, since the duration of the pre-switching mode is greater than or equal to the total duration of at least one mode update acquisition cycle and at least one token calculation cycle, it can be ensured that each node is synchronized to the pre-switching mode and obtains valid token information as much as possible.

[0072] In one exemplary embodiment, a flow control method is provided, applied to a client node, comprising the following steps:

[0073] Step 302: When the management node notifies that the mode has been switched to pre-switch mode, set a rule matching flag for the target data packet and send it to the storage node.

[0074] The target data packet is a data packet that the client node needs to send and that matches the quality of service rules. This allows the management node to notify the storage node to switch to the pre-switch mode. The storage node then generates and returns first demand information based on the network resource demand information of the target data packet. This allows the management node to generate and return first token information based on the first demand information. The first token information is used by the storage node to perform rate limiting in combination with the quality of service rules after the management node notifies the storage node to switch to the storage node mode. The management node notifies the switch to the pre-switch mode when the current rate limiting mode is switched from the client mode to the pre-switch mode.

[0075] For example, in pre-switch mode, the client node sends a second demand information to the management node, receives a second token information generated by the management node based on the second demand information, and performs rate limiting based on the second token information and quality of service rules. It should be noted that in client mode, the client node also reports its own demand information to the management node to obtain corresponding token information for rate limiting.

[0076] For example, when the management node notifies the client node to switch to storage node mode, the client node updates its local rate limiting mode to non-rate limiting mode, thereby stopping rate limiting.

[0077] In this embodiment, in the pre-switching mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to the storage node mode, the storage node has already obtained valid token information (i.e., the first token information). This ensures that the storage node has accurate and valid token information (i.e., the first token information) after switching to the storage node mode. Therefore, after the management node notifies the storage node to switch to the storage node mode, the storage node can perform rate limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0078] In one exemplary embodiment, a flow control method is provided, applied to a storage node, the method comprising:

[0079] Step 402: When the management node notifies the switch to pre-switch mode, first demand information is generated based on the network resource demand information of the target data packet. The target data packet is sent to the storage node after setting a rule matching mark on the target data packet when the management node notifies the client node to switch to pre-switch mode. The target data packet is the data packet that the client node needs to send and matches the quality of service rule. The management node notifies the switch to pre-switch mode when the current rate limiting mode is switched from client mode to pre-switch mode.

[0080] Step 404: Send the first requirement information to the management node and receive the first token information generated by the management node based on the first requirement information.

[0081] Step 406: After the management node notifies the switch to storage node mode, rate limiting is performed based on the first token information and service quality rules.

[0082] For example, before notifying the client node to switch to storage node mode, the client node performs rate limiting based on the second token information and quality of service rules. The second token information is generated by the management node based on the second demand information from the client node.

[0083] In this embodiment, in the pre-switching mode, since the target data packet is a data packet that the client node needs to send and that matches the quality of service rules, the client node sets a rule matching mark on the target data packet and sends it to the storage node. The storage node generates first demand information based on the network resource demand information of the target data packet, and the management node generates and returns first token information based on the first demand information. Thus, before switching to the storage node mode, the storage node has already obtained valid token information (i.e., the first token information). This ensures that the storage node has accurate and valid token information (i.e., the first token information) after switching to the storage node mode. Therefore, after the management node notifies the storage node to switch to the storage node mode, the storage node can perform rate limiting based on the first token information. This can address the problem of temporary service quality failure when the effective node switches, thereby improving the stability of the distributed storage system.

[0084] This application provides a flow control method that, when switching flow control modes in a distributed storage system (e.g., from client mode to storage node mode), uses a pre-notification approach and a sequential mode switching mechanism to minimize flow control failures during mode switching. The management node includes a QoS MGR module, which can execute flow control. Specifically, it combines... Figure 3 QoS MGR module processing flow Figure 4 The processing flow of the client node and Figure 5 The processing flow of the storage node is explained in detail:

[0085] 1. The QoS MGR module periodically calculates the number of client nodes under the current rate limiting mode (client mode). When the number of client nodes changes and the switching conditions for rate limiting effective nodes are met, the QoS MGR module records that the current mode is pre-switching mode and the switching direction is from client mode to storage node mode.

[0086] Among them, the conditions for switching nodes to take effect for rate limiting include the number of client nodes reaching (i.e., greater than or equal to) a certain threshold.

[0087] 2. The client node and storage node periodically send messages to the QoS MGR module to obtain information on rule changes. The QoS MGR module detects that it is currently in pre-switch mode and replies to the client node and storage node with the pre-switch mode information through a rule change message.

[0088] The message for obtaining rule change information, such as a first mode change request and a second mode change request, is used to obtain the updated rate limiting mode. The rule change message may be, for example, a first pre-switch message or a second pre-switch message.

[0089] 3. When the client node receives the reply message (rule change message, i.e., the second pre-switching message) and parses it to find that it is currently in pre-switching mode, it continues to perform QoS service quality assurance service. At the same time, it marks the IO (Input / Output) data packets that match the QoS rules with a rule matching mark and sends the data packets to the storage node.

[0090] 4. When the storage node receives the reply message (rule change message, i.e., the first pre-switching message) from the QoS MGR module and parses it to find that it is currently in pre-switching mode and the mode after pre-switching is storage node mode, it starts to perform rule matching on IO packets. Only IO packets with rule matching marks are matched for QoS rules, and IO packets without rule matching marks are not matched for QoS rules to reduce resource consumption. At the same time, when there is no pre-switching mode and the rate limiting node is in storage node mode, the storage node does not perform QoS rule matching regardless of whether there are rule matching marks on the IO packets.

[0091] The purpose of the storage node performing rule matching on IO packets is to calculate demand information (i.e., the first demand information).

[0092] 5. In pre-switch mode, if the IO packets on the storage node match the QoS rules, the corresponding packet information (i.e., network resource demand information such as IOPS and / or bandwidth usage) is added to the demand information of the QoS rules (i.e., the first demand information), so that the first demand information is dynamically changing.

[0093] Adding the corresponding data packet information to the first requirement information means adding the number of tokens used in the current token calculation cycle to the first requirement information.

[0094] 6. In pre-switching mode, storage nodes periodically report QoS rule requirement information (i.e., first requirement information) to the QoS MGR module. At the same time, in pre-switching mode, the QoS MGR module needs to receive the first requirement information and the second requirement information sent by the client and the storage node, respectively. In non-pre-switching mode, the QoS MGR module only receives the requirement information sent by the nodes where rate limiting is effective. The requirement information of nodes where rate limiting is not effective will be directly discarded and will not be received by the QoS MGR module, thereby reducing resource consumption.

[0095] 7. In pre-switchover mode, the QoS MGR module needs to calculate the token information for the two types of active nodes separately based on the demand information. Since the storage nodes are also reporting demand information at this time, the QoS MGR module can also calculate the token information for the storage nodes. At this time, the QoS MGR module maintains two sets of token information data, which are independent of each other. When the client node and the storage node report demand information, the corresponding token information is returned to the client node and the storage node.

[0096] 8. In pre-switch mode, the client node continues to perform QoS service quality assurance. Although the storage node receives the token information, it does not perform QoS service quality assurance in pre-switch mode. It only ensures that the storage node has the token information in pre-switch mode.

[0097] 9. The QoS MGR module dynamically calculates the duration required for the pre-switching mode. When the pre-switching mode duration is reached, the rate limiting mode is switched, but the storage node and the client node cannot be notified simultaneously. The storage node must be notified first. After at least one rule update cycle (i.e., mode update acquisition cycle) of the storage node has elapsed (ensuring that all storage nodes have gone through at least one rule update cycle under the current environment conditions to ensure that the storage nodes have been updated to be the current rate limiting effective nodes, and to ensure that when traffic reaches the storage node when the client node switches to non-rate limiting mode, the storage node needs to know that it is now a rate limiting effective node), the rate limiting mode of the client node will be updated. The mode switching instruction information is carried back by the rule update messages of the storage node and the client node respectively.

[0098] 10. When a storage node receives a switch to storage node mode, it begins to perform QoS service quality assurance. It no longer checks whether there is an IO rule matching mark on the data packet, because at this time the storage node already has a token information distributed by the QoS MGR module, and can directly use the token information for service quality assurance.

[0099] 11. When the client node receives a signal indicating a change from pre-switch mode to complete the switch, the client node will no longer perform QoS service quality assurance, all data packets will no longer be matched against QoS rules, and subsequent processing will be performed directly.

[0100] 12. When the switching of the rate limiting effective node is completed, the QoS MGR module will no longer receive the demand information reported by the client node or reply with token information. The QoS MGR module will discard the previously calculated token information of the client node and will no longer calculate the token information of the client node. It will only calculate the token information of the storage node and reply to the storage node.

[0101] This embodiment ensures that both the client node and the storage node have valid token information when switching the rate limiting effective node, thus enabling QoS service quality assurance. This avoids the problem of temporary ineffectiveness of QoS service assurance caused by network latency and other factors when the rate limiting effective node is switched in a distributed storage system.

[0102] The traffic control method provided in this application uses a pre-switching mode to notify each rate-limiting node to prepare for a switchover and to ensure that the node to be switched is itself. In pre-switching mode, the node to be switched begins to collect current demand information and reports it to the QoS MGR module, allowing the QoS MGR module to allocate token information based on the demand information. In pre-switching mode, the QoS MGR needs to calculate two types of token information separately and reply to each node with the token information. When switching rate-limiting nodes, the QoS MGR module needs to calculate the timing precisely and notify the node to be switched before notifying the currently switching node. This ensures that both client nodes and storage nodes have valid token information during the switchover of rate-limiting nodes, thus enabling QoS service quality assurance. This avoids the problem of temporary ineffectiveness of QoS service assurance caused by network latency and other factors affecting the simultaneous availability of valid token information on client nodes and storage nodes during rate-limiting node switching in distributed storage systems.

[0103] Therefore, the flow control method provided in this application enables distributed storage systems to maintain uninterrupted QoS service quality during QoS service quality assurance node switching in various scenarios. The pre-switching method using the QoS MGR module allows both client and storage nodes to anticipate the upcoming QoS service quality assurance node switch and the type of node that will become active after the switch. It also implements a method for calculating the QoS type for two different active QoS types in pre-switching mode, ensuring that currently inactive nodes can obtain valid token information and prepare token information for subsequent switching. By first notifying the node to be active (i.e., the storage node) and then notifying the currently active node (i.e., the client node) to perform the switch, it ensures that IO data packets can effectively match the corresponding QoS rules, enabling uninterrupted QoS service quality operation.

[0104] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0105] Based on the same inventive concept, this application also provides a flow control device for implementing the flow control method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more flow control device embodiments provided below can be found in the limitations of the flow control method described above, and will not be repeated here.

[0106] In one exemplary embodiment, such as Figure 6 As shown, a flow control device is provided, including: a pre-switching notification module 602 and a demand information processing module 604, wherein:

[0107] The pre-switching notification module 602 is used to notify both the client node and the storage node to switch to pre-switching mode when the current rate limiting mode switches from client mode to pre-switching mode. This allows the client node to set a rule matching mark for the target data packet and send it to the storage node. The target data packet is the data packet that the client node needs to send and that matches the quality of service rules. The storage node then generates first demand information based on the network resource demand information of the target data packet.

[0108] The demand information processing module 604 is used to receive the first demand information from the storage node, generate and return the first token information based on the first demand information, and use the first token information to perform rate limiting in combination with the quality of service rules after the management node notifies the switch to storage node mode.

[0109] In some embodiments, the demand information processing module is further configured to: receive second demand information from client nodes in pre-switching mode; generate and return second token information based on the second demand information, wherein the second token information is used to perform rate limiting in conjunction with quality of service rules before the management node notifies the switch to storage node mode.

[0110] In some embodiments, the apparatus is further configured to: when the current rate limiting mode is client mode, detect the number of client nodes currently accessing the distributed storage system and obtain the current number of nodes; when the current number of nodes reaches a threshold, set the current rate limiting mode to pre-switching mode.

[0111] In some embodiments, the pre-switching notification module 602 is further configured to: respond to a first mode change acquisition request sent by a storage node, and if it is determined that the current state is in pre-switching mode, return a first pre-switching message to the storage node, the first pre-switching message being used to notify the switch to pre-switching mode; and respond to a second mode change acquisition request sent by a client node, and if it is determined that the current state is in pre-switching mode, return a second pre-switching message to the client node, the second pre-switching message being used to notify the switch to pre-switching mode.

[0112] In some embodiments, the storage node periodically sends a first mode change acquisition request to the management node according to the mode update acquisition cycle. The apparatus further includes a switching message sending module, which is configured to: send a first mode switching message to the storage node when the end condition of the pre-switching mode is met, the first mode switching message being used to notify the switching to the storage node mode; and, after the first mode switching message has been sent, send a second mode switching message to the client node after waiting for at least one mode update acquisition cycle, the second mode switching message being used to notify the switching to the storage node mode.

[0113] In some embodiments, the management node periodically calculates the first token information and the second token information according to the token calculation cycle. The switching message sending module is further configured to: detect the duration of being in the pre-switching mode when the current rate limiting mode is set to the pre-switching mode; and send a first mode switching message to the storage node when the duration of being in the pre-switching mode reaches the pre-switching mode duration; wherein the pre-switching mode duration is greater than or equal to the duration of at least one mode update acquisition cycle and the total duration of at least one token calculation cycle.

[0114] Each module in the aforementioned flow control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0115] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores at least some of the data involved in the flow control method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a flow control method.

[0116] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a flow control method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0117] Those skilled in the art will understand that Figure 7 and Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0118] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

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

[0120] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0122] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0123] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0124] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A flow control method, characterized in that, The method, applied to management nodes in a distributed storage system, wherein the distributed storage system includes multiple storage nodes, comprises: When the current rate limiting mode is switched from client mode to pre-switching mode, the client node and the storage node are notified to switch to pre-switching mode respectively, so that the client node sets a rule matching mark for the target data packet and sends it to the storage node. The target data packet is the data packet that the client node needs to send and matches the quality of service rule, and the storage node generates first demand information based on the network resource demand information of the target data packet. The system receives first demand information from the storage node, generates and returns first token information based on the first demand information, and uses the first token information to perform rate limiting in conjunction with the quality of service rules after the management node notifies the system to switch to storage node mode.

2. The method according to claim 1, characterized in that, The method further includes: In the pre-switching mode, second demand information is received from the client node; A second token is generated and returned based on the second requirement information. The second token is used to perform rate limiting in conjunction with the quality of service rules before the management node notifies the switch to storage node mode.

3. The method according to claim 1, characterized in that, The method further includes: When the current rate limiting mode is client mode, detect the number of client nodes currently accessing the distributed storage system and obtain the current number of nodes; If the current number of nodes reaches the threshold, the current rate limiting mode will be set to pre-switching mode.

4. The method according to any one of claims 1 to 3, characterized in that, The step of separately notifying the client node and storage node to switch to pre-switching mode includes: In response to a first mode change acquisition request sent by a storage node, if it is determined that the current state is already in the pre-switching mode, a first pre-switching message is returned to the storage node, the first pre-switching message being used to notify the switch to the pre-switching mode; In response to a second mode change request sent by a client node, if it is determined that the current state is already in the pre-switching mode, a second pre-switching message is returned to the client node. The second pre-switching message is used to notify the user to switch to the pre-switching mode.

5. The method according to claim 4, characterized in that, The storage node periodically sends a first mode change acquisition request to the management node according to the mode update acquisition cycle, and the method further includes: When the termination condition of the pre-switching mode is met, a first mode switching message is sent to the storage node. The first mode switching message is used to notify the switch to storage node mode. If the first mode switching message has been sent, after waiting for at least one mode update acquisition cycle, a second mode switching message is sent to the client node. The second mode switching message is used to notify the switch to storage node mode.

6. The method according to claim 5, characterized in that, The management node periodically calculates the first token information and the second token information according to the token calculation cycle. When the termination condition of the pre-switching mode is met, the management node sends a first mode switching message to the storage node, including: When the current rate limiting mode is set to pre-switching mode, the duration of time in the pre-switching mode is detected; If the duration of the pre-switching mode reaches the pre-switching mode duration, a first mode switching message is sent to the storage node; Wherein, the duration of the pre-switching mode is greater than or equal to the duration of at least one mode update acquisition cycle and the total duration of at least one token calculation cycle.

7. A flow control method, characterized in that, Applied to client nodes, the method includes: When the management node notifies the switch to pre-switch mode, a rule matching tag is set on the target data packet and then sent to the storage node. This allows the storage node to generate and return first demand information based on the network resource demand information of the target data packet after the management node notifies the storage node to switch to the pre-switch mode. This allows the management node to generate and return first token information based on the first demand information. The target data packet is the data packet that the client node needs to send and that matches the quality of service rules. The first token information is used to limit the rate of service in conjunction with the quality of service rules after the management node notifies the storage node to switch to storage node mode. The management node notifies the switch to pre-switch mode when the current rate limiting mode is switched from client mode to pre-switch mode.

8. A flow control method, characterized in that, Applied to storage nodes, the method includes: When the management node notifies the switch to pre-switch mode, first demand information is generated based on the network resource demand information of the target data packet. The target data packet is sent to the storage node after setting a rule matching mark on the target data packet when the management node notifies the client node to switch to pre-switch mode. The target data packet is a data packet that the client node needs to send and matches the quality of service rules. The management node notifies the switch to pre-switch mode when the current rate limiting mode is switched from client mode to pre-switch mode. Send first demand information to the management node and receive first token information generated by the management node based on the first demand information; After the management node notifies the switch to storage node mode, rate limiting is performed based on the first token information and the service quality rules.

9. A flow control device, characterized in that, The device is a management node in a distributed storage system, which includes multiple storage nodes. The pre-switching notification module is used to notify both the client node and the storage node to switch to pre-switching mode when the current rate limiting mode switches from client mode to pre-switching mode. This allows the client node to set a rule matching mark for the target data packet and send it to the storage node. The target data packet is the data packet that the client node needs to send and that matches the quality of service rule. The storage node then generates first demand information based on the network resource demand information of the target data packet. The demand information processing module is used to receive first demand information from the storage node, generate and return first token information based on the first demand information, and use the first token information to perform rate limiting in conjunction with the service quality rules after the management node notifies the switch to storage node mode.

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

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.